Skip to content

Commit

Permalink
fix: Update unit tests and remove Travis config (#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Oct 25, 2020
1 parent ca6e36f commit 421381f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 264 deletions.
228 changes: 0 additions & 228 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion ci-jobs/pr-validation-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 14 additions & 13 deletions test/functional/web/safari-ssl-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
30 changes: 15 additions & 15 deletions test/unit/language-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
}
};
Expand Down Expand Up @@ -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: {},
}
};
Expand Down
19 changes: 12 additions & 7 deletions test/unit/processargs-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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: {},
}
};
Expand Down

0 comments on commit 421381f

Please sign in to comment.