1
0
Fork 0

Update UI Sync integration tests and fix TPS preference. (#8489)

master
isabelrios 2020-02-27 22:32:24 +01:00 committed by GitHub
parent f7aec4c788
commit b432f5c495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 11 deletions

13
Jenkinsfile vendored
View File

@ -9,6 +9,7 @@ pipeline {
} }
stages { stages {
stage('test') { stage('test') {
when { branch 'master' }
steps { steps {
dir('app/src/androidTest/java/org/mozilla/fenix/syncIntegration') { dir('app/src/androidTest/java/org/mozilla/fenix/syncIntegration') {
sh 'pipenv install' sh 'pipenv install'
@ -21,6 +22,7 @@ pipeline {
post { post {
always { always {
script { script {
if (env.BRANCH_NAME == 'master') {
publishHTML(target: [ publishHTML(target: [
allowMissing: false, allowMissing: false,
alwaysLinkToLastBuild: true, alwaysLinkToLastBuild: true,
@ -28,13 +30,18 @@ pipeline {
reportDir: '/Users/synctesting/.jenkins/workspace/fenix/app/src/androidTest/java/org/mozilla/fenix/syncintegration/results', reportDir: '/Users/synctesting/.jenkins/workspace/fenix/app/src/androidTest/java/org/mozilla/fenix/syncintegration/results',
reportFiles: 'index.html', reportFiles: 'index.html',
reportName: 'HTML Report']) reportName: 'HTML Report'])
}
} }
} }
failure { failure {
slackSend( script {
color: 'danger', if (env.BRANCH_NAME == 'master') {
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})") slackSend(
color: 'danger',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
} }
fixed { fixed {

View File

@ -0,0 +1,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix
import android.content.Context
import mozilla.components.concept.engine.EngineSession
import mozilla.components.concept.engine.request.RequestInterceptor
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ui.robots.appContext
/**
* This class overrides the application's request interceptor to
* deactivate the FxA web channel
* which is not supported on the staging servers.
*/
class AppRequestInterceptor(private val context: Context) : RequestInterceptor {
override fun onLoadRequest(
engineSession: EngineSession,
uri: String,
hasUserGesture: Boolean,
isSameDomain: Boolean
): RequestInterceptor.InterceptionResponse? {
return appContext.components.services.accountsAuthFeature.interceptor.onLoadRequest(
engineSession, uri, hasUserGesture, isSameDomain)
}
}

View File

@ -62,6 +62,8 @@ class SyncIntegrationTest {
fun checkHistoryFromDesktopTest() { fun checkHistoryFromDesktopTest() {
signInFxSync() signInFxSync()
tapReturnToPreviousApp() tapReturnToPreviousApp()
// Let's wait until homescreen is shown to go to three dot menu
mDevice.waitNotNull(Until.findObjects(By.text("Open tabs")), TestAssetHelper.waitingTime)
homeScreen { homeScreen {
}.openThreeDotMenu { }.openThreeDotMenu {
}.openHistory { } }.openHistory { }
@ -82,7 +84,7 @@ class SyncIntegrationTest {
@Test @Test
fun checkAccountSettings() { fun checkAccountSettings() {
signInFxSync() signInFxSync()
mDevice.waitNotNull(Until.findObjects(By.text("Settings")), TestAssetHelper.waitingTime) mDevice.waitNotNull(Until.findObjects(By.text("Account")), TestAssetHelper.waitingTime)
goToAccountSettings() goToAccountSettings()
// This function to be added to the robot once the status of checkboxes can be checked // This function to be added to the robot once the status of checkboxes can be checked
@ -207,8 +209,7 @@ class SyncIntegrationTest {
} }
fun historyAfterSyncIsShown() { fun historyAfterSyncIsShown() {
val historyEntry = mDevice.findObject(By.text("http://www.example.com/")) mDevice.waitNotNull(Until.findObjects(By.text("http://www.example.com/")), TestAssetHelper.waitingTime)
historyEntry.isEnabled()
} }
fun bookmarkAfterSyncIsShown() { fun bookmarkAfterSyncIsShown() {
@ -217,7 +218,12 @@ class SyncIntegrationTest {
} }
fun tapReturnToPreviousApp() { fun tapReturnToPreviousApp() {
mDevice.waitNotNull(Until.findObjects(By.text("Save")), TestAssetHelper.waitingTime)
mDevice.waitNotNull(Until.findObjects(By.text("Settings")), TestAssetHelper.waitingTime) mDevice.waitNotNull(Until.findObjects(By.text("Settings")), TestAssetHelper.waitingTime)
// Wait until the Settings shows the account synced
mDevice.waitNotNull(Until.findObjects(By.text("Account")), TestAssetHelper.waitingTime)
// Go to Homescreen
mDevice.pressBack() mDevice.pressBack()
} }

View File

@ -93,7 +93,7 @@ def tps_profile(pytestconfig, tps_addon, tps_config, tps_log, fxa_urls):
# 'devtools.debugger.remote-enabled': True, # 'devtools.debugger.remote-enabled': True,
'engine.bookmarks.repair.enabled': False, 'engine.bookmarks.repair.enabled': False,
'extensions.autoDisableScopes': 10, 'extensions.autoDisableScopes': 10,
'extensions.legacy.enabled': True, 'extensions.experiments.enabled': True,
'extensions.update.enabled': False, 'extensions.update.enabled': False,
'extensions.update.notifyUser': False, 'extensions.update.notifyUser': False,
# While this line is commented prod is launched instead of stage # While this line is commented prod is launched instead of stage

View File

@ -1,7 +1,6 @@
import os import os
import sys import sys
def test_sync_account_settings(tps, gradlewbuild): def test_sync_account_settings(tps, gradlewbuild):
gradlewbuild.test('checkAccountSettings') gradlewbuild.test('checkAccountSettings')
@ -9,15 +8,24 @@ def test_sync_history_from_desktop(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/') os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
tps.run('test_history.js') tps.run('test_history.js')
gradlewbuild.test('checkHistoryFromDesktopTest') gradlewbuild.test('checkHistoryFromDesktopTest')
'''
def test_sync_bookmark_from_desktop(tps, gradlewbuild): def test_sync_bookmark_from_desktop(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
tps.run('test_bookmark.js') tps.run('test_bookmark.js')
gradlewbuild.test('checkBookmarkFromDesktopTest') gradlewbuild.test('checkBookmarkFromDesktopTest')
def test_sync_logins_from_device(tps, gradlewbuild): def test_sync_logins_from_desktop(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
tps.run('test_logins.js') tps.run('test_logins.js')
gradlewbuild.test('checkLoginsFromDesktopTest') gradlewbuild.test('checkLoginsFromDesktopTest')
def test_sync_bookmark_from_device(tps, gradlewbuild): def test_sync_bookmark_from_device(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
gradlewbuild.test('checkBookmarkFromDeviceTest') gradlewbuild.test('checkBookmarkFromDeviceTest')
tps.run('test_bookmark_desktop.js') tps.run('app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_bookmark_desktop.js')
def test_sync_history_from_device(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
gradlewbuild.test('checkHistoryFromDeviceTest')
tps.run('app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_history_desktop.js')
'''