@elastic/synthetics 1.0.0-beta.2 → 1.0.0-beta.20
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 +228 -0
- package/NOTICE.txt +250 -0
- package/README.md +2 -1
- package/dist/cli.js +80 -49
- package/dist/cli.js.map +1 -1
- package/dist/common_types.d.ts +77 -10
- package/dist/common_types.d.ts.map +1 -1
- package/dist/config.d.ts +2 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/core/expect.d.ts +177 -0
- package/dist/core/expect.d.ts.map +1 -0
- package/dist/core/expect.js +33 -0
- package/dist/core/expect.js.map +1 -0
- package/dist/core/gatherer.d.ts +4 -7
- package/dist/core/gatherer.d.ts.map +1 -1
- package/dist/core/gatherer.js +33 -9
- package/dist/core/gatherer.js.map +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/logger.d.ts +0 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -15
- package/dist/core/logger.js.map +1 -1
- package/dist/core/runner.d.ts +54 -45
- package/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +173 -63
- package/dist/core/runner.js.map +1 -1
- package/dist/dsl/journey.d.ts +13 -4
- package/dist/dsl/journey.d.ts.map +1 -1
- package/dist/dsl/journey.js +40 -1
- package/dist/dsl/journey.js.map +1 -1
- package/dist/formatter/javascript.d.ts +73 -0
- package/dist/formatter/javascript.d.ts.map +1 -0
- package/dist/formatter/javascript.js +274 -0
- package/dist/formatter/javascript.js.map +1 -0
- package/dist/helpers.d.ts +33 -12
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +100 -46
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/parse_args.d.ts +5 -2
- package/dist/parse_args.d.ts.map +1 -1
- package/dist/parse_args.js +59 -16
- package/dist/parse_args.js.map +1 -1
- package/dist/plugins/browser-console.d.ts +5 -8
- package/dist/plugins/browser-console.d.ts.map +1 -1
- package/dist/plugins/browser-console.js +26 -7
- package/dist/plugins/browser-console.js.map +1 -1
- package/dist/plugins/network.d.ts +20 -20
- package/dist/plugins/network.d.ts.map +1 -1
- package/dist/plugins/network.js +110 -108
- package/dist/plugins/network.js.map +1 -1
- package/dist/plugins/performance.d.ts +5 -5
- package/dist/plugins/performance.d.ts.map +1 -1
- package/dist/plugins/performance.js +5 -5
- package/dist/plugins/performance.js.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +11 -11
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +40 -24
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/plugins/tracing.d.ts +10 -25
- package/dist/plugins/tracing.d.ts.map +1 -1
- package/dist/plugins/tracing.js +40 -26
- package/dist/plugins/tracing.js.map +1 -1
- package/dist/reporters/base.d.ts +0 -1
- package/dist/reporters/base.d.ts.map +1 -1
- package/dist/reporters/base.js +22 -23
- package/dist/reporters/base.js.map +1 -1
- package/dist/reporters/json.d.ts +43 -7
- package/dist/reporters/json.d.ts.map +1 -1
- package/dist/reporters/json.js +181 -35
- package/dist/reporters/json.js.map +1 -1
- package/dist/sdk/lh-trace-processor.d.ts +304 -0
- package/dist/sdk/lh-trace-processor.d.ts.map +1 -0
- package/dist/sdk/lh-trace-processor.js +832 -0
- package/dist/sdk/lh-trace-processor.js.map +1 -0
- package/dist/sdk/trace-metrics.d.ts +61 -0
- package/dist/sdk/trace-metrics.d.ts.map +1 -0
- package/dist/sdk/trace-metrics.js +252 -0
- package/dist/sdk/trace-metrics.js.map +1 -0
- package/dist/sdk/trace-processor.d.ts +106 -0
- package/dist/sdk/trace-processor.d.ts.map +1 -0
- package/dist/sdk/trace-processor.js +74 -0
- package/dist/sdk/trace-processor.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1575
- package/package.json +24 -13
- package/src/cli.ts +68 -45
- package/src/common_types.ts +92 -10
- package/src/config.ts +2 -5
- package/src/core/expect.ts +187 -0
- package/src/core/gatherer.ts +44 -23
- package/src/core/index.ts +6 -6
- package/src/core/logger.ts +1 -12
- package/src/core/runner.ts +259 -112
- package/src/dsl/journey.ts +28 -6
- package/src/formatter/javascript.ts +330 -0
- package/src/helpers.ts +114 -24
- package/src/index.ts +7 -6
- package/src/parse_args.ts +97 -22
- package/src/plugins/browser-console.ts +30 -13
- package/src/plugins/network.ts +137 -144
- package/src/plugins/performance.ts +7 -7
- package/src/plugins/plugin-manager.ts +47 -36
- package/src/plugins/tracing.ts +43 -54
- package/src/reporters/base.ts +24 -23
- package/src/reporters/json.ts +251 -41
- package/src/sdk/lh-trace-processor.ts +1033 -0
- package/src/sdk/trace-metrics.ts +287 -0
- package/src/sdk/trace-processor.ts +147 -0
package/dist/cli.js
CHANGED
|
@@ -24,32 +24,52 @@
|
|
|
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
|
+
};
|
|
27
46
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
48
|
};
|
|
30
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
50
|
const process_1 = require("process");
|
|
32
51
|
const path_1 = require("path");
|
|
52
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
33
53
|
const core_1 = require("./core");
|
|
34
54
|
const logger_1 = require("./core/logger");
|
|
35
|
-
const parse_args_1 =
|
|
55
|
+
const parse_args_1 = __importStar(require("./parse_args"));
|
|
56
|
+
const expect_1 = require("./core/expect");
|
|
36
57
|
const helpers_1 = require("./helpers");
|
|
37
58
|
const _1 = require("./");
|
|
38
59
|
const config_1 = require("./config");
|
|
39
|
-
const options = parse_args_1.default.opts();
|
|
40
60
|
const resolvedCwd = process_1.cwd();
|
|
41
61
|
/**
|
|
42
62
|
* Set debug based on DEBUG ENV and -d flags
|
|
43
63
|
* namespace - synthetics
|
|
44
64
|
*/
|
|
45
65
|
const namespace = 'synthetics';
|
|
46
|
-
if (process.env.DEBUG === namespace || Boolean(options.debug)) {
|
|
66
|
+
if (process.env.DEBUG === namespace || Boolean(parse_args_1.options.debug)) {
|
|
47
67
|
process.env.DEBUG = '1';
|
|
48
68
|
}
|
|
49
69
|
const loadInlineScript = source => {
|
|
50
|
-
const scriptFn = new Function('step', 'page', 'browser', 'params', source);
|
|
51
|
-
core_1.journey('inline',
|
|
52
|
-
scriptFn.apply(null, [core_1.step, page, browser, params]);
|
|
70
|
+
const scriptFn = new Function('step', 'page', 'context', 'browser', 'params', 'expect', source);
|
|
71
|
+
core_1.journey('inline', ({ page, context, browser, params }) => {
|
|
72
|
+
scriptFn.apply(null, [core_1.step, page, context, browser, params, expect_1.expect]);
|
|
53
73
|
});
|
|
54
74
|
};
|
|
55
75
|
async function readStdin() {
|
|
@@ -80,8 +100,8 @@ async function prepareSuites(inputs) {
|
|
|
80
100
|
* Match all files inside the directory with the
|
|
81
101
|
* .journey.{mjs|cjs|js|ts) extensions
|
|
82
102
|
*/
|
|
83
|
-
const pattern = options.pattern
|
|
84
|
-
? new RegExp(options.pattern, 'i')
|
|
103
|
+
const pattern = parse_args_1.options.pattern
|
|
104
|
+
? new RegExp(parse_args_1.options.pattern, 'i')
|
|
85
105
|
: /.+\.journey\.([mc]js|[jt]s?)$/;
|
|
86
106
|
/**
|
|
87
107
|
* Ignore node_modules by default when running suites
|
|
@@ -94,7 +114,7 @@ async function prepareSuites(inputs) {
|
|
|
94
114
|
* the suites
|
|
95
115
|
*/
|
|
96
116
|
helpers_1.findPkgJsonByTraversing(absPath, resolvedCwd);
|
|
97
|
-
if (
|
|
117
|
+
if (helpers_1.isDirectory(absPath)) {
|
|
98
118
|
await helpers_1.totalist(absPath, (rel, abs) => {
|
|
99
119
|
if (pattern.test(rel) && !ignored.test(rel)) {
|
|
100
120
|
addSuite(abs);
|
|
@@ -108,7 +128,25 @@ async function prepareSuites(inputs) {
|
|
|
108
128
|
return suites.values();
|
|
109
129
|
}
|
|
110
130
|
(async () => {
|
|
111
|
-
|
|
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) {
|
|
112
150
|
const source = await readStdin();
|
|
113
151
|
loadInlineScript(source);
|
|
114
152
|
}
|
|
@@ -116,7 +154,7 @@ async function prepareSuites(inputs) {
|
|
|
116
154
|
/**
|
|
117
155
|
* Preload modules before running the suites
|
|
118
156
|
*/
|
|
119
|
-
const modules = [].concat(options.require || []).filter(Boolean);
|
|
157
|
+
const modules = [].concat(parse_args_1.options.require || []).filter(Boolean);
|
|
120
158
|
for (const name of modules) {
|
|
121
159
|
if (helpers_1.isDepInstalled(name)) {
|
|
122
160
|
require(name);
|
|
@@ -125,20 +163,6 @@ async function prepareSuites(inputs) {
|
|
|
125
163
|
throw new Error(`cannot find module '${name}'`);
|
|
126
164
|
}
|
|
127
165
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Transform `.ts` files out of the box by invoking
|
|
130
|
-
* the `ts-node` via `transpile-only` mode that compiles
|
|
131
|
-
* TS files without doing any extensive type checks
|
|
132
|
-
*/
|
|
133
|
-
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
|
|
134
|
-
require('ts-node').register({
|
|
135
|
-
transpileOnly: true,
|
|
136
|
-
compilerOptions: {
|
|
137
|
-
esModuleInterop: true,
|
|
138
|
-
allowJs: true,
|
|
139
|
-
target: 'es2018',
|
|
140
|
-
},
|
|
141
|
-
});
|
|
142
166
|
/**
|
|
143
167
|
* Handle piped files by reading the STDIN
|
|
144
168
|
* ex: ls example/suites/*.js | npx @elastic/synthetics
|
|
@@ -150,38 +174,45 @@ async function prepareSuites(inputs) {
|
|
|
150
174
|
requireSuites(suites);
|
|
151
175
|
}
|
|
152
176
|
/**
|
|
153
|
-
* Use the NODE_ENV variable to control the environment
|
|
154
|
-
* passed from either CLI or through the API
|
|
177
|
+
* Use the NODE_ENV variable to control the environment
|
|
155
178
|
*/
|
|
156
|
-
const environment =
|
|
179
|
+
const environment = process.env['NODE_ENV'] || 'development';
|
|
157
180
|
/**
|
|
158
181
|
* Validate and handle configs
|
|
159
182
|
*/
|
|
160
|
-
const config =
|
|
161
|
-
|
|
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 || {});
|
|
162
187
|
/**
|
|
163
|
-
*
|
|
188
|
+
* Favor playwright options passed via cli to inline playwright options
|
|
164
189
|
*/
|
|
165
|
-
const
|
|
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
|
+
]);
|
|
166
199
|
const results = await _1.run({
|
|
167
|
-
params: Object.freeze(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
pauseOnError: options.pauseOnError,
|
|
175
|
-
outfd: options.outfd,
|
|
176
|
-
metrics: options.metrics,
|
|
177
|
-
sandbox: options.sandbox,
|
|
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,
|
|
178
207
|
});
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
+
}
|
|
185
216
|
}
|
|
186
217
|
}
|
|
187
218
|
})().catch(e => {
|
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,qCAAqC;AACrC,+BAA+B;AAC/B,0DAA8B;AAC9B,iCAAuC;AACvC,0CAAoC;AACpC,2DAAgD;AAChD,0CAAuC;AACvC,uCAMmB;AACnB,yBAAyB;AACzB,qCAAsC;AAEtC,MAAM,WAAW,GAAG,aAAG,EAAE,CAAC;AAC1B;;;GAGG;AACH,MAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,oBAAO,CAAC,KAAK,CAAC,EAAE;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC;CACzB;AAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE;IAChC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAC3B,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,CACP,CAAC;IACF,cAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QACvD,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,E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AM,CAAC,OAAO,CAAC,EAAE;YAC3C,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;gBAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;SACF;KACF;AACH,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACb,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/common_types.d.ts
CHANGED
|
@@ -22,16 +22,52 @@
|
|
|
22
22
|
* THE SOFTWARE.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
+
import { BrowserContextOptions, LaunchOptions, CDPSession, ChromiumBrowser, ChromiumBrowserContext, Page } from 'playwright-chromium';
|
|
25
26
|
import { Protocol } from 'playwright-chromium/types/protocol';
|
|
26
27
|
import { Step } from './dsl';
|
|
27
28
|
import { reporters } from './reporters';
|
|
28
29
|
export declare type VoidCallback = () => void;
|
|
30
|
+
export declare type Params = Record<string, any>;
|
|
31
|
+
export declare type NetworkConditions = {
|
|
32
|
+
offline: boolean;
|
|
33
|
+
downloadThroughput: number;
|
|
34
|
+
uploadThroughput: number;
|
|
35
|
+
latency: number;
|
|
36
|
+
};
|
|
37
|
+
export declare type HooksArgs = {
|
|
38
|
+
env: string;
|
|
39
|
+
params: Params;
|
|
40
|
+
};
|
|
41
|
+
export declare type HooksCallback = (args: HooksArgs) => void;
|
|
29
42
|
export declare type StatusValue = 'succeeded' | 'failed' | 'skipped';
|
|
30
43
|
export declare type Reporters = keyof typeof reporters;
|
|
31
|
-
export declare type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
export declare type Driver = {
|
|
45
|
+
browser: ChromiumBrowser;
|
|
46
|
+
context: ChromiumBrowserContext;
|
|
47
|
+
page: Page;
|
|
48
|
+
client: CDPSession;
|
|
49
|
+
};
|
|
50
|
+
export declare type TraceOutput = {
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
start: MetricDuration;
|
|
54
|
+
duration?: MetricDuration;
|
|
55
|
+
score?: number;
|
|
56
|
+
};
|
|
57
|
+
declare type MetricDuration = {
|
|
58
|
+
us: number;
|
|
59
|
+
};
|
|
60
|
+
export declare type PerfMetrics = {
|
|
61
|
+
fcp: MetricDuration;
|
|
62
|
+
lcp: MetricDuration;
|
|
63
|
+
dcl: MetricDuration;
|
|
64
|
+
load: MetricDuration;
|
|
65
|
+
cls: number;
|
|
66
|
+
};
|
|
67
|
+
export declare type Filmstrip = {
|
|
68
|
+
start: MetricDuration;
|
|
69
|
+
blob: string;
|
|
70
|
+
mime: string;
|
|
35
71
|
};
|
|
36
72
|
export declare type DefaultPluginOutput = {
|
|
37
73
|
step?: Partial<Step>;
|
|
@@ -41,6 +77,11 @@ export declare type BrowserInfo = {
|
|
|
41
77
|
name: string;
|
|
42
78
|
version: string;
|
|
43
79
|
};
|
|
80
|
+
export declare type Screenshot = {
|
|
81
|
+
timestamp: number;
|
|
82
|
+
step: Step;
|
|
83
|
+
data: string;
|
|
84
|
+
};
|
|
44
85
|
export declare type NetworkInfo = {
|
|
45
86
|
url: string;
|
|
46
87
|
browser: BrowserInfo;
|
|
@@ -68,26 +109,52 @@ export declare type NetworkInfo = {
|
|
|
68
109
|
total: number;
|
|
69
110
|
};
|
|
70
111
|
} & DefaultPluginOutput;
|
|
112
|
+
export declare type BrowserMessage = {
|
|
113
|
+
text: string;
|
|
114
|
+
type: string;
|
|
115
|
+
error?: Error;
|
|
116
|
+
} & DefaultPluginOutput;
|
|
117
|
+
export declare type PluginOutput = {
|
|
118
|
+
filmstrips?: Array<Filmstrip>;
|
|
119
|
+
networkinfo?: Array<NetworkInfo>;
|
|
120
|
+
browserconsole?: Array<BrowserMessage>;
|
|
121
|
+
traces?: Array<TraceOutput>;
|
|
122
|
+
metrics?: PerfMetrics;
|
|
123
|
+
};
|
|
124
|
+
export declare type ScreenshotOptions = 'on' | 'off' | 'only-on-failure';
|
|
71
125
|
export declare type CliArgs = {
|
|
126
|
+
capability?: Array<string>;
|
|
72
127
|
config?: string;
|
|
73
|
-
environment?: string;
|
|
74
128
|
outfd?: number;
|
|
75
129
|
headless?: boolean;
|
|
76
|
-
screenshots?:
|
|
130
|
+
screenshots?: ScreenshotOptions;
|
|
131
|
+
ssblocks?: boolean;
|
|
77
132
|
metrics?: boolean;
|
|
78
133
|
filmstrips?: boolean;
|
|
134
|
+
trace?: boolean;
|
|
79
135
|
dryRun?: boolean;
|
|
80
|
-
journeyName?: string;
|
|
81
136
|
network?: boolean;
|
|
82
137
|
pauseOnError?: boolean;
|
|
138
|
+
quietExitCode?: boolean;
|
|
83
139
|
reporter?: Reporters;
|
|
84
140
|
wsEndpoint?: string;
|
|
85
141
|
sandbox?: boolean;
|
|
86
|
-
json?: boolean;
|
|
87
142
|
pattern?: string;
|
|
88
143
|
inline: boolean;
|
|
89
|
-
|
|
144
|
+
match?: string;
|
|
145
|
+
tags?: Array<string>;
|
|
146
|
+
require: Array<string>;
|
|
90
147
|
debug?: boolean;
|
|
91
|
-
|
|
148
|
+
ignoreHttpsErrors?: boolean;
|
|
149
|
+
params?: Params;
|
|
150
|
+
throttling?: boolean | string;
|
|
151
|
+
playwrightOptions?: LaunchOptions & BrowserContextOptions;
|
|
152
|
+
richEvents?: boolean;
|
|
153
|
+
};
|
|
154
|
+
export declare type PlaywrightOptions = LaunchOptions & BrowserContextOptions;
|
|
155
|
+
export declare type SyntheticsConfig = {
|
|
156
|
+
params?: Params;
|
|
157
|
+
playwrightOptions?: PlaywrightOptions;
|
|
92
158
|
};
|
|
159
|
+
export {};
|
|
93
160
|
//# sourceMappingURL=common_types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common_types.d.ts","sourceRoot":"","sources":["../src/common_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,E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C"}
|
package/dist/config.d.ts
CHANGED
|
@@ -22,9 +22,6 @@
|
|
|
22
22
|
* THE SOFTWARE.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
export declare function readConfig(env: string, config?: string): Config;
|
|
29
|
-
export {};
|
|
25
|
+
import { SyntheticsConfig } from './common_types';
|
|
26
|
+
export declare function readConfig(env: string, config?: string): SyntheticsConfig;
|
|
30
27
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAsBzE"}
|
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;
|
|
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,KAA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AAS,aAAa,CAAC,GAAW;IAChC,OAAO,mBAAmB,GAAG,GAAG,CAAC;AACnC,CAAC;AAED,SAAS,oBAAoB,CAAC,WAAW,EAAE,GAAG;IAC5C,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC;SAC9B,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,cAAO,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;SACpD,IAAI,CAAC,gBAAM,CAAC,CAAC;IAChB,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAC;KACnB;IACD,MAAM,eAAe,GAAG,cAAO,CAAC,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"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020-present, Elastic NV
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
|
14
|
+
* all copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
* THE SOFTWARE.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
import type { AsymmetricMatcher, MatcherState, ExpectedAssertionsErrors } from 'expect/build/types';
|
|
26
|
+
export declare type Expect = {
|
|
27
|
+
<T = unknown>(actual: T): synthetics.Matchers<T>;
|
|
28
|
+
assertions(arg0: number): void;
|
|
29
|
+
extend(arg0: any): void;
|
|
30
|
+
extractExpectedAssertionsErrors: () => ExpectedAssertionsErrors;
|
|
31
|
+
getState(): MatcherState;
|
|
32
|
+
hasAssertions(): void;
|
|
33
|
+
setState(state: Partial<MatcherState>): void;
|
|
34
|
+
any(expectedObject: any): AsymmetricMatcher;
|
|
35
|
+
anything(): AsymmetricMatcher;
|
|
36
|
+
arrayContaining(sample: Array<unknown>): AsymmetricMatcher;
|
|
37
|
+
objectContaining(sample: Record<string, unknown>): AsymmetricMatcher;
|
|
38
|
+
stringContaining(expected: string): AsymmetricMatcher;
|
|
39
|
+
stringMatching(expected: string | RegExp): AsymmetricMatcher;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Override matchers from expect in our synthetic namespace to
|
|
43
|
+
* reduce support for spy and snapshot matchers which is
|
|
44
|
+
* impelemed via jest matchers
|
|
45
|
+
*
|
|
46
|
+
* We declare the types in global synthetics namespace which allows
|
|
47
|
+
* users to extend expect functionality without type errors
|
|
48
|
+
*/
|
|
49
|
+
declare global {
|
|
50
|
+
export namespace synthetics {
|
|
51
|
+
interface Matchers<R> {
|
|
52
|
+
/**
|
|
53
|
+
* If you know how to test something, `.not` lets you test its opposite.
|
|
54
|
+
*/
|
|
55
|
+
not: Matchers<R>;
|
|
56
|
+
/**
|
|
57
|
+
* Use resolves to unwrap the value of a fulfilled promise so any other
|
|
58
|
+
* matcher can be chained. If the promise is rejected the assertion fails.
|
|
59
|
+
*/
|
|
60
|
+
resolves: Matchers<Promise<R>>;
|
|
61
|
+
/**
|
|
62
|
+
* Unwraps the reason of a rejected promise so any other matcher can be chained.
|
|
63
|
+
* If the promise is fulfilled the assertion fails.
|
|
64
|
+
*/
|
|
65
|
+
rejects: Matchers<Promise<R>>;
|
|
66
|
+
/**
|
|
67
|
+
* Checks that a value is what you expect. It uses `===` to check strict equality.
|
|
68
|
+
* Don't use `toBe` with floating-point numbers.
|
|
69
|
+
*/
|
|
70
|
+
toBe(expected: unknown): R;
|
|
71
|
+
/**
|
|
72
|
+
* Using exact equality with floating point numbers is a bad idea.
|
|
73
|
+
* Rounding means that intuitive things fail.
|
|
74
|
+
* The default for numDigits is 2.
|
|
75
|
+
*/
|
|
76
|
+
toBeCloseTo(expected: number, numDigits?: number): R;
|
|
77
|
+
/**
|
|
78
|
+
* Ensure that a variable is not undefined.
|
|
79
|
+
*/
|
|
80
|
+
toBeDefined(): R;
|
|
81
|
+
/**
|
|
82
|
+
* When you don't care what a value is, you just want to
|
|
83
|
+
* ensure a value is false in a boolean context.
|
|
84
|
+
*/
|
|
85
|
+
toBeFalsy(): R;
|
|
86
|
+
/**
|
|
87
|
+
* For comparing floating point numbers.
|
|
88
|
+
*/
|
|
89
|
+
toBeGreaterThan(expected: number | bigint): R;
|
|
90
|
+
/**
|
|
91
|
+
* For comparing floating point numbers.
|
|
92
|
+
*/
|
|
93
|
+
toBeGreaterThanOrEqual(expected: number | bigint): R;
|
|
94
|
+
/**
|
|
95
|
+
* Ensure that an object is an instance of a class.
|
|
96
|
+
* This matcher uses `instanceof` underneath.
|
|
97
|
+
*/
|
|
98
|
+
toBeInstanceOf(expected: Function): R;
|
|
99
|
+
/**
|
|
100
|
+
* For comparing floating point numbers.
|
|
101
|
+
*/
|
|
102
|
+
toBeLessThan(expected: number | bigint): R;
|
|
103
|
+
/**
|
|
104
|
+
* For comparing floating point numbers.
|
|
105
|
+
*/
|
|
106
|
+
toBeLessThanOrEqual(expected: number | bigint): R;
|
|
107
|
+
/**
|
|
108
|
+
* This is the same as `.toBe(null)` but the error messages are a bit nicer.
|
|
109
|
+
* So use `.toBeNull()` when you want to check that something is null.
|
|
110
|
+
*/
|
|
111
|
+
toBeNull(): R;
|
|
112
|
+
/**
|
|
113
|
+
* Use when you don't care what a value is, you just want to ensure a value
|
|
114
|
+
* is true in a boolean context. In JavaScript, there are six falsy values:
|
|
115
|
+
* `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy.
|
|
116
|
+
*/
|
|
117
|
+
toBeTruthy(): R;
|
|
118
|
+
/**
|
|
119
|
+
* Used to check that a variable is undefined.
|
|
120
|
+
*/
|
|
121
|
+
toBeUndefined(): R;
|
|
122
|
+
/**
|
|
123
|
+
* Used to check that a variable is NaN.
|
|
124
|
+
*/
|
|
125
|
+
toBeNaN(): R;
|
|
126
|
+
/**
|
|
127
|
+
* Used when you want to check that an item is in a list.
|
|
128
|
+
* For testing the items in the list, this uses `===`, a strict equality check.
|
|
129
|
+
*/
|
|
130
|
+
toContain(expected: unknown): R;
|
|
131
|
+
/**
|
|
132
|
+
* Used when you want to check that an item is in a list.
|
|
133
|
+
* For testing the items in the list, this matcher recursively checks the
|
|
134
|
+
* equality of all fields, rather than checking for object identity.
|
|
135
|
+
*/
|
|
136
|
+
toContainEqual(expected: unknown): R;
|
|
137
|
+
/**
|
|
138
|
+
* Used when you want to check that two objects have the same value.
|
|
139
|
+
* This matcher recursively checks the equality of all fields, rather than checking for object identity.
|
|
140
|
+
*/
|
|
141
|
+
toEqual(expected: unknown): R;
|
|
142
|
+
/**
|
|
143
|
+
* Used to check that an object has a `.length` property
|
|
144
|
+
* and it is set to a certain numeric value.
|
|
145
|
+
*/
|
|
146
|
+
toHaveLength(expected: number): R;
|
|
147
|
+
/**
|
|
148
|
+
* Use to check if property at provided reference keyPath exists for an object.
|
|
149
|
+
* For checking deeply nested properties in an object you may use dot notation or an array containing
|
|
150
|
+
* the keyPath for deep references.
|
|
151
|
+
*
|
|
152
|
+
* Optionally, you can provide a value to check if it's equal to the value present at keyPath
|
|
153
|
+
* on the target object. This matcher uses 'deep equality' (like `toEqual()`) and recursively checks
|
|
154
|
+
* the equality of all fields.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
*
|
|
158
|
+
* expect(houseForSale).toHaveProperty('kitchen.area', 20);
|
|
159
|
+
*/
|
|
160
|
+
toHaveProperty(keyPath: string | Array<string>, value?: unknown): R;
|
|
161
|
+
/**
|
|
162
|
+
* Check that a string matches a regular expression.
|
|
163
|
+
*/
|
|
164
|
+
toMatch(expected: string | RegExp): R;
|
|
165
|
+
/**
|
|
166
|
+
* Used to check that a JavaScript object matches a subset of the properties of an object
|
|
167
|
+
*/
|
|
168
|
+
toMatchObject(expected: Record<string, unknown> | Array<unknown>): R;
|
|
169
|
+
/**
|
|
170
|
+
* Use to test that objects have the same types as well as structure.
|
|
171
|
+
*/
|
|
172
|
+
toStrictEqual(expected: unknown): R;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
export declare const expect: Expect;
|
|
177
|
+
//# sourceMappingURL=expect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/core/expect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,CAAC,OAAO,MAAM,MAAM,GAAG;IAC3B,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACjD,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E;;eAEG;YACH,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,CAAC,CAAC;SACrC;KACF;CACF;AAED,eAAO,MAAM,MAAM,EAAE,MAAkB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2020-present, Elastic NV
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
|
15
|
+
* all copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
* THE SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.expect = void 0;
|
|
31
|
+
const expect_1 = __importDefault(require("expect"));
|
|
32
|
+
exports.expect = expect_1.default;
|
|
33
|
+
//# sourceMappingURL=expect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.js","sourceRoot":"","sources":["../../src/core/expect.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;AAEH,oDAA+B;AAiKlB,QAAA,MAAM,GAAW,gBAAS,CAAC"}
|
package/dist/core/gatherer.d.ts
CHANGED
|
@@ -22,15 +22,10 @@
|
|
|
22
22
|
* THE SOFTWARE.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
import {
|
|
25
|
+
import { ChromiumBrowser, BrowserContext } from 'playwright-chromium';
|
|
26
26
|
import { PluginManager } from '../plugins';
|
|
27
27
|
import { RunOptions } from './runner';
|
|
28
|
-
|
|
29
|
-
browser: ChromiumBrowser;
|
|
30
|
-
context: ChromiumBrowserContext;
|
|
31
|
-
page: Page;
|
|
32
|
-
client: CDPSession;
|
|
33
|
-
};
|
|
28
|
+
import { Driver } from '../common_types';
|
|
34
29
|
/**
|
|
35
30
|
* Purpose of the Gatherer is to set up the necessary browser driver
|
|
36
31
|
* related capabilities for the runner to run all journeys
|
|
@@ -38,6 +33,8 @@ export declare type Driver = {
|
|
|
38
33
|
export declare class Gatherer {
|
|
39
34
|
static browser: ChromiumBrowser;
|
|
40
35
|
static setupDriver(options: RunOptions): Promise<Driver>;
|
|
36
|
+
static getUserAgent(): Promise<string>;
|
|
37
|
+
static setNetworkConditions(context: BrowserContext, networkConditions: RunOptions['networkConditions']): Promise<void>;
|
|
41
38
|
/**
|
|
42
39
|
* Starts recording all events related to the v8 devtools protocol
|
|
43
40
|
* https://chromedevtools.github.io/devtools-protocol/v8/
|