Skip to content

Commit 69bafe2

Browse files
committed
feat(journeys): add single integration suite to run all tests
1 parent 2205ac7 commit 69bafe2

File tree

7 files changed

+87
-4
lines changed

7 files changed

+87
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test:automation:space": "wdio wdio.conf.js --suite space",
2121
"test:automation:recents": "wdio wdio.conf.js --suite recents",
2222
"test:tap": "cross-env TAP=true wdio wdio.conf.js --suite tap",
23-
"test:integration": "wdio wdio.conf.js --suite recents ; sleepms 60000 ; wdio wdio.conf.js --suite multiple ; sleepms 60000 ; wdio wdio.conf.js --suite oneOnOne ; sleepms 60000 ; wdio wdio.conf.js --suite space",
23+
"test:integration": "cross-env INTEGRATION=true wdio wdio.conf.js --suite integration",
2424
"jest": "cross-env TZ=utc jest --config=jest.config.json",
2525
"static-analysis": "npm run eslint",
2626
"lint:eslint": "eslint --ignore-path .gitignore $(npm run --silent lint:eslint:ci-reporter)",
@@ -167,6 +167,7 @@
167167
"react-transform-hmr": "^1.0.4",
168168
"redux-mock-store": "^1.2.1",
169169
"rimraf": "^2.5.4",
170+
"saucelabs": "^1.4.0",
170171
"semver": "^5.4.1",
171172
"sleep-ms": "^2.0.1",
172173
"sri-toolbox": "^0.2.0",

scripts/tests/openh264.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function encode(fp) {
3838
* @returns {string}
3939
*/
4040
function platformToShortName(platform) {
41-
if (platform.toLowerCase().includes('os x') || platform === 'darwin') {
41+
if (platform.toLowerCase().includes('os x') || platform === 'darwin' || platform.includes('mac')) {
4242
return 'mac';
4343
}
4444

test/journeys/specs/multiple/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import '@ciscospark/internal-plugin-feature';
55
import '@ciscospark/internal-plugin-conversation';
66
import CiscoSpark from '@ciscospark/spark-core';
77
import testUsers from '@ciscospark/test-helper-test-users';
8+
import SauceLabs from 'saucelabs';
89

910
import waitForPromise from '../../lib/wait-for-promise';
1011
import {moveMouse} from '../../lib/test-helpers';
@@ -20,11 +21,27 @@ import {
2021
describe('Multiple widgets on a page', () => {
2122
const browserLocal = browser.select('browserLocal');
2223
const browserRemote = browser.select('browserRemote');
24+
const browserName = process.env.BROWSER || 'chrome';
25+
const platform = process.env.PLATFORM || 'mac 10.12';
2326

2427
let docbrown, lorraine, marty;
2528
let conversation, oneOnOneConversation;
2629
let local, remote;
2730

31+
before('update sauce job', () => {
32+
if (process.env.SAUCE && process.env.INTEGRATION) {
33+
const account = new SauceLabs({
34+
username: process.env.SAUCE_USERNAME,
35+
password: process.env.SAUCE_ACCESS_KEY
36+
});
37+
account.getJobs((err, jobs) => {
38+
const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'
39+
&& job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));
40+
widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-multiple'}));
41+
});
42+
}
43+
});
44+
2845
before('load browser', () => {
2946
browser
3047
.url('/multiple.html')

test/journeys/specs/oneOnOne/dataApi/basic.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import '@ciscospark/internal-plugin-feature';
44
import '@ciscospark/plugin-logger';
55
import CiscoSpark from '@ciscospark/spark-core';
66
import testUsers from '@ciscospark/test-helper-test-users';
7+
import SauceLabs from 'saucelabs';
78

89
import {
910
elements as rosterElements,
@@ -15,11 +16,29 @@ import {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-
1516
describe('Widget Space: One on One', () => {
1617
describe('Data API', () => {
1718
const browserLocal = browser.select('browserLocal');
19+
const browserName = process.env.BROWSER || 'chrome';
20+
const platform = process.env.PLATFORM || 'mac 10.12';
1821

1922
let mccoy, spock;
2023
const mccoyName = 'Bones Mccoy';
2124
const spockName = 'Mr Spock';
2225

26+
before('update sauce job', () => {
27+
if (process.env.SAUCE && process.env.INTEGRATION) {
28+
browser.reload();
29+
const account = new SauceLabs({
30+
username: process.env.SAUCE_USERNAME,
31+
password: process.env.SAUCE_ACCESS_KEY
32+
});
33+
account.getJobs((err, jobs) => {
34+
const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'
35+
&& job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));
36+
widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-oneOnOne'}));
37+
});
38+
}
39+
});
40+
41+
2342
before('load browsers', () => {
2443
browser
2544
.url('/data-api/space.html')

test/journeys/specs/recents/dataApi/basic.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import '@ciscospark/plugin-logger';
55
import '@ciscospark/internal-plugin-conversation';
66
import '@ciscospark/internal-plugin-feature';
77
import CiscoSpark from '@ciscospark/spark-core';
8+
import SauceLabs from 'saucelabs';
89

910
import {moveMouse} from '../../../lib/test-helpers';
1011
import {FEATURE_FLAG_GROUP_CALLING} from '../../../lib/test-helpers/space-widget/meet';
@@ -18,9 +19,27 @@ import {
1819
describe('Widget Recents', () => {
1920
describe('Data API', () => {
2021
const browserLocal = browser.select('browserLocal');
22+
const browserName = process.env.BROWSER || 'chrome';
23+
const platform = process.env.PLATFORM || 'mac 10.12';
24+
2125
let docbrown, lorraine, marty;
2226
let conversation, oneOnOneConversation;
2327

28+
before('update sauce job', () => {
29+
if (process.env.SAUCE && process.env.INTEGRATION) {
30+
browser.reload();
31+
const account = new SauceLabs({
32+
username: process.env.SAUCE_USERNAME,
33+
password: process.env.SAUCE_ACCESS_KEY
34+
});
35+
account.getJobs((err, jobs) => {
36+
const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'
37+
&& job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));
38+
widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-recents'}));
39+
});
40+
}
41+
});
42+
2443
before('load browser', () => {
2544
browserLocal
2645
.url('/data-api/recents.html')

test/journeys/specs/space/dataApi/basic.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import testUsers from '@ciscospark/test-helper-test-users';
44
import '@ciscospark/plugin-logger';
55
import CiscoSpark from '@ciscospark/spark-core';
66
import '@ciscospark/internal-plugin-conversation';
7+
import SauceLabs from 'saucelabs';
78

89
import {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';
910
import {
@@ -17,9 +18,26 @@ import {
1718
describe('Widget Space', () => {
1819
describe('Data API', () => {
1920
const browserLocal = browser.select('browserLocal');
21+
const browserName = process.env.BROWSER || 'chrome';
22+
const platform = process.env.PLATFORM || 'mac 10.12';
2023
let biff, docbrown, lorraine, marty;
2124
let conversation;
2225

26+
before('update sauce job', () => {
27+
if (process.env.SAUCE && process.env.INTEGRATION) {
28+
browser.reload();
29+
const account = new SauceLabs({
30+
username: process.env.SAUCE_USERNAME,
31+
password: process.env.SAUCE_ACCESS_KEY
32+
});
33+
account.getJobs((err, jobs) => {
34+
const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'
35+
&& job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));
36+
widgetJobs.forEach((job) => account.updateJob(job.id, {name: 'react-widget-space'}));
37+
});
38+
}
39+
});
40+
2341
before('load browsers', () => {
2442
browser
2543
.url('/data-api/space.html')

wdio.conf.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ const beforeSuite = require('./scripts/tests/beforeSuite');
1313

1414

1515
const browser = process.env.BROWSER || 'chrome';
16-
const platform = process.env.PLATFORM || 'OS X 10.12';
16+
const platform = process.env.PLATFORM || 'mac 10.12';
1717
const tunnelId = uuid.v4();
1818
const port = process.env.PORT || 4567;
19-
const {suite} = argv || 'all';
19+
const {suite} = argv || 'integration';
2020

2121
const chromeCapabilities = {
2222
browserName: 'chrome',
@@ -92,6 +92,15 @@ exports.config = {
9292
],
9393
multiple: [
9494
'./test/journeys/specs/multiple/**/*.js'
95+
],
96+
integration: [
97+
'./test/journeys/specs/multiple/**/*.js',
98+
'./test/journeys/specs/oneOnOne/dataApi/*.js',
99+
'./test/journeys/specs/oneOnOne/global/*.js',
100+
'./test/journeys/specs/recents/dataApi/*.js',
101+
'./test/journeys/specs/recents/global/*.js',
102+
'./test/journeys/specs/space/dataApi/*.js',
103+
'./test/journeys/specs/space/global/*.js'
95104
]
96105
},
97106
// Patterns to exclude.

0 commit comments

Comments
 (0)