selenium-side-runner 3.17.0 → 4.0.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +29 -10
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bin.d.ts.map +1 -0
  4. package/dist/bin.js +160 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/capabilities.d.ts +7 -0
  7. package/dist/capabilities.d.ts.map +1 -0
  8. package/dist/capabilities.js +49 -66
  9. package/dist/capabilities.js.map +1 -0
  10. package/dist/config.d.ts +6 -0
  11. package/dist/config.d.ts.map +1 -0
  12. package/dist/config.js +12 -18
  13. package/dist/config.js.map +1 -0
  14. package/dist/main.test.d.ts +2 -0
  15. package/dist/main.test.d.ts.map +1 -0
  16. package/dist/main.test.js +113 -0
  17. package/dist/main.test.js.map +1 -0
  18. package/dist/proxy.d.ts +3 -0
  19. package/dist/proxy.d.ts.map +1 -0
  20. package/dist/proxy.js +67 -64
  21. package/dist/proxy.js.map +1 -0
  22. package/dist/register.d.ts +16 -0
  23. package/dist/register.d.ts.map +1 -0
  24. package/dist/register.js +66 -0
  25. package/dist/register.js.map +1 -0
  26. package/dist/run.d.ts +14 -0
  27. package/dist/run.d.ts.map +1 -0
  28. package/dist/run.js +169 -0
  29. package/dist/run.js.map +1 -0
  30. package/dist/types.d.ts +44 -0
  31. package/dist/types.d.ts.map +1 -0
  32. package/dist/types.js +3 -0
  33. package/dist/types.js.map +1 -0
  34. package/dist/versioner.d.ts +2 -0
  35. package/dist/versioner.d.ts.map +1 -0
  36. package/dist/versioner.js +23 -22
  37. package/dist/versioner.js.map +1 -0
  38. package/jest.config.js +13 -0
  39. package/package.json +30 -25
  40. package/src/__tests__/capabilities.spec.ts +137 -0
  41. package/{dist/npm.js → src/__tests__/config.spec.ts} +8 -24
  42. package/src/__tests__/config_1.yml +4 -0
  43. package/src/__tests__/config_2.yml +3 -0
  44. package/src/__tests__/proxy.spec.ts +138 -0
  45. package/src/__tests__/versioner.spec.ts +44 -0
  46. package/src/bin.ts +202 -0
  47. package/src/capabilities.ts +87 -0
  48. package/{dist/util.js → src/config.ts} +11 -10
  49. package/src/main.test.ts +129 -0
  50. package/src/proxy.ts +89 -0
  51. package/src/register.ts +79 -0
  52. package/src/run.ts +185 -0
  53. package/src/types.ts +82 -0
  54. package/src/versioner.ts +36 -0
  55. package/tsconfig.json +19 -0
  56. package/tsconfig.tsbuildinfo +1 -0
  57. package/.babelrc +0 -12
  58. package/dist/child.js +0 -7
  59. package/dist/index.js +0 -391
  60. package/dist/module-path.js +0 -41
@@ -0,0 +1,3 @@
1
+ import { ProxyCapabilities, ProxyInputOptions, ProxyType } from './types';
2
+ export default function ParseProxy(type: ProxyType, options?: ProxyInputOptions): ProxyCapabilities;
3
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEzE,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,IAAI,EAAE,SAAS,EACf,OAAO,CAAC,EAAE,iBAAiB,GAC1B,iBAAiB,CAkEnB"}
package/dist/proxy.js CHANGED
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = ParseProxy;
7
-
8
2
  // Licensed to the Software Freedom Conservancy (SFC) under one
9
3
  // or more contributor license agreements. See the NOTICE file
10
4
  // distributed with this work for additional information
@@ -21,67 +15,76 @@ exports.default = ParseProxy;
21
15
  // KIND, either express or implied. See the License for the
22
16
  // specific language governing permissions and limitations
23
17
  // under the License.
18
+ Object.defineProperty(exports, "__esModule", { value: true });
24
19
  function ParseProxy(type, options) {
25
- if (type === 'direct' || type === 'system') {
26
- return {
27
- proxyType: type
28
- };
29
- } else if (type === 'pac') {
30
- if (!options) {
31
- throw new Error('A proxy autoconfig URL was not passed (e.g. --proxy-options="http://localhost/pac")');
32
- }
33
-
34
- return {
35
- proxyType: type,
36
- proxyOptions: options
37
- };
38
- } else if (type === 'manual') {
39
- if (!options) {
40
- return {
41
- proxyType: type,
42
- proxyOptions: {}
43
- };
44
- } else if (typeof options !== 'object') {
45
- throw new Error('Proxy options were not passed to manual proxy (e.g. --proxy-options="http=localhost:321 ftp=localhost:4324")');
46
- } else {
47
- let opts = {};
48
- if (options.http) opts.http = options.http;
49
- if (options.https) opts.https = options.https;
50
- if (options.ftp) opts.ftp = options.ftp;
51
- if (options.bypass) opts.bypass = options.bypass;
52
- return {
53
- proxyType: type,
54
- proxyOptions: opts
55
- };
56
- }
57
- } else if (type === 'socks') {
58
- if (!options || !options.socksProxy) {
59
- throw new Error('Proxy options were not passed to socks proxy (e.g. --proxy-options="socksProxy=localhost:321")');
60
- } else {
61
- if (options.socksVersion) {
62
- const ver = parseInt(options.socksVersion);
63
-
64
- if (ver) {
65
- return {
20
+ if (type === 'direct' || type === 'system') {
21
+ return {
66
22
  proxyType: type,
67
- proxyOptions: {
68
- socksProxy: options.socksProxy,
69
- socksVersion: ver
70
- }
71
- };
72
- } else {
73
- throw new Error('Proxy socks version is invalid (e.g. --proxy-options="socksProxy=localhost:321 socksVersion=5")');
23
+ };
24
+ }
25
+ else if (type === 'pac') {
26
+ if (!options || typeof options !== 'string') {
27
+ throw new Error('A proxy autoconfig URL was not passed (e.g. --proxy-options="http://localhost/pac")');
74
28
  }
75
- } else {
76
29
  return {
77
- proxyType: type,
78
- proxyOptions: {
79
- socksProxy: options.socksProxy
80
- }
30
+ proxyType: type,
31
+ proxyAutoconfigUrl: options,
81
32
  };
82
- }
83
33
  }
84
- } else {
85
- throw new Error('An unknown proxy type was passed, use one of: direct, system, manual, socks or pac (e.g. --proxy-type="direct")');
86
- }
87
- }
34
+ else if (type === 'manual') {
35
+ if (!options) {
36
+ return {
37
+ proxyType: type,
38
+ };
39
+ }
40
+ else if (typeof options !== 'object') {
41
+ throw new Error('Proxy options were not passed to manual proxy (e.g. --proxy-options="http=localhost:321 ftp=localhost:4324")');
42
+ }
43
+ else {
44
+ let opts = {};
45
+ if (options.http)
46
+ opts.httpProxy = options.http;
47
+ if (options.https)
48
+ opts.sslProxy = options.https;
49
+ if (options.ftp)
50
+ opts.ftpProxy = options.ftp;
51
+ if (options.bypass)
52
+ opts.noProxy = options.bypass;
53
+ return {
54
+ proxyType: type,
55
+ ...opts,
56
+ };
57
+ }
58
+ }
59
+ else if (type === 'socks') {
60
+ if (!options || typeof options === 'string' || !options.socksProxy) {
61
+ throw new Error('Proxy options were not passed to socks proxy (e.g. --proxy-options="socksProxy=localhost:321")');
62
+ }
63
+ else {
64
+ if (options.socksVersion) {
65
+ const ver = parseInt(options.socksVersion);
66
+ if (ver) {
67
+ return {
68
+ proxyType: 'manual',
69
+ socksProxy: options.socksProxy,
70
+ socksVersion: ver,
71
+ };
72
+ }
73
+ else {
74
+ throw new Error('Proxy socks version is invalid (e.g. --proxy-options="socksProxy=localhost:321 socksVersion=5")');
75
+ }
76
+ }
77
+ else {
78
+ return {
79
+ proxyType: 'manual',
80
+ socksProxy: options.socksProxy,
81
+ };
82
+ }
83
+ }
84
+ }
85
+ else {
86
+ throw new Error('An unknown proxy type was passed, use one of: direct, system, manual, socks or pac (e.g. --proxy-type="direct")');
87
+ }
88
+ }
89
+ exports.default = ParseProxy;
90
+ //# sourceMappingURL=proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;A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AE;YAClE,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAA;SACF;aAAM;YACL,IAAI,OAAO,CAAC,YAAY,EAAE;gBACxB,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAsB,CAAC,CAAA;gBACpD,IAAI,GAAG,EAAE;oBACP,OAAO;wBACL,SAAS,EAAE,QAAQ;wBACnB,UAAU,EAAE,OAAO,CAAC,UAAoB;wBACxC,YAAY,EAAE,GAAG;qBAClB,CAAA;iBACF;qBAAM;oBACL,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAA;iBACF;aACF;iBAAM;gBACL,OAAO;oBACL,SAAS,EAAE,QAAQ;oBACnB,UAAU,EAAE,OAAO,CAAC,UAAoB;iBACzC,CAAA;aACF;SACF;KACF;SAAM;QACL,MAAM,IAAI,KAAK,CACb,iHAAiH,CAClH,CAAA;KACF;AACH,CAAC;AArED,6BAqEC"}
@@ -0,0 +1,16 @@
1
+ import { ProjectShape, SuiteShape, TestShape } from '@seleniumhq/side-model';
2
+ import { Configuration, Project } from './types';
3
+ export interface HoistedThings {
4
+ configuration: Configuration;
5
+ logger: Console;
6
+ }
7
+ export declare type SuiteArgs = [SuiteShape, TestShape[]];
8
+ export declare type ProjectArgs = [ProjectShape, SuiteArgs[]];
9
+ declare const buildRunners: ({ configuration, logger }: HoistedThings) => {
10
+ all: (projectConfigs: Project[]) => ProjectArgs[];
11
+ project: (project: Project) => ProjectArgs;
12
+ suite: (project: Project, suite: SuiteShape) => SuiteArgs;
13
+ test: (project: Project, testID: string) => TestShape;
14
+ };
15
+ export default buildRunners;
16
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE5E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,oBAAY,SAAS,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC,CAAA;AACjD,oBAAY,WAAW,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,CAAC,CAAA;AACrD,QAAA,MAAM,YAAY,8BAA+B,aAAa;0BAkCvB,OAAO,EAAE,KAAG,WAAW,EAAE;uBAtB5B,OAAO;qBART,OAAO,SAAS,UAAU;oBAH3B,OAAO,UAAU,MAAM;CA+CvD,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ // Licensed to the Software Freedom Conservancy (SFC) under one
3
+ // or more contributor license agreements. See the NOTICE file
4
+ // distributed with this work for additional information
5
+ // regarding copyright ownership. The SFC licenses this file
6
+ // to you under the Apache License, Version 2.0 (the
7
+ // "License"); you may not use this file except in compliance
8
+ // with the License. You may obtain a copy of the License at
9
+ //
10
+ // http://www.apache.org/licenses/LICENSE-2.0
11
+ //
12
+ // Unless required by applicable law or agreed to in writing,
13
+ // software distributed under the License is distributed on an
14
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ // KIND, either express or implied. See the License for the
16
+ // specific language governing permissions and limitations
17
+ // under the License.
18
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const versioner_1 = __importDefault(require("./versioner"));
23
+ const buildRunners = ({ configuration, logger }) => {
24
+ const registerTest = (project, testID) => project.tests.find((t) => t.id === testID);
25
+ const registerSuite = (project, suite) => {
26
+ let tests = [];
27
+ for (let i = 0, ii = suite.tests.length; i != ii; i++) {
28
+ tests.push(registerTest(project, suite.tests[i]));
29
+ }
30
+ return [suite, tests];
31
+ };
32
+ const registerProject = (project) => {
33
+ if (!configuration.force) {
34
+ let warning = (0, versioner_1.default)(project.version, '2.0');
35
+ if (warning) {
36
+ logger.warn(warning);
37
+ }
38
+ }
39
+ else {
40
+ logger.warn("--force is set, ignoring project's version");
41
+ }
42
+ if (!project.suites.length) {
43
+ throw new Error(`The project ${project.name} has no test suites defined, create a suite using the IDE.`);
44
+ }
45
+ const suites = [];
46
+ for (let i = 0, ii = project.suites.length; i != ii; i++) {
47
+ suites.push(registerSuite(project, project.suites[i]));
48
+ }
49
+ return [project, suites];
50
+ };
51
+ const registerAll = (projectConfigs) => {
52
+ const projects = [];
53
+ for (let i = 0, ii = projectConfigs.length; i != ii; i++) {
54
+ projects.push(registerProject(projectConfigs[i]));
55
+ }
56
+ return projects;
57
+ };
58
+ return {
59
+ all: registerAll,
60
+ project: registerProject,
61
+ suite: registerSuite,
62
+ test: registerTest,
63
+ };
64
+ };
65
+ exports.default = buildRunners;
66
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;;;;;AAGrB,4DAAmC;AAUnC,MAAM,YAAY,GAAG,CAAC,EAAE,aAAa,EAAE,MAAM,EAAiB,EAAE,EAAE;IAChE,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,MAAc,EAAE,EAAE,CACxD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAc,CAAA;IAEzD,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAE,KAAi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QAAQ,GAAkB,EAAE,CAAA;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;YACxD,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SAClD;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;IAED,OAAO;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,YAAY;KACnB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,YAAY,CAAA"}
package/dist/run.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { SuiteShape, TestShape } from '@seleniumhq/side-model';
2
+ import { Configuration, Project } from './types';
3
+ export interface HoistedThings {
4
+ configuration: Configuration;
5
+ logger: Console;
6
+ }
7
+ declare const buildRunners: ({ configuration, logger }: HoistedThings) => {
8
+ all: (projects: Project[]) => Promise<void>;
9
+ project: (project: Project) => Promise<void>;
10
+ suite: (project: Project, suite: SuiteShape) => Promise<void>;
11
+ test: (project: Project, test: TestShape) => Promise<void>;
12
+ };
13
+ export default buildRunners;
14
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,QAAA,MAAM,YAAY,8BAA+B,aAAa;oBAqI5B,OAAO,EAAE;uBAtBN,OAAO;qBAhBT,OAAO,SAAS,UAAU;oBA9F3B,OAAO,QAAQ,SAAS;CAgJzD,CAAA;AAED,eAAe,YAAY,CAAA"}
package/dist/run.js ADDED
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ // Licensed to the Software Freedom Conservancy (SFC) under one
3
+ // or more contributor license agreements. See the NOTICE file
4
+ // distributed with this work for additional information
5
+ // regarding copyright ownership. The SFC licenses this file
6
+ // to you under the Apache License, Version 2.0 (the
7
+ // "License"); you may not use this file except in compliance
8
+ // with the License. You may obtain a copy of the License at
9
+ //
10
+ // http://www.apache.org/licenses/LICENSE-2.0
11
+ //
12
+ // Unless required by applicable law or agreed to in writing,
13
+ // software distributed under the License is distributed on an
14
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ // KIND, either express or implied. See the License for the
16
+ // specific language governing permissions and limitations
17
+ // under the License.
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
30
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
31
+ }) : function(o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar = (this && this.__importStar) || function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const side_runtime_1 = require("@seleniumhq/side-runtime");
46
+ const path = __importStar(require("path"));
47
+ const versioner_1 = __importDefault(require("./versioner"));
48
+ const buildRunners = ({ configuration, logger }) => {
49
+ const runTest = async (project, test) => {
50
+ logger.info(`Running test ${test.name}`);
51
+ const shortenedProjectPath = project.path
52
+ .split(path.sep)
53
+ .slice(0, -1)
54
+ .join(path.sep);
55
+ const plugins = await (0, side_runtime_1.loadPlugins)(shortenedProjectPath, project.plugins);
56
+ const customCommands = (0, side_runtime_1.getCustomCommands)(plugins);
57
+ const driver = new side_runtime_1.WebDriverExecutor({
58
+ capabilities: configuration.capabilities,
59
+ customCommands,
60
+ hooks: {
61
+ onBeforePlay: async () => {
62
+ await Promise.all(plugins.map((plugin) => {
63
+ const onBeforePlay = plugin.hooks.onBeforePlay;
64
+ if (onBeforePlay) {
65
+ return onBeforePlay({ driver });
66
+ }
67
+ }));
68
+ },
69
+ },
70
+ server: configuration.server,
71
+ });
72
+ await playbackUntilComplete();
73
+ function playbackUntilComplete() {
74
+ // eslint-disable-next-line no-async-promise-executor
75
+ return new Promise(async (resolve, reject) => {
76
+ const playback = new side_runtime_1.Playback({
77
+ baseUrl: project.url,
78
+ executor: driver,
79
+ getTestByName: (name) => project.tests.find((t) => t.name === name),
80
+ logger,
81
+ variables: new side_runtime_1.Variables(),
82
+ });
83
+ const onComplete = (failure) => {
84
+ playback.cleanup();
85
+ if (failure) {
86
+ logger.warn('Completed with failure', failure);
87
+ return reject(failure);
88
+ }
89
+ else {
90
+ return resolve(null);
91
+ }
92
+ };
93
+ const EE = playback['event-emitter'];
94
+ EE.addListener(side_runtime_1.PlaybackEvents.PLAYBACK_STATE_CHANGED, ({ state }) => {
95
+ logger.debug(`Playing state changed ${state}`);
96
+ switch (state) {
97
+ case 'aborted':
98
+ case 'errored':
99
+ case 'failed':
100
+ case 'finished':
101
+ case 'paused':
102
+ case 'stopped':
103
+ logger.info(`Finished test ${test.name} ${state === 'finished' ? 'Success' : 'Failure'}`);
104
+ onComplete(state !== 'finished');
105
+ }
106
+ });
107
+ EE.addListener(side_runtime_1.PlaybackEvents.COMMAND_STATE_CHANGED, ({ command, state, }) => {
108
+ const cmd = command;
109
+ const niceString = [cmd.command, cmd.target, cmd.value]
110
+ .filter((v) => !!v)
111
+ .join('|');
112
+ logger.debug(`${state} ${niceString}`);
113
+ });
114
+ try {
115
+ await playback.play(test, {
116
+ startingCommandIndex: 0,
117
+ });
118
+ }
119
+ catch (e) {
120
+ console.error(e);
121
+ playback.cleanup();
122
+ return reject(e);
123
+ }
124
+ });
125
+ }
126
+ };
127
+ const runSuite = async (project, suite) => {
128
+ logger.info(`Running suite ${suite.name}`);
129
+ if (!suite.tests.length) {
130
+ throw new Error(`The suite ${suite.name} has no tests, add tests to the suite using the IDE.`);
131
+ }
132
+ for (let i = 0, ii = suite.tests.length; i != ii; i++) {
133
+ await runTest(project, project.tests.find((t) => t.id === suite.tests[i]));
134
+ }
135
+ logger.info(`Finished suite ${suite.name}`);
136
+ };
137
+ const runProject = async (project) => {
138
+ logger.info(`Running project ${project.name}`);
139
+ if (!configuration.force) {
140
+ let warning = (0, versioner_1.default)(project.version, '2.0');
141
+ if (warning) {
142
+ logger.warn(warning);
143
+ }
144
+ }
145
+ else {
146
+ logger.warn("--force is set, ignoring project's version");
147
+ }
148
+ if (!project.suites.length) {
149
+ throw new Error(`The project ${project.name} has no test suites defined, create a suite using the IDE.`);
150
+ }
151
+ for (let i = 0, ii = project.suites.length; i != ii; i++) {
152
+ await runSuite(project, project.suites[i]);
153
+ }
154
+ logger.info(`Finished project ${project.name}`);
155
+ };
156
+ const runAll = async (projects) => {
157
+ for (let i = 0, ii = projects.length; i != ii; i++) {
158
+ await runProject(projects[i]);
159
+ }
160
+ };
161
+ return {
162
+ all: runAll,
163
+ project: runProject,
164
+ suite: runSuite,
165
+ test: runTest,
166
+ };
167
+ };
168
+ exports.default = buildRunners;
169
+ //# sourceMappingURL=run.js.map
@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EAAE,CAAC,EAAE,EAAE;YACxD,MAAM,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SAC3C;QACD,MAAM,CAAC,IAAI,CAAC,oBAAoB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IACjD,CAAC,CAAA;IAED,MAAM,MAAM,GAAG,KAAK,EAAE,QAAmB,EAAE,EAAE;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;YAClD,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;SAC9B;IACH,CAAC,CAAA;IAED,OAAO;QACL,GAAG,EAAE,MAAM;QACX,OAAO,EAAE,UAAU;QACnB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,OAAO;KACd,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,YAAY,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { ProjectShape } from '@seleniumhq/side-model';
2
+ import { Command } from 'commander';
3
+ export declare type JSON = null | string | number | boolean | JSON[] | {
4
+ [key: string]: JSON;
5
+ };
6
+ export interface Project extends ProjectShape {
7
+ path: string;
8
+ }
9
+ export declare type ProxyType = 'autodetect' | 'direct' | 'manual' | 'pac' | 'socks' | 'system';
10
+ export declare type ProxyInputOptions = string | Record<string, string | string[] | number>;
11
+ export declare type ProxyCapabilities = {
12
+ proxyType: 'autodetect' | 'direct' | 'manual' | 'pac' | 'system';
13
+ proxyAutoconfigUrl?: string;
14
+ ftpProxy?: string;
15
+ httpProxy?: string;
16
+ noProxy?: string[];
17
+ sslProxy?: string;
18
+ socksProxy?: string;
19
+ socksVersion?: number;
20
+ };
21
+ export interface SideRunnerCLIConfig {
22
+ baseUrl: string;
23
+ capabilities: string;
24
+ configFile: string;
25
+ debug: boolean;
26
+ filter: string;
27
+ force: boolean;
28
+ maxWorkers: number;
29
+ params: string;
30
+ proxyOptions?: string;
31
+ proxyType?: ProxyType;
32
+ server: string;
33
+ timeout: number;
34
+ }
35
+ export declare type SideRunnerAPI = Command & SideRunnerCLIConfig;
36
+ export declare type Configuration = Required<Pick<SideRunnerCLIConfig, 'baseUrl' | 'filter' | 'maxWorkers' | 'server' | 'timeout'>> & Pick<SideRunnerCLIConfig, 'debug' | 'force' | 'proxyType'> & {
37
+ capabilities: Record<string, JSON>;
38
+ params: Record<string, JSON>;
39
+ projects: string[];
40
+ proxyOptions: ProxyInputOptions;
41
+ runId: string;
42
+ path: string;
43
+ };
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,oBAAY,IAAI,GACZ,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,EAAE,GACN;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAE3B,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,IAAI,EAAE,MAAM,CAAA;CACb;AAED,oBAAY,SAAS,GACjB,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,OAAO,GACP,QAAQ,CAAA;AAEZ,oBAAY,iBAAiB,GACzB,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA;AAE9C,oBAAY,iBAAiB,GAAG;IAC9B,SAAS,EAAE,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAA;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,M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"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export default function Satisfies(strGolden: string, strVersion: string): "project file is older than recommended, in case of issues upgrade the project via the IDE" | "runner is older than project file, in case of issues upgrade the runner using: `npm i -g selenium-side-runner@latest`" | undefined;
2
+ //# sourceMappingURL=versioner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versioner.d.ts","sourceRoot":"","sources":["../src/versioner.ts"],"names":[],"mappings":"AAmBA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qOAgBtE"}
package/dist/versioner.js CHANGED
@@ -1,14 +1,4 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = Satisfies;
7
-
8
- var _semver = _interopRequireDefault(require("semver"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
2
  // Licensed to the Software Freedom Conservancy (SFC) under one
13
3
  // or more contributor license agreements. See the NOTICE file
14
4
  // distributed with this work for additional information
@@ -25,16 +15,27 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
25
15
  // KIND, either express or implied. See the License for the
26
16
  // specific language governing permissions and limitations
27
17
  // under the License.
18
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const semver_1 = __importDefault(require("semver"));
28
23
  function Satisfies(strGolden, strVersion) {
29
- const golden = _semver.default.coerce(strGolden);
30
-
31
- const version = _semver.default.coerce(strVersion);
32
-
33
- if (strGolden === strVersion) {
34
- return;
35
- } else if (_semver.default.satisfies(version, `^${_semver.default.major(golden)}`)) {
36
- return _semver.default.gt(version, golden) ? 'project file is older than recommended, in case of issues upgrade the project via the IDE' : 'runner is older than project file, in case of issues upgrade the runner using: `npm i -g selenium-side-runner@latest`';
37
- } else {
38
- throw new Error(_semver.default.gt(version, golden) ? 'project file is too old for the runner, upgrade the project via the IDE (or use --force)' : 'runner is too old to run the project file, upgrade the runner using: `npm i -g selenium-side-runner@latest`');
39
- }
40
- }
24
+ const golden = semver_1.default.coerce(strGolden);
25
+ const version = semver_1.default.coerce(strVersion);
26
+ if (strGolden === strVersion) {
27
+ return;
28
+ }
29
+ else if (semver_1.default.satisfies(version, `^${semver_1.default.major(golden)}`)) {
30
+ return semver_1.default.gt(version, golden)
31
+ ? 'project file is older than recommended, in case of issues upgrade the project via the IDE'
32
+ : 'runner is older than project file, in case of issues upgrade the runner using: `npm i -g selenium-side-runner@latest`';
33
+ }
34
+ else {
35
+ throw new Error(semver_1.default.gt(version, golden)
36
+ ? 'project file is too old for the runner, upgrade the project via the IDE (or use --force)'
37
+ : 'runner is too old to run the project file, upgrade the runner using: `npm i -g selenium-side-runner@latest`');
38
+ }
39
+ }
40
+ exports.default = Satisfies;
41
+ //# sourceMappingURL=versioner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versioner.js","sourceRoot":"","sources":["../src/versioner.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;;;;;AAErB,oDAAuC;AAEvC,SAAwB,SAAS,CAAC,SAAiB,EAAE,UAAkB;IACrE,MAAM,MAAM,GAAG,gBAAM,CAAC,MAAM,CAAC,SAAS,CAAW,CAAA;IACjD,MAAM,OAAO,GAAG,gBAAM,CAAC,MAAM,CAAC,UAAU,CAAW,CAAA;IACnD,IAAI,SAAS,KAAK,UAAU,EAAE;QAC5B,OAAM;KACP;SAAM,IAAI,gBAAM,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;QAChE,OAAO,gBAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;YAC/B,CAAC,CAAC,2FAA2F;YAC7F,CAAC,CAAC,uHAAuH,CAAA;KAC5H;SAAM;QACL,MAAM,IAAI,KAAK,CACb,gBAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;YACxB,CAAC,CAAC,0FAA0F;YAC5F,CAAC,CAAC,6GAA6G,CAClH,CAAA;KACF;AACH,CAAC;AAhBD,4BAgBC"}
package/jest.config.js ADDED
@@ -0,0 +1,13 @@
1
+ /** eslint-disable **/
2
+ const path = require('path');
3
+ const process = require('process');
4
+
5
+ module.exports = {
6
+ reporters: ['default'],
7
+ rootDir: path.resolve(__dirname),
8
+ testEnvironment: 'node',
9
+ testPathIgnorePatterns: ["<rootDir>/node_modules/"],
10
+ verbose: true,
11
+ };
12
+
13
+