1
0
Fork 0

Fix #6004: Add UI sync integration test for Bookmarks (#6019)

* Fix #6004: Add UI sync integration test for Bookmarks

* fix two typos
master
isabelrios 2019-10-21 19:01:17 +02:00 committed by Jeff Boek
parent fbec001e28
commit 06c1ef49b2
3 changed files with 21 additions and 27 deletions

View File

@ -46,9 +46,6 @@ class SyncIntegrationTest {
}.openHistory { } }.openHistory { }
historyAfterSyncIsShown() historyAfterSyncIsShown()
} }
/* These tests will be running in the future
// once the test above runs successfully and
// the environment is stable
// Bookmark item Desktop -> Fenix // Bookmark item Desktop -> Fenix
@Test @Test
@ -62,6 +59,10 @@ class SyncIntegrationTest {
bookmarkAfterSyncIsShown() bookmarkAfterSyncIsShown()
} }
/* These tests will be running in the future
// once the test above runs successfully and
// the environment is stable
// History item Fenix -> Desktop // History item Fenix -> Desktop
@Test @Test
fun checkBookmarkFromDeviceTest() { fun checkBookmarkFromDeviceTest() {
@ -99,7 +100,7 @@ class SyncIntegrationTest {
continueButton.clickAndWait(Until.newWindow(), TestAssetHelper.waitingTime) continueButton.clickAndWait(Until.newWindow(), TestAssetHelper.waitingTime)
} }
fun typePassowrd() { fun typePassword() {
val passwordInput = mDevice.findObject(UiSelector() val passwordInput = mDevice.findObject(UiSelector()
.instance(0) .instance(0)
.className(EditText::class.java)) .className(EditText::class.java))
@ -109,7 +110,7 @@ class SyncIntegrationTest {
} }
fun tapOnSignIn() { 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 // Let's tap on enter, sometimes depending on the device the sign in button is
// hidden by the keyboard // hidden by the keyboard
mDevice.pressEnter() mDevice.pressEnter()
@ -126,8 +127,8 @@ class SyncIntegrationTest {
} }
fun bookmarkAfterSyncIsShown() { fun bookmarkAfterSyncIsShown() {
val bookmarkyEntry = mDevice.findObject(By.text("Example Domain")) val bookmarkEntry = mDevice.findObject(By.text("Example Domain"))
bookmarkyEntry.isEnabled() bookmarkEntry.isEnabled()
} }
fun seeBookmark() { fun seeBookmark() {
@ -137,14 +138,8 @@ class SyncIntegrationTest {
} }
fun tapReturnToPreviousApp() { fun tapReturnToPreviousApp() {
mDevice.wait(Until.findObjects(By.text("Connected")), TestAssetHelper.waitingTime) sleep(TestAssetHelper.waitingTime)
mDevice.pressBack()
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()
} }
fun signInFxSync() { fun signInFxSync() {
@ -157,8 +152,8 @@ class SyncIntegrationTest {
typeEmail() typeEmail()
tapOnContinueButton() tapOnContinueButton()
typePassowrd() typePassword()
sleep(TestAssetHelper.waitingTime) sleep(TestAssetHelper.waitingTimeShort)
tapOnSignIn() tapOnSignIn()
} }
} }

View File

@ -12,7 +12,7 @@ var phases = { "phase1": "profile1" };
// expected bookmark state // expected bookmark state
var bookmarksExpected = { var bookmarksCreated = {
"mobile": [{ "mobile": [{
uri: "http://www.example.com/", uri: "http://www.example.com/",
title: "Example Domain"}] title: "Example Domain"}]
@ -21,5 +21,6 @@ var bookmarksExpected = {
// sync and verify bookmarks // sync and verify bookmarks
Phase("phase1", [ Phase("phase1", [
[Sync], [Sync],
[Bookmarks.verify, bookmarksExpected], [Bookmarks.add, bookmarksCreated],
]); [Sync]
]);

View File

@ -3,12 +3,10 @@ import sys
def test_sync_history_from_desktop(tps, gradlewbuild): def test_sync_history_from_desktop(tps, gradlewbuild):
# Running tests
tps.run('test_history.js') tps.run('test_history.js')
gradlewbuild.test('checkHistoryFromDesktopTest') gradlewbuild.test('checkHistoryFromDesktopTest')
'''
# For the future, this way we change the test to run.... def test_sync_bookmark_from_device(tps, gradlewbuild):
def test_sync_bookmark_from_device(tps, xcodebuild): os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
gradlewbuild.test('checkBookmarkFromDeviceTest') tps.run('test_bookmark.js')
tps.run('app/src/androidTest/java/org/mozilla/fenix/ui/SyncIntegrationTests/test_bookmark.js') gradlewbuild.test('checkBookmarkFromDesktopTest')
'''