selenium-side-runner 3.16.0 → 4.0.0-alpha.15
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.
- package/README.md +31 -12
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +160 -0
- package/dist/bin.js.map +1 -0
- package/dist/capabilities.d.ts +7 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +49 -66
- package/dist/capabilities.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +12 -18
- package/dist/config.js.map +1 -0
- package/dist/main.test.d.ts +2 -0
- package/dist/main.test.d.ts.map +1 -0
- package/dist/main.test.js +105 -0
- package/dist/main.test.js.map +1 -0
- package/dist/proxy.d.ts +3 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +67 -64
- package/dist/proxy.js.map +1 -0
- package/dist/register.d.ts +16 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +66 -0
- package/dist/register.js.map +1 -0
- package/dist/run.d.ts +14 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +169 -0
- package/dist/run.js.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/versioner.d.ts +2 -0
- package/dist/versioner.d.ts.map +1 -0
- package/dist/versioner.js +23 -22
- package/dist/versioner.js.map +1 -0
- package/jest.config.js +13 -0
- package/package.json +30 -25
- package/src/__tests__/capabilities.spec.ts +137 -0
- package/{dist/npm.js → src/__tests__/config.spec.ts} +8 -24
- package/src/__tests__/config_1.yml +4 -0
- package/src/__tests__/config_2.yml +3 -0
- package/src/__tests__/proxy.spec.ts +138 -0
- package/src/__tests__/versioner.spec.ts +44 -0
- package/src/bin.ts +202 -0
- package/src/capabilities.ts +87 -0
- package/{dist/util.js → src/config.ts} +11 -10
- package/src/main.test.ts +120 -0
- package/src/proxy.ts +89 -0
- package/src/register.ts +79 -0
- package/src/run.ts +182 -0
- package/src/types.ts +82 -0
- package/src/versioner.ts +36 -0
- package/tsconfig.json +19 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/.babelrc +0 -12
- package/dist/child.js +0 -7
- package/dist/index.js +0 -391
- package/dist/module-path.js +0 -41
package/README.md
CHANGED
|
@@ -1,43 +1,53 @@
|
|
|
1
1
|
# Selenium SIDE Runner
|
|
2
|
+
|
|
2
3
|
Runs exported Selenium IDE tests in command line
|
|
3
4
|
|
|
4
5
|
## Installation
|
|
5
|
-
Node.js is required to use `selenium-side-runner`.
|
|
6
|
-
The project guarantees support for the [active LTS major version](https://github.com/nodejs/Release) (e.g. [10](https://nodejs.org/en/download/) & [12](https://nodejs.org/en/download/current/)).
|
|
7
6
|
|
|
7
|
+
Node.js is required to use the Selenium side-runner.
|
|
8
|
+
The project guarantees support for the [active LTS major version](https://github.com/nodejs/Release) (e.g. [10](https://nodejs.org/en/download/) & [12](https://nodejs.org/en/download/current/)).
|
|
8
9
|
__NOTE: The minimum supported version of Node is now 10.15.0 LTS__
|
|
9
10
|
|
|
10
|
-
```yarn global add
|
|
11
|
+
```yarn global add @seleniumhq/side-runner```
|
|
11
12
|
or
|
|
12
|
-
```npm install -g
|
|
13
|
+
```npm install -g @seleniumhq/side-runner```
|
|
13
14
|
|
|
14
15
|
## Usage
|
|
16
|
+
|
|
15
17
|
```selenium-side-runner project.side project2.side *.side```
|
|
16
18
|
|
|
17
19
|
### Passing capabilities
|
|
20
|
+
|
|
18
21
|
```selenium-side-runner -c "browserName=chrome platform=MAC"```
|
|
19
22
|
|
|
20
23
|
#### Passing nested capabilities
|
|
21
|
-
|
|
24
|
+
|
|
25
|
+
```selenium-side-runner -c "goog:chromeOptions.binary='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'"```
|
|
22
26
|
|
|
23
27
|
#### Chrome specific list capabilities (headless)
|
|
24
|
-
|
|
28
|
+
|
|
29
|
+
```selenium-side-runner -c "goog:chromeOptions.args=[disable-infobars, headless]"```
|
|
25
30
|
|
|
26
31
|
### Running on remote WebDriver server
|
|
32
|
+
|
|
27
33
|
```selenium-side-runner --server http://localhost:4444/wd/hub```
|
|
28
34
|
|
|
29
35
|
### Filter tests
|
|
36
|
+
|
|
30
37
|
Will only run tests matching the filter
|
|
31
38
|
```selenium-side-runner --filter mytest```
|
|
32
39
|
|
|
33
40
|
### Changing the base URL
|
|
41
|
+
|
|
34
42
|
Change the base URL that the tests were recorded with, note that it will not affect tests that used absolute URLs.
|
|
35
43
|
```selenium-side-runner --base-url https://www.seleniumhq.org```
|
|
36
44
|
|
|
37
45
|
### .side.yml
|
|
46
|
+
|
|
38
47
|
All of the configuration can be written in the `.side.yml` file, the runner will load it from the current working directory automatically.
|
|
39
48
|
|
|
40
49
|
#### Example usage
|
|
50
|
+
|
|
41
51
|
```yaml
|
|
42
52
|
capabilities:
|
|
43
53
|
browserName: "firefox"
|
|
@@ -48,25 +58,31 @@ server: "http://localhost:4444/wd/hub"
|
|
|
48
58
|
### Advanced features
|
|
49
59
|
|
|
50
60
|
#### Running on multiple workers
|
|
61
|
+
|
|
51
62
|
Running tests faster through the use of multiple workers
|
|
52
63
|
```selenium-side-runner -w 4```
|
|
53
64
|
The runner will automatically set the number of workers to the amount of cores available, for most cases this is the best result.
|
|
54
|
-
|
|
65
|
+
__Note:__ unless you specified that a suite is parallel, it will still run the contained tests sequentially, though the runner will run suites in parallel by default.
|
|
55
66
|
To mark a suite's tests as parallel, set that in the suite's settings in the IDE.
|
|
56
67
|
|
|
57
68
|
#### Using a proxy server
|
|
69
|
+
|
|
58
70
|
`selenium-side-runner` can pass proxy capabilities to the browser using the following schemes.
|
|
59
71
|
|
|
60
72
|
##### direct proxy
|
|
73
|
+
|
|
61
74
|
Configures WebDriver to bypass all browser proxies.
|
|
62
75
|
```selenium-side-runner --proxy-type=direct```
|
|
76
|
+
|
|
63
77
|
```yaml
|
|
64
78
|
proxyType: direct
|
|
65
79
|
```
|
|
66
80
|
|
|
67
81
|
##### manual proxy
|
|
82
|
+
|
|
68
83
|
Manually configures the browser proxy.
|
|
69
84
|
```selenium-side-runner --proxy-type=manual --proxy-options="http=localhost:434 bypass=[http://localhost:434, http://localhost:8080]"```
|
|
85
|
+
|
|
70
86
|
```yaml
|
|
71
87
|
proxyType: manual
|
|
72
88
|
proxyOptions:
|
|
@@ -80,16 +96,20 @@ proxyOptions:
|
|
|
80
96
|
```
|
|
81
97
|
|
|
82
98
|
##### pac proxy
|
|
99
|
+
|
|
83
100
|
Configures WebDriver to configure the browser proxy using the PAC file at the given URL.
|
|
84
101
|
```selenium-side-runner --proxy-type=pac --proxy-options="http://localhost/pac"```
|
|
102
|
+
|
|
85
103
|
```yaml
|
|
86
104
|
proxyType: pac
|
|
87
105
|
proxyOptions: http://localhost/pac
|
|
88
106
|
```
|
|
89
107
|
|
|
90
108
|
##### socks proxy
|
|
109
|
+
|
|
91
110
|
Creates a proxy configuration for a socks proxy.
|
|
92
111
|
```selenium-side-runner --proxy-type=socks --proxy-options="socksProxy=localhost:434 socksVersion=5"```
|
|
112
|
+
|
|
93
113
|
```yaml
|
|
94
114
|
proxyType: socks
|
|
95
115
|
proxyOptions:
|
|
@@ -98,8 +118,10 @@ proxyOptions:
|
|
|
98
118
|
```
|
|
99
119
|
|
|
100
120
|
##### system proxy
|
|
121
|
+
|
|
101
122
|
Configures WebDriver to use the current system's proxy.
|
|
102
123
|
```selenium-side-runner --proxy-type=system```
|
|
124
|
+
|
|
103
125
|
```yaml
|
|
104
126
|
proxyType: system
|
|
105
127
|
```
|
|
@@ -107,10 +129,7 @@ proxyType: system
|
|
|
107
129
|
### FAQ
|
|
108
130
|
|
|
109
131
|
#### I'm getting an error similar to `Unknown locator ${vars.something}`
|
|
110
|
-
|
|
132
|
+
|
|
133
|
+
When running your projects make sure that the command is aware of the locator strategy __before__ variables are evaluated.
|
|
111
134
|
For example `click | id=${myButton}` vs `click | ${idOfMyButton}`.
|
|
112
135
|
Always use the first one, since the strategy is hardcoded in the command, the second would yield an error.
|
|
113
|
-
|
|
114
|
-
>But it works in the IDE.
|
|
115
|
-
|
|
116
|
-
That is because the IDE calculates locator strategies differently than the runner, it is a known current issue.
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
+
// or more contributor license agreements. See the NOTICE file
|
|
5
|
+
// distributed with this work for additional information
|
|
6
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
7
|
+
// to you under the Apache License, Version 2.0 (the
|
|
8
|
+
// "License"); you may not use this file except in compliance
|
|
9
|
+
// with the License. You may obtain a copy of the License at
|
|
10
|
+
//
|
|
11
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
//
|
|
13
|
+
// Unless required by applicable law or agreed to in writing,
|
|
14
|
+
// software distributed under the License is distributed on an
|
|
15
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
// KIND, either express or implied. See the License for the
|
|
17
|
+
// specific language governing permissions and limitations
|
|
18
|
+
// under the License.
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
const os_1 = __importDefault(require("os"));
|
|
24
|
+
const path_1 = __importDefault(require("path"));
|
|
25
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
26
|
+
const util_1 = __importDefault(require("util"));
|
|
27
|
+
const commander_1 = require("commander");
|
|
28
|
+
const capabilities_1 = __importDefault(require("./capabilities"));
|
|
29
|
+
const config_1 = __importDefault(require("./config"));
|
|
30
|
+
const proxy_1 = __importDefault(require("./proxy"));
|
|
31
|
+
const child_process_1 = require("child_process");
|
|
32
|
+
const isWindows = os_1.default.platform() === 'win32';
|
|
33
|
+
const metadata = require('../package.json');
|
|
34
|
+
const DEFAULT_TIMEOUT = 15000;
|
|
35
|
+
process.title = metadata.name;
|
|
36
|
+
const program = new commander_1.Command();
|
|
37
|
+
program
|
|
38
|
+
.usage('[options] your-project-glob-here-*.side [variadic-project-globs-*.side]')
|
|
39
|
+
.version(metadata.version)
|
|
40
|
+
.option('--base-url [url]', 'Override the base URL that was set in the IDE')
|
|
41
|
+
.option('-c, --capabilities [list]', 'Webdriver capabilities')
|
|
42
|
+
.option('-s, --server [url]', 'Webdriver remote server')
|
|
43
|
+
.option('-p, --params [list]', 'General parameters')
|
|
44
|
+
.option('-f, --filter [string]', 'Run suites matching name, takes a regex without slashes, eg (^(hello|goodbye).*$)')
|
|
45
|
+
.option('-w, --max-workers [number]', `Maximum amount of workers that will run your tests, defaults to number of cores`, (str) => parseInt(str), os_1.default.cpus().length)
|
|
46
|
+
.option('-t, --timeout [number]', `The maximimum amount of time, in milliseconds, to spend attempting to locate an element. (default: ${DEFAULT_TIMEOUT})`, (str) => parseInt(str), DEFAULT_TIMEOUT)
|
|
47
|
+
.option('-x, --proxy-type [type]', 'Type of proxy to use (one of: direct, manual, pac, socks, system)')
|
|
48
|
+
.option('-y, --proxy-options [list]', 'Proxy options to pass, for use with manual, pac and socks proxies')
|
|
49
|
+
.option('-n, --config-file [filepath]', 'Use specified YAML file for configuration. (default: .side.yml)')
|
|
50
|
+
.option('-o, --output-directory [directory]', 'Write test results to files, format is defined by --output-format')
|
|
51
|
+
.option('-f, --force', "Forcibly run the project, regardless of project's version")
|
|
52
|
+
.option('-d, --debug', 'Print debug logs');
|
|
53
|
+
program.parse();
|
|
54
|
+
if (!program.args.length) {
|
|
55
|
+
program.outputHelp();
|
|
56
|
+
// eslint-disable-next-line no-process-exit
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
const options = program.opts();
|
|
60
|
+
const configuration = {
|
|
61
|
+
baseUrl: '',
|
|
62
|
+
capabilities: {
|
|
63
|
+
browserName: 'chrome',
|
|
64
|
+
},
|
|
65
|
+
debug: options.debug,
|
|
66
|
+
filter: '.*',
|
|
67
|
+
force: options.force,
|
|
68
|
+
maxWorkers: options.maxWorkers,
|
|
69
|
+
params: {},
|
|
70
|
+
// Convert all project paths into absolute paths
|
|
71
|
+
projects: program.args.map((arg) => {
|
|
72
|
+
if (path_1.default.isAbsolute(arg))
|
|
73
|
+
return arg;
|
|
74
|
+
return path_1.default.join(process.cwd(), arg);
|
|
75
|
+
}),
|
|
76
|
+
proxyOptions: {},
|
|
77
|
+
runId: crypto_1.default.randomBytes(16).toString('hex'),
|
|
78
|
+
path: path_1.default.join(__dirname, '../../'),
|
|
79
|
+
server: '',
|
|
80
|
+
timeout: options.timeout,
|
|
81
|
+
};
|
|
82
|
+
const confPath = options.configFile || '.side.yml';
|
|
83
|
+
const configFilePath = path_1.default.isAbsolute(confPath)
|
|
84
|
+
? confPath
|
|
85
|
+
: path_1.default.join(process.cwd(), confPath);
|
|
86
|
+
try {
|
|
87
|
+
Object.assign(configuration, config_1.default.load(configFilePath));
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
options.debug && console.debug('Could not load ' + configFilePath);
|
|
91
|
+
}
|
|
92
|
+
if (options.filter) {
|
|
93
|
+
configuration.filter = options.filter;
|
|
94
|
+
}
|
|
95
|
+
configuration.server = options.server ? options.server : configuration.server;
|
|
96
|
+
if (options.capabilities) {
|
|
97
|
+
try {
|
|
98
|
+
configuration.capabilities = capabilities_1.default.parseString(options.capabilities);
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
options.debug && console.debug('Failed to parse inline capabilities');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (options.params) {
|
|
105
|
+
try {
|
|
106
|
+
configuration.params = capabilities_1.default.parseString(options.params);
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
options.debug && console.debug('Failed to parse additional params');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (options.proxyType) {
|
|
113
|
+
try {
|
|
114
|
+
let opts;
|
|
115
|
+
if (options.proxyType === 'manual' || options.proxyType === 'socks') {
|
|
116
|
+
opts = capabilities_1.default.parseString(options.proxyOptions);
|
|
117
|
+
}
|
|
118
|
+
const proxy = (0, proxy_1.default)(options.proxyType, opts);
|
|
119
|
+
Object.assign(configuration.capabilities, proxy);
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
console.error(e.message);
|
|
123
|
+
// eslint-disable-next-line no-process-exit
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (configuration.proxyType) {
|
|
128
|
+
try {
|
|
129
|
+
const proxy = (0, proxy_1.default)(configuration.proxyType, configuration.proxyOptions);
|
|
130
|
+
Object.assign(configuration.capabilities, proxy);
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
console.error(e.message);
|
|
134
|
+
// eslint-disable-next-line no-process-exit
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
configuration.baseUrl = options.baseUrl
|
|
139
|
+
? options.baseUrl
|
|
140
|
+
: configuration.baseUrl;
|
|
141
|
+
options.debug && console.debug(util_1.default.inspect(configuration));
|
|
142
|
+
const jestExecutable = isWindows ? 'jest.cmd' : 'jest';
|
|
143
|
+
(0, child_process_1.spawn)(path_1.default.join(__dirname, '..', 'node_modules', '.bin', jestExecutable), [
|
|
144
|
+
'--config=' + path_1.default.join(__dirname, '..', 'jest.config.js'),
|
|
145
|
+
'--maxConcurrency=' + configuration.maxWorkers,
|
|
146
|
+
'--runTestsByPath',
|
|
147
|
+
path_1.default.join(__dirname, 'main.test.js'),
|
|
148
|
+
], {
|
|
149
|
+
env: {
|
|
150
|
+
...process.env,
|
|
151
|
+
SE_CONFIGURATION: JSON.stringify(configuration),
|
|
152
|
+
},
|
|
153
|
+
shell: true,
|
|
154
|
+
stdio: 'inherit',
|
|
155
|
+
}).on('exit', (code) => {
|
|
156
|
+
// This is my bin, my process
|
|
157
|
+
// eslint-disable-next-line no-process-exit
|
|
158
|
+
process.exit(code);
|
|
159
|
+
});
|
|
160
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;AAEA,+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,4CAAmB;AACnB,gDAAuB;AACvB,oDAA2B;AAC3B,gDAAuB;AACvB,yCAAmC;AACnC,kEAAyC;AACzC,sDAA6B;AAC7B,oDAAgC;AAEhC,iDAAqC;AAErC,MAAM,SAAS,GAAG,YAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAA;AAE3C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAE3C,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAA;AAE7B,MAAM,OAAO,GAAkB,IAAI,mBAAO,EAAmB,CAAA;AAC7D,OAAO;KACJ,KAAK,CACJ,yEAAyE,CAC1E;KACA,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;KACzB,MAAM,CAAC,kBAAkB,EAAE,+CAA+C,CAAC;KAC3E,MAAM,CAAC,2BAA2B,E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AE,MAAM,SAAS,CAAA;AAE9B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAQ/D;;;;AAED,wBAEC"}
|
package/dist/capabilities.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.parseString = parseString;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
|
|
9
2
|
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
10
3
|
// or more contributor license agreements. See the NOTICE file
|
|
11
4
|
// distributed with this work for additional information
|
|
@@ -22,73 +15,63 @@ exports.default = void 0;
|
|
|
22
15
|
// KIND, either express or implied. See the License for the
|
|
23
16
|
// specific language governing permissions and limitations
|
|
24
17
|
// under the License.
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.parseString = void 0;
|
|
25
20
|
function parseString(input) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
assignStringKey(key, parseStringValue(value), capabilities);
|
|
32
|
-
});
|
|
33
|
-
return capabilities;
|
|
21
|
+
const capabilities = {};
|
|
22
|
+
matchStringPairs(input).forEach(({ key, value }) => {
|
|
23
|
+
assignStringKey(key, parseStringValue(value), capabilities);
|
|
24
|
+
});
|
|
25
|
+
return capabilities;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
exports.parseString = parseString;
|
|
28
|
+
exports.default = {
|
|
29
|
+
parseString,
|
|
38
30
|
};
|
|
39
|
-
exports.default = _default;
|
|
40
|
-
|
|
41
31
|
function matchStringPairs(input) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
value: result[2]
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return splitCapabilities;
|
|
32
|
+
const regex = /([^\s=]*)\s?=\s?(".*?"|'.*?'|\[.*\]|[^\s]*)/g;
|
|
33
|
+
let result;
|
|
34
|
+
const splitCapabilities = [];
|
|
35
|
+
while ((result = regex.exec(input)) !== null) {
|
|
36
|
+
splitCapabilities.push({ key: result[1], value: result[2] });
|
|
37
|
+
}
|
|
38
|
+
return splitCapabilities;
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
function assignStringKey(key, value, keyObject) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
41
|
+
keyObject = keyObject || {};
|
|
42
|
+
// @ts-expect-error
|
|
43
|
+
key.split('.').reduce((objectKey, currKey, index, keys) => {
|
|
44
|
+
const ref = !objectKey[currKey] || typeof objectKey[currKey] !== 'object'
|
|
45
|
+
? {}
|
|
46
|
+
: objectKey[currKey];
|
|
47
|
+
objectKey[currKey] = keys.length === index + 1 ? value : ref;
|
|
48
|
+
return ref;
|
|
49
|
+
}, keyObject);
|
|
50
|
+
return keyObject;
|
|
64
51
|
}
|
|
65
|
-
|
|
66
52
|
function parseStringValue(value) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
// is array
|
|
54
|
+
if (/^\[.*\]$/.test(value)) {
|
|
55
|
+
const matches = value.slice(1, -2).match(/(([^,]*)*)/g);
|
|
56
|
+
return matches.filter((s) => !!s).map((s) => s.trim());
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
let parsed = JSON.parse(value);
|
|
60
|
+
if (typeof parsed === 'string') {
|
|
61
|
+
parsed = parsed.trim();
|
|
62
|
+
}
|
|
63
|
+
return parsed;
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
// single quote is illegal in JSON
|
|
67
|
+
return trimSingleQuote(value);
|
|
77
68
|
}
|
|
78
|
-
|
|
79
|
-
return parsed;
|
|
80
|
-
} catch (e) {
|
|
81
|
-
// single quote is illegal in JSON
|
|
82
|
-
return trimSingleQuote(value);
|
|
83
|
-
}
|
|
84
69
|
}
|
|
85
|
-
|
|
86
70
|
function trimSingleQuote(value) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
71
|
+
let str = value.trim();
|
|
72
|
+
if (str[0] === str[str.length - 1] && str[0] === "'") {
|
|
73
|
+
return str.slice(1, -2);
|
|
74
|
+
}
|
|
75
|
+
return str;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.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;;;AAIrB,SAAgB,WAAW,CAAC,KAAa;IACvC,MAAM,YAAY,GAAG,EAAE,CAAA;IAEvB,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE;QACjD,eAAe,CAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;IAEF,OAAO,YAAY,CAAA;AACrB,CAAC;AARD,kCAQC;AAED,kBAAe;IACb,WAAW;CACZ,CAAA;AAED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,aAAa,CAAa,CAAA;QACnE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;KACvD;IACD,IAAI;QACF,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC9B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAA;SACvB;QACD,OAAO,MAAM,CAAA;KACd;IAAC,OAAO,CAAC,EAAE;QACV,kCAAkC;QAClC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAA;KAC9B;AACH,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACtB,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACpD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;KACxB;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAoBA,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,WAElC;;;;AAED,wBAEC"}
|
package/dist/config.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.load = load;
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
|
|
9
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
10
|
-
|
|
11
|
-
var _jsYaml = _interopRequireDefault(require("js-yaml"));
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
2
|
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
16
3
|
// or more contributor license agreements. See the NOTICE file
|
|
17
4
|
// distributed with this work for additional information
|
|
@@ -28,11 +15,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
15
|
// KIND, either express or implied. See the License for the
|
|
29
16
|
// specific language governing permissions and limitations
|
|
30
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
|
+
exports.load = void 0;
|
|
23
|
+
const fs_1 = __importDefault(require("fs"));
|
|
24
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
31
25
|
function load(config) {
|
|
32
|
-
|
|
26
|
+
return js_yaml_1.default.load(fs_1.default.readFileSync(config, 'utf8'));
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
exports.load = load;
|
|
29
|
+
exports.default = {
|
|
30
|
+
load,
|
|
37
31
|
};
|
|
38
|
-
|
|
32
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.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,4CAAmB;AACnB,sDAA0B;AAE1B,SAAgB,IAAI,CAAC,MAAc;IACjC,OAAO,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AACnD,CAAC;AAFD,oBAEC;AAED,kBAAe;IACb,IAAI;CACL,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.test.d.ts","sourceRoot":"","sources":["../src/main.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 jest_each_1 = __importDefault(require("jest-each"));
|
|
23
|
+
const fs_1 = __importDefault(require("fs"));
|
|
24
|
+
const util_1 = __importDefault(require("util"));
|
|
25
|
+
const glob_1 = __importDefault(require("glob"));
|
|
26
|
+
const winston_1 = require("winston");
|
|
27
|
+
const register_1 = __importDefault(require("./register"));
|
|
28
|
+
const run_1 = __importDefault(require("./run"));
|
|
29
|
+
const metadata = require('../package.json');
|
|
30
|
+
process.title = metadata.name;
|
|
31
|
+
const configuration = JSON.parse(process.env.SE_CONFIGURATION);
|
|
32
|
+
// Jest timeout should be really far back, otherwise it will impede people
|
|
33
|
+
// When working right, we should close shop and detonate on our own much sooner
|
|
34
|
+
jest.setTimeout(60 * 60 * 1000); // 60 minutes before we just cut it off
|
|
35
|
+
const logger = (0, winston_1.createLogger)({
|
|
36
|
+
level: configuration.debug ? 'debug' : 'info',
|
|
37
|
+
transports: [
|
|
38
|
+
new winston_1.transports.Console({
|
|
39
|
+
format: winston_1.format.combine(winston_1.format.colorize(), winston_1.format.simple()),
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
logger.debug(util_1.default.inspect(configuration));
|
|
44
|
+
const projectTitle = 'Running project $name';
|
|
45
|
+
const suiteTitle = 'Running suite $name';
|
|
46
|
+
const testTitle = 'Running test $name';
|
|
47
|
+
const projects = [
|
|
48
|
+
...configuration.projects.reduce((projects, project) => {
|
|
49
|
+
glob_1.default.sync(project).forEach((p) => {
|
|
50
|
+
projects.add(p);
|
|
51
|
+
});
|
|
52
|
+
return projects;
|
|
53
|
+
}, new Set()),
|
|
54
|
+
]
|
|
55
|
+
.map((p) => {
|
|
56
|
+
const project = JSON.parse(fs_1.default.readFileSync(p, 'utf8'));
|
|
57
|
+
project.path = p;
|
|
58
|
+
return project;
|
|
59
|
+
})
|
|
60
|
+
.filter((p) => Boolean(p));
|
|
61
|
+
if (!projects.length) {
|
|
62
|
+
throw new Error('No matching projects found, supplied filepaths: ' +
|
|
63
|
+
configuration.projects.join(', '));
|
|
64
|
+
}
|
|
65
|
+
const factoryParams = {
|
|
66
|
+
configuration,
|
|
67
|
+
logger: logger,
|
|
68
|
+
};
|
|
69
|
+
const register = (0, register_1.default)(factoryParams);
|
|
70
|
+
const runners = (0, run_1.default)(factoryParams);
|
|
71
|
+
(0, jest_each_1.default)(projects).describe(projectTitle, (project) => {
|
|
72
|
+
const suites = project.suites.filter((suite) => suite.tests.length && new RegExp(configuration.filter).test(suite.name));
|
|
73
|
+
if (suites.length) {
|
|
74
|
+
(0, jest_each_1.default)(suites).describe(suiteTitle, (suite) => {
|
|
75
|
+
const isParallel = suite.parallel;
|
|
76
|
+
const tests = suite.tests
|
|
77
|
+
.map((tID) => register.test(project, tID))
|
|
78
|
+
.filter((test) => new RegExp(configuration.filter).test(test.name));
|
|
79
|
+
const testExecutor = (0, jest_each_1.default)(tests);
|
|
80
|
+
const testMethod = isParallel
|
|
81
|
+
? testExecutor.test.concurrent
|
|
82
|
+
: testExecutor.test;
|
|
83
|
+
testMethod(testTitle, async (test) => {
|
|
84
|
+
await runners.test(project, test);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
console.info(`
|
|
90
|
+
Project ${project.name} doesn't have any suites matching filter ${configuration.filter},
|
|
91
|
+
attempting to iterate all tests in project
|
|
92
|
+
`);
|
|
93
|
+
const tests = project.tests
|
|
94
|
+
.map((test) => register.test(project, test.id))
|
|
95
|
+
.filter((test) => new RegExp(configuration.filter).test(test.name));
|
|
96
|
+
if (!tests.length) {
|
|
97
|
+
throw new Error(`No suites or tests found in project ${project.name} matching filter ${configuration.filter}, unable to test!`);
|
|
98
|
+
}
|
|
99
|
+
const testExecutor = (0, jest_each_1.default)(tests);
|
|
100
|
+
testExecutor.test(testTitle, async (test) => {
|
|
101
|
+
await runners.test(project, test);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=main.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.test.js","sourceRoot":"","sources":["../src/main.test.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AA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