@elastic/synthetics 1.0.0-beta.21 → 1.0.0-beta.24
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/CHANGELOG.md +23 -0
- package/dist/cli.js +55 -184
- package/dist/cli.js.map +1 -1
- package/dist/common_types.d.ts +80 -32
- package/dist/common_types.d.ts.map +1 -1
- package/dist/config.js +5 -5
- package/dist/config.js.map +1 -1
- package/dist/core/browser-service.js +5 -5
- package/dist/core/browser-service.js.map +1 -1
- package/dist/core/gatherer.d.ts +1 -2
- package/dist/core/gatherer.d.ts.map +1 -1
- package/dist/core/gatherer.js +7 -8
- package/dist/core/gatherer.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +9 -11
- package/dist/core/index.js.map +1 -1
- package/dist/core/logger.js +2 -2
- package/dist/core/logger.js.map +1 -1
- package/dist/core/runner.d.ts +1 -8
- package/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +34 -35
- package/dist/core/runner.js.map +1 -1
- package/dist/dsl/journey.d.ts +4 -3
- package/dist/dsl/journey.d.ts.map +1 -1
- package/dist/dsl/journey.js +6 -5
- package/dist/dsl/journey.js.map +1 -1
- package/dist/dsl/step.d.ts +3 -2
- package/dist/dsl/step.d.ts.map +1 -1
- package/dist/dsl/step.js +2 -1
- package/dist/dsl/step.js.map +1 -1
- package/dist/formatter/javascript.d.ts +31 -6
- package/dist/formatter/javascript.d.ts.map +1 -1
- package/dist/formatter/javascript.js +45 -24
- package/dist/formatter/javascript.js.map +1 -1
- package/dist/helpers.d.ts +2 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +48 -19
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/{parse_args.d.ts → loader.d.ts} +2 -5
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +144 -0
- package/dist/loader.js.map +1 -0
- package/dist/options.d.ts +27 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +108 -0
- package/dist/options.js.map +1 -0
- package/dist/plugins/browser-console.js +2 -2
- package/dist/plugins/browser-console.js.map +1 -1
- package/dist/plugins/network.d.ts +1 -1
- package/dist/plugins/network.d.ts.map +1 -1
- package/dist/plugins/network.js +47 -24
- package/dist/plugins/network.js.map +1 -1
- package/dist/reporters/base.d.ts.map +1 -1
- package/dist/reporters/base.js +14 -11
- package/dist/reporters/base.js.map +1 -1
- package/dist/reporters/json.d.ts +4 -53
- package/dist/reporters/json.d.ts.map +1 -1
- package/dist/reporters/json.js +19 -48
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/junit.d.ts.map +1 -1
- package/dist/reporters/junit.js +7 -7
- package/dist/reporters/junit.js.map +1 -1
- package/dist/sdk/lh-trace-processor.js +3 -3
- package/dist/sdk/lh-trace-processor.js.map +1 -1
- package/dist/sdk/trace-metrics.js +3 -4
- package/dist/sdk/trace-metrics.js.map +1 -1
- package/dist/sdk/trace-processor.d.ts.map +1 -1
- package/dist/sdk/trace-processor.js +1 -1
- package/dist/sdk/trace-processor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/src/cli.ts +114 -188
- package/src/common_types.ts +91 -32
- package/src/core/gatherer.ts +2 -3
- package/src/core/index.ts +22 -16
- package/src/core/runner.ts +2 -22
- package/src/dsl/journey.ts +10 -4
- package/src/dsl/step.ts +9 -2
- package/src/formatter/javascript.ts +59 -22
- package/src/helpers.ts +40 -1
- package/src/index.ts +10 -16
- package/src/loader.ts +162 -0
- package/src/options.ts +116 -0
- package/src/plugins/network.ts +49 -25
- package/src/reporters/base.ts +6 -1
- package/src/reporters/json.ts +8 -39
- package/src/reporters/junit.ts +1 -1
- package/src/sdk/trace-processor.ts +1 -1
- package/dist/parse_args.d.ts.map +0 -1
- package/dist/parse_args.js +0 -103
- package/dist/parse_args.js.map +0 -1
- package/src/parse_args.ts +0 -158
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v1.0.0-beta.23 (2021-03-23)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- Add location metadata for journeys and step #474
|
|
10
|
+
- Export Action type from the Synthetics formatter #454
|
|
11
|
+
- Enhance the synthetics formatter to control when the step begins and ends #457
|
|
12
|
+
- Add ability to add subcommands to the cli in #475
|
|
13
|
+
|
|
14
|
+
## v1.0.0-beta.22 (2021-03-14)
|
|
15
|
+
|
|
16
|
+
### Bug fixes
|
|
17
|
+
|
|
18
|
+
- Empty the write buffer before exit the Node.js process #446
|
|
19
|
+
- Reduce the network information data by writing only the
|
|
20
|
+
necessary fields #466
|
|
21
|
+
|
|
22
|
+
## v1.0.0-beta.21 (2021-02-22)
|
|
23
|
+
|
|
24
|
+
### Bug fixes
|
|
25
|
+
|
|
26
|
+
- Do not override User agent string when doing device emulation #462
|
|
27
|
+
|
|
5
28
|
## v1.0.0-beta.20 (2021-02-16)
|
|
6
29
|
|
|
7
30
|
### Bug fixes
|
package/dist/cli.js
CHANGED
|
@@ -24,199 +24,70 @@
|
|
|
24
24
|
* THE SOFTWARE.
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
30
|
-
}) : (function(o, m, k, k2) {
|
|
31
|
-
if (k2 === undefined) k2 = k;
|
|
32
|
-
o[k2] = m[k];
|
|
33
|
-
}));
|
|
34
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
-
}) : function(o, v) {
|
|
37
|
-
o["default"] = v;
|
|
38
|
-
});
|
|
39
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
40
|
-
if (mod && mod.__esModule) return mod;
|
|
41
|
-
var result = {};
|
|
42
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
43
|
-
__setModuleDefault(result, mod);
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
-
};
|
|
49
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
53
|
-
const core_1 = require("./core");
|
|
54
|
-
const logger_1 = require("./core/logger");
|
|
55
|
-
const parse_args_1 = __importStar(require("./parse_args"));
|
|
56
|
-
const expect_1 = require("./core/expect");
|
|
28
|
+
const commander_1 = require("commander");
|
|
29
|
+
const reporters_1 = require("./reporters");
|
|
57
30
|
const helpers_1 = require("./helpers");
|
|
31
|
+
const options_1 = require("./options");
|
|
32
|
+
const loader_1 = require("./loader");
|
|
58
33
|
const _1 = require("./");
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
for (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const addSuite = absPath => {
|
|
96
|
-
logger_1.log(`Processing file: ${absPath}`);
|
|
97
|
-
suites.add(require.resolve(absPath));
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Match all files inside the directory with the
|
|
101
|
-
* .journey.{mjs|cjs|js|ts) extensions
|
|
102
|
-
*/
|
|
103
|
-
const pattern = parse_args_1.options.pattern
|
|
104
|
-
? new RegExp(parse_args_1.options.pattern, 'i')
|
|
105
|
-
: /.+\.journey\.([mc]js|[jt]s?)$/;
|
|
106
|
-
/**
|
|
107
|
-
* Ignore node_modules by default when running suites
|
|
108
|
-
*/
|
|
109
|
-
const ignored = /node_modules/i;
|
|
110
|
-
for (const input of inputs) {
|
|
111
|
-
const absPath = path_1.resolve(resolvedCwd, input);
|
|
34
|
+
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
|
|
35
|
+
const { name, version } = require('../package.json');
|
|
36
|
+
commander_1.program
|
|
37
|
+
.name(`npx ${name}`)
|
|
38
|
+
.usage('[options] [dir] [files] file')
|
|
39
|
+
.option('-c, --config <path>', 'configuration path (default: synthetics.config.js)')
|
|
40
|
+
.option('-p, --params <jsonstring>', 'JSON object that gets injected to all journeys', JSON.parse)
|
|
41
|
+
.addOption(new commander_1.Option('--reporter <value>', `output repoter format`).choices(Object.keys(reporters_1.reporters)))
|
|
42
|
+
.option('--pattern <pattern>', 'RegExp file patterns to search inside directory')
|
|
43
|
+
.option('--inline', 'Run inline journeys from heartbeat')
|
|
44
|
+
.option('-r, --require <modules...>', 'module(s) to preload')
|
|
45
|
+
.option('--no-headless', 'run browser in headful mode')
|
|
46
|
+
.option('--sandbox', 'enable chromium sandboxing', false)
|
|
47
|
+
.option('--rich-events', 'Mimics a heartbeat run')
|
|
48
|
+
.option('--capability <features...>', 'Enable capabilities through feature flags')
|
|
49
|
+
.addOption(new commander_1.Option('--screenshots [flag]', 'take screenshots at end of each step')
|
|
50
|
+
.choices(['on', 'off', 'only-on-failure'])
|
|
51
|
+
.default('on'))
|
|
52
|
+
.option('--dry-run', "don't actually execute anything, report only registered journeys")
|
|
53
|
+
.option('--match <name>', 'run only journeys with a name or tags that matches the glob')
|
|
54
|
+
.option('--tags <name...>', 'run only journeys with the given tag(s), or globs')
|
|
55
|
+
.option('--outfd <fd>', 'specify a file descriptor for logs. Default is stdout', parseInt)
|
|
56
|
+
.option('--ws-endpoint <endpoint>', 'Browser WebSocket endpoint to connect to')
|
|
57
|
+
.option('--pause-on-error', 'pause on error until a keypress is made in the console. Useful during development')
|
|
58
|
+
.option('--ignore-https-errors', 'ignores any HTTPS errors in sites being tested, including ones related to unrecognized certs or signatures. This can be insecure!')
|
|
59
|
+
.option('--quiet-exit-code', 'always return 0 as an exit code status, regardless of test pass / fail. Only return > 0 exit codes on internal errors where the suite could not be run')
|
|
60
|
+
.option('--throttling <d/u/l>', 'List of options to throttle network conditions for download throughput (d) in megabits/second, upload throughput (u) in megabits/second and latency (l) in milliseconds.', helpers_1.DEFAULT_NETWORK_CONDITIONS_ARG)
|
|
61
|
+
.option('--no-throttling', 'Turns off default network throttling.')
|
|
62
|
+
.option('--playwright-options <jsonstring>', 'JSON object to pass in custom Playwright options for the agent. Options passed will be merged with Playwright options defined in your synthetics.config.js file. Options defined via --playwright-options take precedence.', JSON.parse)
|
|
63
|
+
.version(version)
|
|
64
|
+
.description('Run synthetic tests')
|
|
65
|
+
.action(async (cliArgs) => {
|
|
66
|
+
try {
|
|
67
|
+
await (0, loader_1.loadTestFiles)(cliArgs, commander_1.program.args);
|
|
68
|
+
const options = (0, options_1.normalizeOptions)(cliArgs);
|
|
69
|
+
const results = await (0, _1.run)(options);
|
|
112
70
|
/**
|
|
113
|
-
*
|
|
114
|
-
* the suites
|
|
71
|
+
* Exit with error status if any journey fails
|
|
115
72
|
*/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
addSuite(abs);
|
|
73
|
+
if (!options.quietExitCode) {
|
|
74
|
+
for (const result of Object.values(results)) {
|
|
75
|
+
if (result.status === 'failed') {
|
|
76
|
+
process.exit(1);
|
|
121
77
|
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
addSuite(absPath);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return suites.values();
|
|
129
|
-
}
|
|
130
|
-
(async () => {
|
|
131
|
-
/**
|
|
132
|
-
* Transform `.ts` files out of the box by invoking
|
|
133
|
-
* the `ts-node` via `transpile-only` mode that compiles
|
|
134
|
-
* TS files without doing any extensive type checks.
|
|
135
|
-
*
|
|
136
|
-
* We must register `ts-node` _before_ loading inline
|
|
137
|
-
* scripts too because otherwise we will not be able to
|
|
138
|
-
* require `.ts` configuration files.
|
|
139
|
-
*/
|
|
140
|
-
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
|
|
141
|
-
require('ts-node').register({
|
|
142
|
-
transpileOnly: true,
|
|
143
|
-
compilerOptions: {
|
|
144
|
-
esModuleInterop: true,
|
|
145
|
-
allowJs: true,
|
|
146
|
-
target: 'es2018',
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
if (parse_args_1.options.inline) {
|
|
150
|
-
const source = await readStdin();
|
|
151
|
-
loadInlineScript(source);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
/**
|
|
155
|
-
* Preload modules before running the suites
|
|
156
|
-
*/
|
|
157
|
-
const modules = [].concat(parse_args_1.options.require || []).filter(Boolean);
|
|
158
|
-
for (const name of modules) {
|
|
159
|
-
if (helpers_1.isDepInstalled(name)) {
|
|
160
|
-
require(name);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
throw new Error(`cannot find module '${name}'`);
|
|
164
78
|
}
|
|
165
79
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Handle piped files by reading the STDIN
|
|
168
|
-
* ex: ls example/suites/*.js | npx @elastic/synthetics
|
|
169
|
-
*/
|
|
170
|
-
const files = parse_args_1.default.args.length > 0
|
|
171
|
-
? parse_args_1.default.args
|
|
172
|
-
: (await readStdin()).split('\n').filter(Boolean);
|
|
173
|
-
const suites = await prepareSuites(files);
|
|
174
|
-
requireSuites(suites);
|
|
175
80
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const environment = process.env['NODE_ENV'] || 'development';
|
|
180
|
-
/**
|
|
181
|
-
* Validate and handle configs
|
|
182
|
-
*/
|
|
183
|
-
const config = parse_args_1.options.config || !parse_args_1.options.inline
|
|
184
|
-
? config_1.readConfig(environment, parse_args_1.options.config)
|
|
185
|
-
: {};
|
|
186
|
-
const params = deepmerge_1.default(config.params, parse_args_1.options.params || {});
|
|
187
|
-
/**
|
|
188
|
-
* Favor playwright options passed via cli to inline playwright options
|
|
189
|
-
*/
|
|
190
|
-
const playwrightOptions = deepmerge_1.default.all([
|
|
191
|
-
config.playwrightOptions || {},
|
|
192
|
-
parse_args_1.options.playwrightOptions || {},
|
|
193
|
-
{
|
|
194
|
-
headless: parse_args_1.options.headless,
|
|
195
|
-
chromiumSandbox: parse_args_1.options.sandbox,
|
|
196
|
-
ignoreHTTPSErrors: parse_args_1.options.ignoreHttpsErrors,
|
|
197
|
-
},
|
|
198
|
-
]);
|
|
199
|
-
const results = await _1.run({
|
|
200
|
-
params: Object.freeze(params),
|
|
201
|
-
networkConditions: parse_args_1.options.throttling
|
|
202
|
-
? helpers_1.parseNetworkConditions(parse_args_1.options.throttling)
|
|
203
|
-
: undefined,
|
|
204
|
-
environment,
|
|
205
|
-
playwrightOptions,
|
|
206
|
-
...parse_args_1.options,
|
|
207
|
-
});
|
|
208
|
-
if (!parse_args_1.options.quietExitCode) {
|
|
209
|
-
/**
|
|
210
|
-
* Exit with error status if any journey fails
|
|
211
|
-
*/
|
|
212
|
-
for (const result of Object.values(results)) {
|
|
213
|
-
if (result.status === 'failed') {
|
|
214
|
-
process.exit(1);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
console.error(e);
|
|
83
|
+
process.exit(1);
|
|
217
84
|
}
|
|
218
|
-
})().catch(e => {
|
|
219
|
-
console.error(e);
|
|
220
|
-
process.exit(1);
|
|
221
85
|
});
|
|
86
|
+
commander_1.program
|
|
87
|
+
.command('push')
|
|
88
|
+
.description('Push monitors to create new montors with Kibana monitor management UI')
|
|
89
|
+
.action(() => {
|
|
90
|
+
throw new Error('TODO: Implement me');
|
|
91
|
+
});
|
|
92
|
+
commander_1.program.parse(process.argv);
|
|
222
93
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;AAEH,yCAA4C;AAE5C,2CAAwC;AACxC,uCAA2D;AAC3D,uCAA6C;AAC7C,qCAAyC;AACzC,yBAAyB;AAEzB,iEAAiE;AACjE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAErD,mBAAO;KACJ,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;KACnB,KAAK,CAAC,8BAA8B,CAAC;KACrC,MAAM,CACL,qBAAqB,EACrB,oDAAoD,CACrD;KACA,MAAM,CACL,2BAA2B,EAC3B,gDAAgD,EAChD,IAAI,CAAC,KAAK,CACX;KACA,SAAS,CACR,IAAI,kBAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC,OAAO,CAC/D,MAAM,CAAC,IAAI,CAAC,qBAAS,CAAC,CACvB,CACF;KACA,MAAM,CACL,qBAAqB,EACrB,iDAAiD,CAClD;KACA,MAAM,CAAC,UAAU,EAAE,oCAAoC,CAA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AO,GAAG,MAAM,IAAA,MAAG,EAAC,OAAO,CAAC,CAAC;QACnC;;WAEG;QACH,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC1B,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;gBAC3C,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;oBAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACjB;aACF;SACF;KACF;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAC,CAAC;AAEL,mBAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CACV,uEAAuE,CACxE;KACA,MAAM,CAAC,GAAG,EAAE;IACX,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC;AAEL,mBAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/common_types.d.ts
CHANGED
|
@@ -23,17 +23,16 @@
|
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
25
|
import { BrowserContextOptions, LaunchOptions, CDPSession, ChromiumBrowser, ChromiumBrowserContext, Page } from 'playwright-chromium';
|
|
26
|
-
import { Protocol } from 'playwright-
|
|
26
|
+
import { Protocol } from 'playwright-core/types/protocol';
|
|
27
27
|
import { Step } from './dsl';
|
|
28
|
-
import { reporters } from './reporters';
|
|
28
|
+
import { Reporter, reporters } from './reporters';
|
|
29
29
|
export declare type VoidCallback = () => void;
|
|
30
|
-
export declare type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
uploadThroughput: number;
|
|
35
|
-
latency: number;
|
|
30
|
+
export declare type Location = {
|
|
31
|
+
file: string;
|
|
32
|
+
line: number;
|
|
33
|
+
column: number;
|
|
36
34
|
};
|
|
35
|
+
export declare type Params = Record<string, any>;
|
|
37
36
|
export declare type HooksArgs = {
|
|
38
37
|
env: string;
|
|
39
38
|
params: Params;
|
|
@@ -41,6 +40,12 @@ export declare type HooksArgs = {
|
|
|
41
40
|
export declare type HooksCallback = (args: HooksArgs) => void;
|
|
42
41
|
export declare type StatusValue = 'succeeded' | 'failed' | 'skipped';
|
|
43
42
|
export declare type Reporters = keyof typeof reporters;
|
|
43
|
+
export declare type NetworkConditions = {
|
|
44
|
+
offline: boolean;
|
|
45
|
+
downloadThroughput: number;
|
|
46
|
+
uploadThroughput: number;
|
|
47
|
+
latency: number;
|
|
48
|
+
};
|
|
44
49
|
export declare type Driver = {
|
|
45
50
|
browser: ChromiumBrowser;
|
|
46
51
|
context: ChromiumBrowserContext;
|
|
@@ -82,18 +87,53 @@ export declare type Screenshot = {
|
|
|
82
87
|
step: Step;
|
|
83
88
|
data: string;
|
|
84
89
|
};
|
|
90
|
+
export declare type SecurityDetails = {
|
|
91
|
+
issuer?: string;
|
|
92
|
+
protocol?: string;
|
|
93
|
+
subjectName?: string;
|
|
94
|
+
validFrom?: number;
|
|
95
|
+
validTo?: number;
|
|
96
|
+
};
|
|
97
|
+
export declare type Request = {
|
|
98
|
+
method: string;
|
|
99
|
+
url: string;
|
|
100
|
+
headers: Record<string, string>;
|
|
101
|
+
bytes?: number;
|
|
102
|
+
body?: {
|
|
103
|
+
bytes: number;
|
|
104
|
+
};
|
|
105
|
+
referrer?: string;
|
|
106
|
+
};
|
|
107
|
+
export declare type Response = {
|
|
108
|
+
url?: string;
|
|
109
|
+
protocol?: string;
|
|
110
|
+
status: number;
|
|
111
|
+
statusText?: string;
|
|
112
|
+
mimeType: string;
|
|
113
|
+
httpVersion?: string;
|
|
114
|
+
headers: Record<string, string>;
|
|
115
|
+
bytes?: number;
|
|
116
|
+
body?: {
|
|
117
|
+
bytes: number;
|
|
118
|
+
};
|
|
119
|
+
transferSize?: number;
|
|
120
|
+
redirectURL?: string;
|
|
121
|
+
securityDetails?: SecurityDetails;
|
|
122
|
+
remoteIPAddress?: string;
|
|
123
|
+
remotePort?: number;
|
|
124
|
+
fromServiceWorker?: boolean;
|
|
125
|
+
timing?: Protocol.Network.ResourceTiming;
|
|
126
|
+
};
|
|
85
127
|
export declare type NetworkInfo = {
|
|
86
128
|
url: string;
|
|
87
129
|
browser: BrowserInfo;
|
|
88
|
-
method: string;
|
|
89
130
|
type: string;
|
|
90
|
-
request:
|
|
91
|
-
response?:
|
|
131
|
+
request: Request;
|
|
132
|
+
response?: Response;
|
|
92
133
|
isNavigationRequest: boolean;
|
|
93
134
|
requestSentTime: number;
|
|
94
135
|
loadEndTime: number;
|
|
95
136
|
responseReceivedTime: number;
|
|
96
|
-
status: number;
|
|
97
137
|
resourceSize: number;
|
|
98
138
|
transferSize: number;
|
|
99
139
|
timings?: {
|
|
@@ -122,34 +162,42 @@ export declare type PluginOutput = {
|
|
|
122
162
|
metrics?: PerfMetrics;
|
|
123
163
|
};
|
|
124
164
|
export declare type ScreenshotOptions = 'on' | 'off' | 'only-on-failure';
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
config?: string;
|
|
128
|
-
outfd?: number;
|
|
129
|
-
headless?: boolean;
|
|
165
|
+
declare type BaseArgs = {
|
|
166
|
+
params?: Params;
|
|
130
167
|
screenshots?: ScreenshotOptions;
|
|
131
|
-
ssblocks?: boolean;
|
|
132
|
-
metrics?: boolean;
|
|
133
|
-
filmstrips?: boolean;
|
|
134
|
-
trace?: boolean;
|
|
135
168
|
dryRun?: boolean;
|
|
136
|
-
|
|
169
|
+
match?: string;
|
|
170
|
+
tags?: Array<string>;
|
|
171
|
+
outfd?: number;
|
|
172
|
+
wsEndpoint?: string;
|
|
137
173
|
pauseOnError?: boolean;
|
|
174
|
+
ignoreHttpsErrors?: boolean;
|
|
175
|
+
playwrightOptions?: PlaywrightOptions;
|
|
138
176
|
quietExitCode?: boolean;
|
|
177
|
+
};
|
|
178
|
+
export declare type CliArgs = BaseArgs & {
|
|
179
|
+
config?: string;
|
|
139
180
|
reporter?: Reporters;
|
|
140
|
-
wsEndpoint?: string;
|
|
141
|
-
sandbox?: boolean;
|
|
142
181
|
pattern?: string;
|
|
143
|
-
inline
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
182
|
+
inline?: boolean;
|
|
183
|
+
require?: Array<string>;
|
|
184
|
+
headless?: boolean;
|
|
185
|
+
sandbox?: boolean;
|
|
186
|
+
richEvents?: boolean;
|
|
187
|
+
capability?: Array<string>;
|
|
148
188
|
ignoreHttpsErrors?: boolean;
|
|
149
|
-
params?: Params;
|
|
150
189
|
throttling?: boolean | string;
|
|
151
|
-
|
|
152
|
-
|
|
190
|
+
};
|
|
191
|
+
export declare type RunOptions = BaseArgs & {
|
|
192
|
+
metrics?: boolean;
|
|
193
|
+
ssblocks?: boolean;
|
|
194
|
+
network?: boolean;
|
|
195
|
+
trace?: boolean;
|
|
196
|
+
filmstrips?: boolean;
|
|
197
|
+
environment?: string;
|
|
198
|
+
playwrightOptions?: PlaywrightOptions;
|
|
199
|
+
networkConditions?: NetworkConditions;
|
|
200
|
+
reporter?: CliArgs['reporter'] | Reporter;
|
|
153
201
|
};
|
|
154
202
|
export declare type PlaywrightOptions = LaunchOptions & BrowserContextOptions;
|
|
155
203
|
export declare type SyntheticsConfig = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common_types.d.ts","sourceRoot":"","sources":["../src/common_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,IAAI,EACL,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"common_types.d.ts","sourceRoot":"","sources":["../src/common_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;G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ath(configPath, cwd) {
|
|
56
|
-
const absolutePath = path_1.isAbsolute(configPath)
|
|
56
|
+
const absolutePath = (0, path_1.isAbsolute)(configPath)
|
|
57
57
|
? configPath
|
|
58
|
-
: path_1.resolve(cwd, configPath);
|
|
59
|
-
if (helpers_1.isFile(absolutePath)) {
|
|
58
|
+
: (0, path_1.resolve)(cwd, configPath);
|
|
59
|
+
if ((0, helpers_1.isFile)(absolutePath)) {
|
|
60
60
|
return absolutePath;
|
|
61
61
|
}
|
|
62
62
|
throw new Error('Synthetics config file does not exist: ' + absolutePath);
|
|
@@ -79,12 +79,12 @@ function getConfigFile(ext) {
|
|
|
79
79
|
}
|
|
80
80
|
function findSyntheticsConfig(resolvePath, cwd) {
|
|
81
81
|
const configPath = ['.js', '.ts']
|
|
82
|
-
.map(ext => path_1.resolve(resolvePath, getConfigFile(ext)))
|
|
82
|
+
.map(ext => (0, path_1.resolve)(resolvePath, getConfigFile(ext)))
|
|
83
83
|
.find(helpers_1.isFile);
|
|
84
84
|
if (configPath) {
|
|
85
85
|
return configPath;
|
|
86
86
|
}
|
|
87
|
-
const parentDirectory = path_1.dirname(resolvePath);
|
|
87
|
+
const parentDirectory = (0, path_1.dirname)(resolvePath);
|
|
88
88
|
/**
|
|
89
89
|
* We are in the system root, so return empty path and fallback
|
|
90
90
|
* to empty suite params
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,+BAAoD;AAEpD,uCAAmC;AAEnC,SAAgB,UAAU,CAAC,GAAW,EAAE,MAAe;IACrD,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B;;;OAGG;IACH,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,UAAU,GAAG,iBAAiB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C,WAAW,CAAC,CAAC;IAC7C;;;OAGG;IACH,IAAI,WAAW,KAAK,eAAe,EAAE;QACnC,OAAO,EAAE,CAAC;KACX;IACD,OAAO,oBAAoB,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -34,16 +34,16 @@ class BrowserService {
|
|
|
34
34
|
constructor(options = { port: 9322 }) {
|
|
35
35
|
this.options = options;
|
|
36
36
|
this.closeCallbacks = [];
|
|
37
|
-
this.proxyServer = http_1.createServer();
|
|
37
|
+
this.proxyServer = (0, http_1.createServer)();
|
|
38
38
|
}
|
|
39
39
|
init() {
|
|
40
|
-
const proxy = http_proxy_1.createProxyServer();
|
|
40
|
+
const proxy = (0, http_proxy_1.createProxyServer)();
|
|
41
41
|
this.proxyServer.on('upgrade', async (req, socket, head) => {
|
|
42
42
|
const browserServer = await playwright_chromium_1.chromium.launchServer({ headless: true });
|
|
43
43
|
const wsEndpoint = browserServer.wsEndpoint();
|
|
44
44
|
const { pathname, origin } = new url_1.URL(wsEndpoint);
|
|
45
45
|
req.url = pathname;
|
|
46
|
-
logger_1.log(`New browser: ${wsEndpoint}`);
|
|
46
|
+
(0, logger_1.log)(`New browser: ${wsEndpoint}`);
|
|
47
47
|
proxy.ws(req, socket, head, { target: origin });
|
|
48
48
|
const closeBrowser = async () => {
|
|
49
49
|
const index = this.closeCallbacks.indexOf(closeBrowser);
|
|
@@ -51,14 +51,14 @@ class BrowserService {
|
|
|
51
51
|
this.closeCallbacks.splice(index, 1);
|
|
52
52
|
}
|
|
53
53
|
await browserServer.close();
|
|
54
|
-
logger_1.log(`Socket closed: ${wsEndpoint}`);
|
|
54
|
+
(0, logger_1.log)(`Socket closed: ${wsEndpoint}`);
|
|
55
55
|
};
|
|
56
56
|
this.closeCallbacks.push(closeBrowser);
|
|
57
57
|
socket.on('close', closeBrowser);
|
|
58
58
|
socket.on('error', closeBrowser);
|
|
59
59
|
});
|
|
60
60
|
this.proxyServer.listen(this.options.port, () => {
|
|
61
|
-
logger_1.log(`Listening on port: ${this.options.port}`);
|
|
61
|
+
(0, logger_1.log)(`Listening on port: ${this.options.port}`);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
async dispose() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-service.js","sourceRoot":"","sources":["../../src/core/browser-service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6BAA0B;AAC1B,+BAAoC;AACpC,2CAA+C;AAC/C,6DAA+C;AAC/C,qCAA+B;AAE/B,MAAa,cAAc;IAIzB,YAAoB,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAH5C,mBAAc,GAAG,EAAE,CAAC;QACpB,gBAAW,GAAG,mBAAY,
|
|
1
|
+
{"version":3,"file":"browser-service.js","sourceRoot":"","sources":["../../src/core/browser-service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6BAA0B;AAC1B,+BAAoC;AACpC,2CAA+C;AAC/C,6DAA+C;AAC/C,qCAA+B;AAE/B,MAAa,cAAc;IAIzB,YAAoB,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAH5C,mBAAc,GAAG,EAAE,CAAC;QACpB,gBAAW,GAAG,IAAA,mBAAY,GAAE,CAAC;IAEkB,CAAC;IAEhD,IAAI;QACF,MAAM,KAAK,GAAG,IAAA,8BAAiB,GAAE,CAAC;QAElC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;YACzD,MAAM,aAAa,GAAG,MAAM,8BAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YACtE,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,EAAE,CAA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,cAAc,CAAC,CAAC,CAAC,CAAC;YACxC,MAAM,QAAQ,EAAE,CAAC;SAClB;QACD,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QAEzB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7CD,wCA6CC"}
|
package/dist/core/gatherer.d.ts
CHANGED
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { ChromiumBrowser, BrowserContext } from 'playwright-chromium';
|
|
26
26
|
import { PluginManager } from '../plugins';
|
|
27
|
-
import { RunOptions } from '
|
|
28
|
-
import { Driver } from '../common_types';
|
|
27
|
+
import { Driver, RunOptions } from '../common_types';
|
|
29
28
|
/**
|
|
30
29
|
* Purpose of the Gatherer is to set up the necessary browser driver
|
|
31
30
|
* related capabilities for the runner to run all journeys
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatherer.d.ts","sourceRoot":"","sources":["../../src/core/gatherer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAY,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"gatherer.d.ts","sourceRoot":"","sources":["../../src/core/gatherer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAY,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;GAGG;AACH,qBAAa,QAAQ;IACnB,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC;WAEnB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;WA6BjD,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM;WAS/B,oBAAoB,CAC/B,OAAO,EAAE,cAAc,EACvB,iBAAiB,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAcpD;;;OAGG;WACU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;WAYlD,OAAO,CAAC,MAAM,EAAE,MAAM;WAItB,IAAI;CAMlB"}
|