diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f2b02abee..000000000 --- a/.travis.yml +++ /dev/null @@ -1,228 +0,0 @@ -sudo: required -os: osx -osx_image: xcode10.2 -language: node_js -node_js: "10" -cache: - npm: false -env: - global: - - PLATFORM_VERSION=12.2 - - SHOW_XCODE_LOG=0 - - _FORCE_LOGS=1 - - RECURSIVE=--recursive - - MAX_PARALLEL=0 - - _LOG_TIMESTAMP=1 - - DEBUG=mocha-parallel-tests - - secure: ls4nb5gcu0USHauJOkB9R5p86PMPJd/wCIQWjj/bhAfLNpSNNthtss2Ss9M7BjJg8lth8c85MrGfkAZOGgXknNtlQ2HHwKK4fbEiLAKLDS9diac6/OpAsxxE1/OvletYhkKLQSqb8d5Ju3S/xY6SmNDIzHUpeTYV2/5Ve+7Fh9zc1RztxsPwV1vxPtL6w0IAzNS9PQOmDXQ6x9KuZModtR7ohVKD47A91MzBlu3kk1CSaeQ4I8l7eXi4R9J6F81jkr51Vzoam4B6+4HTepSdfo02irBQWzaJ3VtRCbazFRBc/wfe4YgOPQTD9k69FiP19sa28lP9eSn6h5OCSXA9M803kju33Ml6OItRWDG0gUG1dzTroVXELEIcfnw1iTsFqKWoJLaEzEiXV8n2RsXLaLC5SHPgKwGEigGMfWDxM9leIC8hgervjQvApmx7btzq9S50tMcrzba5qwXDDrjJi1wKSjd4pQajhSj9VgOH9D5ihZBdn++VLwEvfAd4yQhjdsr9+COV1HrgK7Ro1HAHWgGnPtwBKiQdVU20QdQzNrhRdF2MLrJ4BfWpNm92JwlPxP/ojuA2l8mr9nDqlfBgXlnG32j59988gi85vaMfXssrUXtdJqsKJckI01c/mgaRh9pvG3UPX8K39quKBI5ftS8aCCa8tbF6bLq/ZuI2TRU= -jobs: - include: - - stage: tests - name: Unit tests - if: &noncron type != cron - env: - - TEST=unit - - _FORCE_LOGS=0 - - - stage: - name: Basic functional tests - if: *noncron - env: - - TEST=functional/basic - - - stage: - name: Device functional tests - if: *noncron - env: - - TEST=functional/device - - - stage: - name: Driver functional tests - if: *noncron - env: - - TEST=functional/driver - - - stage: - name: Web tests - if: *noncron - env: - - TEST=functional/web - - - stage: - name: Long tests - if: *noncron - env: - - TEST=functional/long - - - stage: - name: Smoke test on Xcode 10.1 web - if: *noncron - osx_image: xcode10.1 - env: - - PLATFORM_VERSION=12.1 - - TEST=functional/web - - - stage: "[CRON] Upload Appium build to Sauce Storage" - if: &cron type = cron - os: linux - env: CLOUD=1 - script: npx gulp sauce-storage-upload - - # Sauce Emusim tests - - stage: "[CRON] Sauce Emusim tests" - if: *cron - os: linux - name: Basic, device 0 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=0 TEST=functional/basic - - stage: - if: *cron - os: linux - name: Basic, device 1 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=1 TEST=functional/basic - - stage: - if: *cron - os: linux - name: Basic, device 2 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=2 TEST=functional/basic - - stage: - if: *cron - os: linux - name: Basic, device 3 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=3 TEST=functional/basic - - stage: - if: *cron - os: linux - name: Basic, device 4 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=4 TEST=functional/basic - - - stage: - if: *cron - os: linux - name: Web, device 0 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=0 TEST=functional/web - addons: &sc - sauce_connect: - no_ssl_bump_domains: localhost - - stage: - if: *cron - os: linux - name: Web, device 1 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=1 TEST=functional/web - addons: - *sc - - stage: - if: *cron - os: linux - name: Web, device 2 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=2 TEST=functional/web - addons: - *sc - - stage: - if: *cron - os: linux - name: Web, device 3 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=3 TEST=functional/web - addons: - *sc - - stage: - if: *cron - os: linux - name: Web, device 4 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=4 TEST=functional/web - addons: - *sc - - - stage: - if: *cron - os: linux - name: Long, device 0 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=0 LONG=1 TEST=functional/long - - stage: - if: *cron - os: linux - name: Long, device 1 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=1 LONG=1 TEST=functional/long - - stage: - if: *cron - os: linux - name: Long, device 2 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=2 LONG=1 TEST=functional/long - - stage: - if: *cron - os: linux - name: Long, device 3 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=3 LONG=1 TEST=functional/long - - stage: - if: *cron - os: linux - name: Long, device 4 - env: CLOUD=1 SAUCE_EMUSIM_DEVICE_INDEX=4 LONG=1 TEST=functional/long - - - # - stage: "[CRON] Sauce RDC Tests" - # if: type = cron - # os: linux - # env: CLOUD=1 SAUCE_RDC_DEVICE_INDEX=0 TEST=functional/basic - # - stage: - # if: type = cron - # os: linux - # env: CLOUD=1 SAUCE_RDC_DEVICE_INDEX=1 TEST=functional/basic - # - stage: - # if: type = cron - # os: linux - # env: CLOUD=1 SAUCE_RDC_DEVICE_INDEX=0 TEST=functional/web - # - stage: - # if: type = cron - # os: linux - # env: CLOUD=1 SAUCE_RDC_DEVICE_INDEX=1 TEST=functional/web - # - stage: - # if: type = cron - # os: linux - # env: CLOUD=1 SAUCE_RDC_DEVICE_INDEX=0 TEST=functional/long - # - stage: - # if: type = cron - # os: linux - # env: CLOUD=1 SAUCE_RDC_DEVICE_INDEX=1 TEST=functional/long - -install: - - npm --version - - node --version - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then - npm install; - npm install --no-save mjpeg-consumer; - - pushd node_modules/appium-webdriveragent; - carthage bootstrap --no-use-binaries; - cp Cartfile.resolved Carthage; - mkdir -p ./Resources/WebDriverAgent.bundle; - popd; - else - npm install --production; - npm install --no-save gulp appium-gulp-plugins chai chai-as-promised chai-subset wd unzip mocha@5 mocha-parallel-tests; - npm install --no-save saucelabs; - npx gulp fix-mocha-parallel-tests; - npm run build; - npx gulp periodic-output & export LONG_PID=$!; - fi -before_script: npm outdated || true -script: - - if [ -n "$CLOUD" ]; then - npx mocha-parallel-tests --max-parallel $MAX_PARALLEL --debug -t 120000 --require build/test/env/env --recursive build/test/$TEST; - else - npm run lint && npx mocha -t 0 $RECURSIVE build/test/$TEST -g @skip-ci -i --exit; - fi -after_script: - - if [-n "$LONG_PID" ]; then - kill $LONG_PID; - fi -after_success: - - if [ -n "$CI_METRICS" ]; then - mkdir -p ./ci-metrics && ls -la ./ci-metrics; - npm install -g appium-event-parser; - appium-event-parser -s -i ./ci-metrics; - fi -notifications: - slack: - secure: gUvI7IXsz0vHK/S0cLCh0zJQhMsKC1PnMldQUzRwEmbJ5Yce2kWUP4Gw8EZ3zNhAvVDVf2R87Fqa2D7nfa/0gDr86n0c/fnVo8z/ctHK01YKnu/GaVEDwJG0WFA439J5Bu6wkbcdc+gncBKU1UenF4IcwcIUyQhkSe65Uc67MqwV1rzLj6JYWEcbI5qAJWJnWxC1Ie2Fqg/uTV4dNzEotcn0h4VF/TgezgAPBJxMuXK8u6r242g0b5B9XqmvOZP+/OsZ610gLNfpf0Piy2m1H/S7WSd51KJe9rJY8e9zihZFNHuc0geKBEgynr2Xtq2Iy+WF6UGM4P2eyhAsumcEJWxFsgjvsVVnhZKb17tvQMpOnayBx/DGpR0l8p3LHSevzGgBhOswNBglhOp7TmfvAzRYqqtphmUqBFRGEVQHsOeaVE/x6KWnFRVl/7ZjP7XE53TuXKqR/TdZzP4xg7u7e7XOvy3ehcqE4NIwL7VAm6vIgF0/2iHIXGf6OXTjBXOMFtEVzNO4rJ2MtnIXLk7ZXRwQgNrjoQKppIawSPdodGsb8NrkY95OJt8e3YzlXpneU93MBzS76SLaQ2TKf1dVXt9ibf/VZt/FTh3UgOQ6eTzkNCAEbUtI+ZA1KoST7tKW3ffQxtphPSkF+pErM37gOAwwmcSnF7WfTc0/1Dsk6i4= - on_success: always - on_pull_requests: false diff --git a/ci-jobs/pr-validation-build.yml b/ci-jobs/pr-validation-build.yml index 587f660b7..9e55c7123 100644 --- a/ci-jobs/pr-validation-build.yml +++ b/ci-jobs/pr-validation-build.yml @@ -3,7 +3,12 @@ variables: - name: SHOW_XCODE_LOG value: true -jobs: +stages: +- stage: Unit_Tests + jobs: + - template: ./templates/node-build-template.yml +- stage: Integration_Tests + jobs: - template: ./templates/xcuitest-e2e-template.yml parameters: name: iPhoneX_13_7 diff --git a/test/functional/web/safari-ssl-e2e-specs.js b/test/functional/web/safari-ssl-e2e-specs.js index 0dc269709..921c18929 100644 --- a/test/functional/web/safari-ssl-e2e-specs.js +++ b/test/functional/web/safari-ssl-e2e-specs.js @@ -57,21 +57,22 @@ if (!process.env.REAL_DEVICE && !process.env.CLOUD) { }); it('should open pages with untrusted certs if the cert was provided in desired capabilities', async function () { - driver = await initSession(caps); - await driver.get(LOCAL_HTTPS_URL); - await driver.source().should.eventually.include('Arbitrary text'); - await driver.quit(); - await B.delay(1000); - - // Now do another session using the same cert to verify that it still works - // (Don't do it on CLOUD. Restarting is too slow) - if (!process.env.CLOUD) { - await driver.init(caps); - await driver.get(LOCAL_HTTPS_URL); + try { + driver = await initSession(caps); await driver.source().should.eventually.include('Arbitrary text'); + await driver.quit(); + await B.delay(1000); + + // Now do another session using the same cert to verify that it still works + // (Don't do it on CLOUD. Restarting is too slow) + if (!process.env.CLOUD) { + await driver.init(caps); + await driver.get(LOCAL_HTTPS_URL); + await driver.source().should.eventually.include('Arbitrary text'); + } + } finally { + await deleteSession(); } - - await deleteSession(); }); describe('cookies', function () { diff --git a/test/unit/language-specs.js b/test/unit/language-specs.js index 0017f2721..69b10b72b 100644 --- a/test/unit/language-specs.js +++ b/test/unit/language-specs.js @@ -8,26 +8,31 @@ describe('language and locale', function () { const LANGUAGE = 'en'; const LOCALE = 'en_US'; const BUNDLE_ID = 'com.test.app'; + const DEFAULT_CAPS = { + elementResponseFields: undefined, + shouldUseCompactResponses: undefined, + waitForIdleTimeout: undefined, + shouldWaitForQuiescence: true, + shouldUseTestManagerForVisibilityDetection: false, + maxTypingFrequency: 60, + shouldUseSingletonTestManager: true, + eventloopIdleDelaySec: 0, + environment: {}, + }; describe('send only language and locale', function () { it('should send translated POST /session request with valid desired caps to WDA', async function () { const expectedWDACapabilities = { capabilities: { - firstMatch: [{ + firstMatch: [Object.assign({}, DEFAULT_CAPS, { bundleId: BUNDLE_ID, arguments: [ '-AppleLanguages', `(${LANGUAGE})`, '-NSLanguages', `(${LANGUAGE})`, '-AppleLocale', LOCALE ], - environment: {}, - shouldWaitForQuiescence: true, - shouldUseTestManagerForVisibilityDetection: true, - maxTypingFrequency: 60, - shouldUseSingletonTestManager: true, - eventloopIdleDelaySec: 0, - }], + })], alwaysMatch: {}, } }; @@ -71,16 +76,11 @@ describe('language and locale', function () { const expectedWDACapabilities = { capabilities: { - firstMatch: [{ + firstMatch: [Object.assign({}, DEFAULT_CAPS, { bundleId: BUNDLE_ID, arguments: augmentedProcessArgumentsWithLanguage.args, environment: processArguments.env, - shouldWaitForQuiescence: true, - shouldUseTestManagerForVisibilityDetection: true, - maxTypingFrequency: 60, - shouldUseSingletonTestManager: true, - eventloopIdleDelaySec: 0, - }], + })], alwaysMatch: {}, } }; diff --git a/test/unit/processargs-specs.js b/test/unit/processargs-specs.js index e3606959a..7ca2a0243 100644 --- a/test/unit/processargs-specs.js +++ b/test/unit/processargs-specs.js @@ -9,6 +9,16 @@ describe('process args', function () { let driver = new XCUITestDriver(); driver.opts.platformVersion = '10.3'; let proxySpy = sinon.stub(driver, 'proxyCommand'); + const DEFAULT_CAPS = { + elementResponseFields: undefined, + shouldUseCompactResponses: undefined, + waitForIdleTimeout: undefined, + shouldWaitForQuiescence: true, + shouldUseTestManagerForVisibilityDetection: false, + maxTypingFrequency: 60, + shouldUseSingletonTestManager: true, + eventloopIdleDelaySec: 0, + }; const PROCESS_ARGS_OBJECT = { args: ['a', 'b', 'c'], @@ -19,16 +29,11 @@ describe('process args', function () { let desired = { capabilities: { - firstMatch: [{ + firstMatch: [Object.assign({}, DEFAULT_CAPS, { bundleId: BUNDLE_ID, arguments: PROCESS_ARGS_OBJECT.args, environment: PROCESS_ARGS_OBJECT.env, - shouldWaitForQuiescence: true, - shouldUseTestManagerForVisibilityDetection: false, - maxTypingFrequency: 60, - shouldUseSingletonTestManager: true, - eventloopIdleDelaySec: 0, - }], + })], alwaysMatch: {}, } };