diff --git a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt index 3e0f633af..92f0f1837 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt @@ -46,9 +46,6 @@ class SyncIntegrationTest { }.openHistory { } historyAfterSyncIsShown() } - /* These tests will be running in the future - // once the test above runs successfully and - // the environment is stable // Bookmark item Desktop -> Fenix @Test @@ -62,6 +59,10 @@ class SyncIntegrationTest { bookmarkAfterSyncIsShown() } + /* These tests will be running in the future + // once the test above runs successfully and + // the environment is stable + // History item Fenix -> Desktop @Test fun checkBookmarkFromDeviceTest() { @@ -99,7 +100,7 @@ class SyncIntegrationTest { continueButton.clickAndWait(Until.newWindow(), TestAssetHelper.waitingTime) } - fun typePassowrd() { + fun typePassword() { val passwordInput = mDevice.findObject(UiSelector() .instance(0) .className(EditText::class.java)) @@ -109,7 +110,7 @@ class SyncIntegrationTest { } fun tapOnSignIn() { - mDevice.wait(Until.findObjects(By.text("Sign in")), TestAssetHelper.waitingTime) + mDevice.wait(Until.findObjects(By.text("Sign in")), TestAssetHelper.waitingTimeShort) // Let's tap on enter, sometimes depending on the device the sign in button is // hidden by the keyboard mDevice.pressEnter() @@ -126,8 +127,8 @@ class SyncIntegrationTest { } fun bookmarkAfterSyncIsShown() { - val bookmarkyEntry = mDevice.findObject(By.text("Example Domain")) - bookmarkyEntry.isEnabled() + val bookmarkEntry = mDevice.findObject(By.text("Example Domain")) + bookmarkEntry.isEnabled() } fun seeBookmark() { @@ -137,14 +138,8 @@ class SyncIntegrationTest { } fun tapReturnToPreviousApp() { - mDevice.wait(Until.findObjects(By.text("Connected")), TestAssetHelper.waitingTime) - - val settingsLabel = mDevice.wait(Until.findObject(By.text("Settings")), TestAssetHelper.waitingTime) - settingsLabel.isClickable() - - mDevice.wait(Until.findObjects(By.desc("Navigate up")), TestAssetHelper.waitingTime) - val backButton = mDevice.findObject(By.desc("Navigate up")) - backButton.click() + sleep(TestAssetHelper.waitingTime) + mDevice.pressBack() } fun signInFxSync() { @@ -157,8 +152,8 @@ class SyncIntegrationTest { typeEmail() tapOnContinueButton() - typePassowrd() - sleep(TestAssetHelper.waitingTime) + typePassword() + sleep(TestAssetHelper.waitingTimeShort) tapOnSignIn() } } diff --git a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_bookmark.js b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_bookmark.js index a6a42aa6d..e1210bd24 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_bookmark.js +++ b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_bookmark.js @@ -12,7 +12,7 @@ var phases = { "phase1": "profile1" }; // expected bookmark state -var bookmarksExpected = { +var bookmarksCreated = { "mobile": [{ uri: "http://www.example.com/", title: "Example Domain"}] @@ -21,5 +21,6 @@ var bookmarksExpected = { // sync and verify bookmarks Phase("phase1", [ [Sync], - [Bookmarks.verify, bookmarksExpected], -]); + [Bookmarks.add, bookmarksCreated], + [Sync] +]); \ No newline at end of file diff --git a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_integration.py b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_integration.py index 7a2ab5b94..0183bf00b 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_integration.py +++ b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_integration.py @@ -3,12 +3,10 @@ import sys def test_sync_history_from_desktop(tps, gradlewbuild): - # Running tests tps.run('test_history.js') gradlewbuild.test('checkHistoryFromDesktopTest') -''' -# For the future, this way we change the test to run.... -def test_sync_bookmark_from_device(tps, xcodebuild): - gradlewbuild.test('checkBookmarkFromDeviceTest') - tps.run('app/src/androidTest/java/org/mozilla/fenix/ui/SyncIntegrationTests/test_bookmark.js') -''' \ No newline at end of file + +def test_sync_bookmark_from_device(tps, gradlewbuild): + os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/') + tps.run('test_bookmark.js') + gradlewbuild.test('checkBookmarkFromDesktopTest')