Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
sync-integration-tests-fix-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelrios committed Mar 3, 2020
1 parent e6e2dd9 commit 5427fd0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os
import time
import os.path as path

from mozdownload import DirectScraper, FactoryScraper
from mozprofile import Profile
Expand Down Expand Up @@ -58,12 +59,22 @@ def tps_addon(pytestconfig, tmpdir_factory):
def tps_config(fxa_account, monkeypatch):
monkeypatch.setenv('FXA_EMAIL', fxa_account.email)
monkeypatch.setenv('FXA_PASSWORD', fxa_account.password)
with open ("/Users/synctesting/.jenkins/workspace/fenix/app/src/androidTest/resources/email.txt", "w") as f:

os.chdir('../../../../..')
resources = r'resources'
resourcesDir = os.path.join(os.getcwd(), resources)

with open (os.path.join(resourcesDir, 'email.txt'), "w") as f:
f.write(fxa_account.email)

with open ("/Users/synctesting/.jenkins/workspace/fenix/app/src/androidTest/resources/password.txt", "w") as f:
with open (os.path.join(resourcesDir, 'password.txt'), "w") as f:
f.write(fxa_account.password)

os.chdir('../')
currentDir = os.getcwd()
scriptDir = currentDir + "/androidTest/java/org/mozilla/fenix/syncintegration"
os.chdir(scriptDir)

yield {'fx_account': {
'username': fxa_account.email,
'password': fxa_account.password}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@ def __init__(self, log):

def test(self, identifier):
self.adbrun.launch()

# Change path accordingly to go to root folder to run gradlew
os.chdir('../../../../../../../..')
args = './gradlew ' + 'app:connectedGeckoNightlyDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=org.mozilla.fenix.syncintegration.SyncIntegrationTest#{}'.format(identifier)

self.logger.info('Running: {}'.format(' '.join(args)))

try:
out = subprocess.check_output(
args, shell=True)
except subprocess.CalledProcessError as e:
out = e.output
raise
finally:
#Set the path correctly
testsPath = "app/src/androidTest/java/org/mozilla/fenix/syncintegration/"
os.chdir(testsPath)

with open(self.log, 'w') as f:
f.writelines(out)

Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import os
import sys


def test_sync_account_settings(tps, gradlewbuild):
gradlewbuild.test('checkAccountSettings')

def test_sync_history_from_desktop(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
tps.run('test_history.js')
gradlewbuild.test('checkHistoryFromDesktopTest')
'''
def test_sync_bookmark_from_desktop(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
tps.run('test_bookmark.js')
gradlewbuild.test('checkBookmarkFromDesktopTest')
def test_sync_logins_from_desktop(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
tps.run('test_logins.js')
gradlewbuild.test('checkLoginsFromDesktopTest')
def test_sync_bookmark_from_device(tps, gradlewbuild):
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/')
gradlewbuild.test('checkBookmarkFromDeviceTest')
tps.run('app/src/androidTest/java/org/mozilla/fenix/syncintegration/test_bookmark_desktop.js')
tps.run('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')
tps.run('test_history_desktop.js')
'''

0 comments on commit 5427fd0

Please sign in to comment.