@telefonica/acceptance-testing 4.0.0 → 5.0.0-beta1

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 CHANGED
@@ -51,13 +51,15 @@ If you want to autostart a server before running the acceptance tests, you can c
51
51
  }
52
52
  ```
53
53
 
54
- Additionally, you can include path and protocol parameters, that will be used to check if the server is ready:
54
+ Additionally, you can include `host`, `protocol` and `path` parameters. The path will be used to check if the
55
+ server is ready:
55
56
 
56
57
  ```json
57
58
  {
58
59
  "acceptanceTests": {
59
60
  "ciServer": {
60
61
  "command": "yarn dev",
62
+ "host": "127.0.0.1",
61
63
  "port": 3000,
62
64
  "path": "api/health",
63
65
  "protocol": "https"
@@ -66,6 +68,13 @@ Additionally, you can include path and protocol parameters, that will be used to
66
68
  }
67
69
  ```
68
70
 
71
+ The `command` can be overridden by setting the `ACCEPTANCE_TESTING_SERVER_COMMAND` environment variable. For
72
+ example:
73
+
74
+ ```sh
75
+ ACCEPTANCE_TESTING_SERVER_COMMAND="yarn start" yarn test-acceptance
76
+ ```
77
+
69
78
  #### `protocol`
70
79
 
71
80
  Type: `string`, (`https`, `http`, `tcp`, `socket`) defaults to `tcp` or `http` if `path` is set.
@@ -200,7 +209,10 @@ test('example screenshot test', async () => {
200
209
  });
201
210
  ```
202
211
 
203
- `createApiEndpointMock` automatically mocks CORS response headers and preflight (`OPTIONS`) requests for you.
212
+ - `createApiEndpointMock` automatically mocks CORS response headers and preflight (`OPTIONS`) requests for
213
+ you.
214
+ - Both `interceptRequest` and `createApiEndpointMock` return a jest
215
+ [mock function](https://jestjs.io/docs/mock-function-api/#reference).
204
216
 
205
217
  ### Using globs
206
218
 
@@ -251,7 +263,8 @@ await elementHandle.uploadFile(prepareFile('/path/to/file'));
251
263
 
252
264
  ## Collecting coverage
253
265
 
254
- Set the `COLLECT_ACCEPTANCE_COVERAGE` environment variable to enable coverage collection.
266
+ Set the `ACCEPTANCE_TESTING_COLLECT_COVERAGE` environment variable to enable coverage collection or run with
267
+ the `--coverage` flag.
255
268
 
256
269
  The code must be instrumented with [nyc](https://github.com/istanbuljs/nyc/blob/main/docs/instrument.md),
257
270
  [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul) or any
@@ -323,6 +336,9 @@ page.on('pageerror', (err) => {
323
336
  });
324
337
  ```
325
338
 
339
+ Page errors can be ignored by setting the `ACCEPTANCE_TESTING_IGNORE_PAGE_ERRORS` environment variable. Do not
340
+ enable this by default as it could hide legitimate errors in your tests.
341
+
326
342
  ### Executing with --ui fails (Linux)
327
343
 
328
344
  If your desktop environment uses Wayland, you may see the following error when running the tests with the
@@ -347,3 +363,9 @@ To workaround this issue, you can install a newer Chrome in the repo where you a
347
363
 
348
364
  Note that this browser will only be used when running the tests with the `--ui` flag. In headless mode, the
349
365
  dockerized chromium will be used.
366
+
367
+ ### Debug mode
368
+
369
+ If you need additional logs to debug the `acceptance-testing` library, you can set the
370
+ `ACCEPTANCE_TESTING_DEBUG` environment variable or run the `acceptance-testing` command with the `--debug`
371
+ flag.
@@ -0,0 +1,22 @@
1
+ type Config = {
2
+ debug: boolean;
3
+ isCi: boolean;
4
+ isHeadless: boolean;
5
+ isLocal: boolean;
6
+ coveragePath: string;
7
+ coverageUrls: string[];
8
+ collectCoverage: boolean;
9
+ /** complete list of server options: https://www.npmjs.com/package/jest-dev-server */
10
+ server: {
11
+ command: string;
12
+ host?: string;
13
+ port?: number;
14
+ path?: string;
15
+ usedPortAction?: 'error' | 'ignore';
16
+ launchTimeout?: number;
17
+ protocol?: 'http' | 'tcp';
18
+ debug?: boolean;
19
+ };
20
+ };
21
+ export declare const getConfig: () => Config;
22
+ export {};
package/dist/config.js ADDED
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getConfig = void 0;
7
+ const find_root_1 = __importDefault(require("find-root"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const IS_CI = !!process.env.CI || process.argv.includes('--ci');
11
+ const IS_DEBUG = !!process.env.ACCEPTANCE_TESTING_DEBUG || process.argv.includes('--debug');
12
+ const DEFAULT_CONFIG = {
13
+ debug: IS_DEBUG,
14
+ isCi: IS_CI,
15
+ isLocal: !IS_CI,
16
+ isHeadless: !!process.env.HEADLESS,
17
+ coveragePath: 'reports/coverage-acceptance',
18
+ collectCoverage: !!process.env.ACCEPTANCE_TESTING_COLLECT_COVERAGE || process.argv.includes('--coverage'),
19
+ coverageUrls: [],
20
+ server: {
21
+ debug: IS_DEBUG,
22
+ command: 'tail -f /dev/null',
23
+ host: '127.0.0.1',
24
+ usedPortAction: IS_CI ? 'error' : 'ignore', // In dev, if port is already taken, assume server is already running.
25
+ launchTimeout: 60000,
26
+ },
27
+ };
28
+ const PACKAGE_JSON_CONFIG = (() => {
29
+ const rootDir = (0, find_root_1.default)(process.cwd());
30
+ const packageJson = JSON.parse(fs_1.default.readFileSync(path_1.default.join(rootDir, 'package.json'), 'utf-8'));
31
+ const acceptanceTestsConfig = packageJson.acceptanceTests || {};
32
+ const server = (IS_CI ? acceptanceTestsConfig.ciServer : acceptanceTestsConfig.devServer) ||
33
+ acceptanceTestsConfig.server;
34
+ // not needed in the final config
35
+ delete acceptanceTestsConfig.ciServer;
36
+ delete acceptanceTestsConfig.devServer;
37
+ return {
38
+ ...acceptanceTestsConfig,
39
+ server,
40
+ };
41
+ })();
42
+ const CONFIG = (() => {
43
+ const config = {
44
+ ...DEFAULT_CONFIG,
45
+ ...PACKAGE_JSON_CONFIG,
46
+ server: {
47
+ ...DEFAULT_CONFIG.server,
48
+ ...PACKAGE_JSON_CONFIG.server,
49
+ },
50
+ };
51
+ config.server.protocol = config.server.path ? 'http' : 'tcp';
52
+ // overrides
53
+ config.server.command = process.env.ACCEPTANCE_TESTING_SERVER_COMMAND || config.server.command;
54
+ return config;
55
+ })();
56
+ const getConfig = () => CONFIG;
57
+ exports.getConfig = getConfig;
@@ -0,0 +1 @@
1
+ export declare const LINUX_DOCKER_HOST_IP = "172.17.0.1";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LINUX_DOCKER_HOST_IP = void 0;
4
+ exports.LINUX_DOCKER_HOST_IP = '172.17.0.1';
@@ -1,15 +1,15 @@
1
- export declare const getRootPath: () => any;
2
- /**
3
- * Assumes the code was instrumented with istanbul/nyc and the coverage report stored in `window.__coverage__`.
4
- * If not, this function does nothing.
5
- */
6
- export declare const collectFrontendCoverage: ({ coveragePath }: {
7
- coveragePath: string;
8
- }) => Promise<void>;
9
- /**
10
- * Collects backend coverage reports from the provided URLs and stores them in the coverage folder
11
- */
12
- export declare const collectBackendCoverage: ({ coveragePath, coverageUrls, }: {
13
- coveragePath: string;
14
- coverageUrls: Array<string>;
15
- }) => Promise<void>;
1
+ export declare const getRootPath: () => any;
2
+ /**
3
+ * Assumes the code was instrumented with istanbul/nyc and the coverage report stored in `window.__coverage__`.
4
+ * If not, this function does nothing.
5
+ */
6
+ export declare const collectFrontendCoverage: ({ coveragePath }: {
7
+ coveragePath: string;
8
+ }) => Promise<void>;
9
+ /**
10
+ * Collects backend coverage reports from the provided URLs and stores them in the coverage folder
11
+ */
12
+ export declare const collectBackendCoverage: ({ coveragePath, coverageUrls, }: {
13
+ coveragePath: string;
14
+ coverageUrls: Array<string>;
15
+ }) => Promise<void>;
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.collectBackendCoverage = exports.collectFrontendCoverage = exports.getRootPath = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const utils_1 = require("./utils");
10
+ const istanbul_lib_coverage_1 = __importDefault(require("istanbul-lib-coverage"));
11
+ const getGlobalPage = () => global.page;
12
+ const getRootPath = () => {
13
+ const rootPath = expect.getState().snapshotState._rootDir;
14
+ if (!rootPath) {
15
+ throw new Error('Root path not found');
16
+ }
17
+ return rootPath;
18
+ };
19
+ exports.getRootPath = getRootPath;
20
+ /**
21
+ * We want to clear coverage files from previous runs, but at this point it is not easy because each
22
+ * worker runs a different instance of this script, so we can't just clear the coverage folder at
23
+ * the beginning of the test run.
24
+ *
25
+ * The solution is to remove the coverage folder when the stored ppid (parent process id) is
26
+ * different from the current one
27
+ */
28
+ const prepareCoverageReportPath = ({ coveragePath }) => {
29
+ const ppidFile = path_1.default.join(coveragePath, '.ppid');
30
+ const nycOutputPath = path_1.default.join(coveragePath, '.nyc_output');
31
+ const ppid = process.ppid.toString();
32
+ if (!fs_1.default.existsSync(ppidFile) || fs_1.default.readFileSync(ppidFile, 'utf-8') !== ppid) {
33
+ // the condition is just to make sure we don't remove files outside the repo
34
+ if ((0, exports.getRootPath)() === process.cwd() && path_1.default.normalize(coveragePath).startsWith(process.cwd())) {
35
+ fs_1.default.rmSync(nycOutputPath, { recursive: true, force: true });
36
+ }
37
+ fs_1.default.mkdirSync(nycOutputPath, { recursive: true });
38
+ fs_1.default.writeFileSync(ppidFile, ppid);
39
+ }
40
+ };
41
+ const workerId = process.env.JEST_WORKER_ID || '0';
42
+ /**
43
+ * Writes the coverage reports into single files, one per each coverage object (path). This makes it easier to merge them.
44
+ * The `workerId` from jest is used to avoid race conditions when multiple workers are running in parallel.
45
+ */
46
+ const writeCombinedCoverage = (nycOutputPath, coverage) => {
47
+ Object.values(coverage).forEach((value) => {
48
+ if (value && value.path && value.hash) {
49
+ const filename = path_1.default.join(nycOutputPath, `${value.hash}-${workerId}.json`);
50
+ const currentCoverage = { [value.path]: value };
51
+ const previousCoverage = fs_1.default.existsSync(filename)
52
+ ? JSON.parse(fs_1.default.readFileSync(filename, 'utf8'))
53
+ : {};
54
+ const mergedCoverage = istanbul_lib_coverage_1.default.createCoverageMap(previousCoverage);
55
+ mergedCoverage.merge(currentCoverage);
56
+ (0, utils_1.debug)('Writing merged coverage:', value.path, value.hash);
57
+ fs_1.default.writeFileSync(filename, JSON.stringify(mergedCoverage.toJSON(), null, 2));
58
+ }
59
+ else {
60
+ (0, utils_1.debug)('Skip write coverage. Missing path or hash:', value);
61
+ }
62
+ });
63
+ };
64
+ /**
65
+ * Assumes the code was instrumented with istanbul/nyc and the coverage report stored in `window.__coverage__`.
66
+ * If not, this function does nothing.
67
+ */
68
+ const collectFrontendCoverage = async ({ coveragePath }) => {
69
+ const nycOutputPath = path_1.default.join(coveragePath, '.nyc_output');
70
+ const coverage = await getGlobalPage().evaluate(() => {
71
+ return window.__coverage__;
72
+ });
73
+ if (!coverage) {
74
+ (0, utils_1.debug)('Skipping coverage collection. No coverage found.');
75
+ return;
76
+ }
77
+ (0, utils_1.debug)('Frontend coverage found');
78
+ prepareCoverageReportPath({ coveragePath });
79
+ fs_1.default.mkdirSync(nycOutputPath, { recursive: true });
80
+ writeCombinedCoverage(nycOutputPath, coverage);
81
+ };
82
+ exports.collectFrontendCoverage = collectFrontendCoverage;
83
+ const writeCoverage = (nycOutputPath, nameSuffix, coverage) => {
84
+ Object.values(coverage).forEach((value) => {
85
+ if (value && value.path && value.hash) {
86
+ const filename = path_1.default.join(nycOutputPath, `${value.hash}${nameSuffix}.json`);
87
+ (0, utils_1.debug)('Writing coverage:', value.path, value.hash);
88
+ fs_1.default.writeFileSync(filename, JSON.stringify({ [value.path]: value }, null, 2));
89
+ }
90
+ else {
91
+ (0, utils_1.debug)('Skip write coverage. Missing path or hash:', value);
92
+ }
93
+ });
94
+ };
95
+ /**
96
+ * Collects backend coverage reports from the provided URLs and stores them in the coverage folder
97
+ */
98
+ const collectBackendCoverage = async ({ coveragePath, coverageUrls, }) => {
99
+ const nycOutputPath = path_1.default.join(coveragePath, '.nyc_output');
100
+ (0, utils_1.debug)('Collecting backend coverage reports', coverageUrls);
101
+ const serverReports = await Promise.all(coverageUrls.map((url) => fetch(url)
102
+ .then((res) => {
103
+ if (res.ok &&
104
+ res.status === 200 &&
105
+ res.headers.get('content-type')?.includes('application/json')) {
106
+ return res.json();
107
+ }
108
+ (0, utils_1.debug)('Error fetching coverage report:', { url, status: res.status });
109
+ return null;
110
+ })
111
+ .catch(() => {
112
+ (0, utils_1.debug)('Error fetching coverage report:', { url });
113
+ return null;
114
+ })));
115
+ serverReports.forEach((report, index) => {
116
+ writeCoverage(nycOutputPath, `-backend${index}`, report.coverage);
117
+ });
118
+ };
119
+ exports.collectBackendCoverage = collectBackendCoverage;
package/dist/index.d.ts CHANGED
@@ -1,91 +1,86 @@
1
- /// <reference types="node" />
2
- /// <reference types="jest" />
3
- /// <reference types="jest-image-snapshot" />
4
- import type { Browser, ClickOptions, ElementHandle, HTTPRequest, Page, ResponseForRequest, ScreenshotOptions, Viewport } from 'puppeteer';
5
- declare type CustomScreenshotOptions = ScreenshotOptions & {
6
- skipNetworkWait?: boolean;
7
- };
8
- export declare const getGlobalBrowser: () => Browser;
9
- export declare const getGlobalPage: () => Page;
10
- export declare const serverHostName: string;
11
- export declare const serverPort: any;
12
- export interface PageApi extends Omit<Page, 'click' | 'type' | 'select'> {
13
- clear: (selector: ElementHandle) => Promise<void>;
14
- type: (selector: ElementHandle, text: string, options?: {
15
- delay: number;
16
- }) => Promise<void>;
17
- click: (selector: ElementHandle, options?: ClickOptions) => Promise<void>;
18
- select: (selector: ElementHandle, ...values: string[]) => Promise<string[]>;
19
- screenshot: (options?: CustomScreenshotOptions) => Promise<Buffer | string | void>;
20
- }
21
- export declare const getPageApi: (page: Page) => PageApi;
22
- declare type RequestMatcherFn = (req: HTTPRequest) => boolean;
23
- export declare const interceptRequest: (matcher: RequestMatcherFn) => jest.Mock<Partial<ResponseForRequest>, [HTTPRequest]>;
24
- declare type ApiEndpointMock = {
25
- spyOn(path: string, method?: string): jest.Mock<unknown, [HTTPRequest]>;
26
- };
27
- export declare const createApiEndpointMock: ({ origin, baseUrl, }?: {
28
- origin?: string | undefined;
29
- /** @deprecated use origin */
30
- baseUrl?: string | undefined;
31
- }) => ApiEndpointMock;
32
- declare type CookieConfig = {
33
- name: string;
34
- value: string;
35
- url?: string;
36
- domain?: string;
37
- path?: string;
38
- secure?: boolean;
39
- httpOnly?: boolean;
40
- sameSite?: 'Strict' | 'Lax' | 'None';
41
- expires?: number;
42
- priority?: 'Low' | 'Medium' | 'High';
43
- sameParty?: boolean;
44
- sourceScheme?: 'Unset' | 'NonSecure' | 'Secure';
45
- sourcePort?: number;
46
- };
47
- export interface TestViewport extends Viewport {
48
- safeAreaInset?: {
49
- top?: number | string;
50
- right?: number | string;
51
- bottom?: number | string;
52
- left?: number | string;
53
- };
54
- }
55
- interface OpenPageCommonConfig {
56
- userAgent?: string;
57
- viewport?: TestViewport;
58
- isDarkMode?: boolean;
59
- cookies?: Array<CookieConfig>;
60
- }
61
- interface OpenPageUrlConfig extends OpenPageCommonConfig {
62
- url: string;
63
- }
64
- interface OpenPagePathConfig extends OpenPageCommonConfig {
65
- url?: undefined;
66
- path?: string;
67
- port?: number;
68
- protocol?: string;
69
- hostname?: string;
70
- }
71
- declare type OpenPageConfig = OpenPageUrlConfig | OpenPagePathConfig;
72
- export declare const openPage: ({ userAgent, isDarkMode, viewport, cookies, ...urlConfig }: OpenPageConfig) => Promise<PageApi>;
73
- export declare const getScreen: (page: Page) => import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
74
- export declare const screen: import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
75
- export declare const within: (element: ElementHandle) => import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
76
- export type { ElementHandle, Viewport } from 'puppeteer';
77
- /**
78
- * Returns a new path to the file that can be used by chromium in acceptance tests
79
- *
80
- * To be able to use `element.uploadFile()` in a dockerized chromium, the file must exist in the
81
- * host and the docker, and both sides must use the same path.
82
- *
83
- * To workaround this bug or limitation, this function prepares the file by copying it to /tmp in
84
- * the host and the container.
85
- */
86
- export declare const prepareFile: (filepath: string) => string;
87
- /**
88
- * A convenience method to defer an expectation
89
- */
90
- export declare const wait: <T>(expectation: () => T | Promise<T>, timeout?: number, interval?: number) => Promise<T>;
91
- export declare const waitForElementToBeRemoved: (element: ElementHandle<Element>, timeout?: number, interval?: number) => Promise<void>;
1
+ import type { Browser, ClickOptions, ElementHandle, HTTPRequest, Page, ResponseForRequest, ScreenshotOptions, Viewport } from 'puppeteer';
2
+ type CustomScreenshotOptions = ScreenshotOptions & {
3
+ skipNetworkWait?: boolean;
4
+ };
5
+ export declare const getGlobalBrowser: () => Browser;
6
+ export declare const getGlobalPage: () => Page;
7
+ export declare const serverHostName: string;
8
+ export declare const serverPort: number | undefined;
9
+ export interface PageApi extends Omit<Page, 'click' | 'type' | 'select'> {
10
+ clear: (selector: ElementHandle) => Promise<void>;
11
+ type: (selector: ElementHandle, text: string, options?: {
12
+ delay: number;
13
+ }) => Promise<void>;
14
+ click: (selector: ElementHandle, options?: ClickOptions) => Promise<void>;
15
+ select: (selector: ElementHandle, ...values: string[]) => Promise<string[]>;
16
+ screenshot: (options?: CustomScreenshotOptions) => Promise<Buffer | string | void>;
17
+ }
18
+ export declare const getPageApi: (page: Page) => PageApi;
19
+ type RequestMatcherFn = (req: HTTPRequest) => boolean;
20
+ export declare const interceptRequest: (matcher: RequestMatcherFn) => jest.Mock<Partial<ResponseForRequest> | Promise<Partial<ResponseForRequest>>, [HTTPRequest]>;
21
+ type ApiEndpointMock = {
22
+ spyOn<T = any>(path: string, method?: string): jest.Mock<T, [HTTPRequest]>;
23
+ };
24
+ export declare const createApiEndpointMock: ({ origin }?: {
25
+ origin?: string;
26
+ }) => ApiEndpointMock;
27
+ type CookieConfig = {
28
+ name: string;
29
+ value: string;
30
+ url?: string;
31
+ domain?: string;
32
+ path?: string;
33
+ secure?: boolean;
34
+ httpOnly?: boolean;
35
+ sameSite?: 'Strict' | 'Lax' | 'None';
36
+ expires?: number;
37
+ priority?: 'Low' | 'Medium' | 'High';
38
+ sameParty?: boolean;
39
+ sourceScheme?: 'Unset' | 'NonSecure' | 'Secure';
40
+ sourcePort?: number;
41
+ };
42
+ export interface TestViewport extends Viewport {
43
+ safeAreaInset?: {
44
+ top?: number | string;
45
+ right?: number | string;
46
+ bottom?: number | string;
47
+ left?: number | string;
48
+ };
49
+ }
50
+ interface OpenPageCommonConfig {
51
+ userAgent?: string;
52
+ viewport?: TestViewport;
53
+ isDarkMode?: boolean;
54
+ cookies?: Array<CookieConfig>;
55
+ }
56
+ interface OpenPageUrlConfig extends OpenPageCommonConfig {
57
+ url: string;
58
+ }
59
+ interface OpenPagePathConfig extends OpenPageCommonConfig {
60
+ url?: undefined;
61
+ path?: string;
62
+ port?: number;
63
+ protocol?: string;
64
+ hostname?: string;
65
+ }
66
+ type OpenPageConfig = OpenPageUrlConfig | OpenPagePathConfig;
67
+ export declare const openPage: ({ userAgent, isDarkMode, viewport, cookies, ...urlConfig }: OpenPageConfig) => Promise<PageApi>;
68
+ export declare const getScreen: (page: Page) => import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
69
+ export declare const screen: import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
70
+ export declare const within: (element: ElementHandle) => import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
71
+ export type { ElementHandle, Viewport } from 'puppeteer';
72
+ /**
73
+ * Returns a new path to the file that can be used by chromium in acceptance tests
74
+ *
75
+ * To be able to use `element.uploadFile()` in a dockerized chromium, the file must exist in the
76
+ * host and the docker, and both sides must use the same path.
77
+ *
78
+ * To workaround this bug or limitation, this function prepares the file by copying it to /tmp in
79
+ * the host and the container.
80
+ */
81
+ export declare const prepareFile: (filepath: string) => string;
82
+ /**
83
+ * A convenience method to defer an expectation
84
+ */
85
+ export declare const wait: <T>(expectation: () => Promise<T> | T, timeout?: number, interval?: number) => Promise<T>;
86
+ export declare const waitForElementToBeRemoved: (element: ElementHandle<Element>, timeout?: number, interval?: number) => Promise<void>;