@telefonica/acceptance-testing 5.1.0 → 5.3.0
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/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Browser, ClickOptions, ElementHandle, HTTPRequest, Page, ResponseForRequest, ScreenshotOptions, Viewport } from 'puppeteer';
|
|
1
|
+
import type { Browser, ClickOptions, ElementHandle, HTTPRequest, Page, ResponseForRequest, ScreenshotOptions, Viewport, WaitForOptions } from 'puppeteer';
|
|
2
2
|
type CustomScreenshotOptions = ScreenshotOptions & {
|
|
3
3
|
skipNetworkWait?: boolean;
|
|
4
4
|
};
|
|
@@ -52,6 +52,7 @@ interface OpenPageCommonConfig {
|
|
|
52
52
|
viewport?: TestViewport;
|
|
53
53
|
isDarkMode?: boolean;
|
|
54
54
|
cookies?: Array<CookieConfig>;
|
|
55
|
+
waitUntil?: WaitForOptions['waitUntil'];
|
|
55
56
|
}
|
|
56
57
|
interface OpenPageUrlConfig extends OpenPageCommonConfig {
|
|
57
58
|
url: string;
|
|
@@ -64,7 +65,7 @@ interface OpenPagePathConfig extends OpenPageCommonConfig {
|
|
|
64
65
|
hostname?: string;
|
|
65
66
|
}
|
|
66
67
|
type OpenPageConfig = OpenPageUrlConfig | OpenPagePathConfig;
|
|
67
|
-
export declare const openPage: ({ userAgent, isDarkMode, viewport, cookies, ...urlConfig }: OpenPageConfig) => Promise<PageApi>;
|
|
68
|
+
export declare const openPage: ({ userAgent, isDarkMode, viewport, cookies, waitUntil, ...urlConfig }: OpenPageConfig) => Promise<PageApi>;
|
|
68
69
|
export declare const getScreen: (page: Page) => import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
|
|
69
70
|
export declare const screen: import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
|
|
70
71
|
export declare const within: (element: ElementHandle) => import("pptr-testing-library/dist/typedefs").IQueryUtils & import("pptr-testing-library/dist/typedefs").IScopedQueryUtils;
|
package/dist/index.js
CHANGED
|
@@ -191,7 +191,7 @@ const createApiEndpointMock = ({ origin = '*' } = {}) => {
|
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
193
|
exports.createApiEndpointMock = createApiEndpointMock;
|
|
194
|
-
const openPage = async ({ userAgent, isDarkMode, viewport, cookies, ...urlConfig }) => {
|
|
194
|
+
const openPage = async ({ userAgent, isDarkMode, viewport, cookies, waitUntil, ...urlConfig }) => {
|
|
195
195
|
const url = (() => {
|
|
196
196
|
if (urlConfig.url !== undefined) {
|
|
197
197
|
return urlConfig.url;
|
|
@@ -252,7 +252,7 @@ const openPage = async ({ userAgent, isDarkMode, viewport, cookies, ...urlConfig
|
|
|
252
252
|
page.on('request', requestInterceptor);
|
|
253
253
|
}
|
|
254
254
|
try {
|
|
255
|
-
await page.goto(url);
|
|
255
|
+
await page.goto(url, { waitUntil });
|
|
256
256
|
}
|
|
257
257
|
catch (e) {
|
|
258
258
|
if (e.message.includes('net::ERR_CONNECTION_REFUSED')) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telefonica/acceptance-testing",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"author": "Telefonica",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"ts-check": "tsc"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/find-root": "^1.1.
|
|
32
|
-
"@types/glob-to-regexp": "^0.4.
|
|
31
|
+
"@types/find-root": "^1.1.4",
|
|
32
|
+
"@types/glob-to-regexp": "^0.4.4",
|
|
33
33
|
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
34
34
|
"@typescript-eslint/parser": "^6.10.0",
|
|
35
35
|
"eslint": "^9.7.0",
|
|
36
36
|
"jest": "^29.7.0",
|
|
37
37
|
"prettier": "^3.3.3",
|
|
38
|
-
"ts-jest": "^29.
|
|
38
|
+
"ts-jest": "^29.4.6",
|
|
39
39
|
"ts-node": "^10.9.2",
|
|
40
40
|
"typescript": "^5.5.3"
|
|
41
41
|
},
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"registry": "https://registry.npmjs.org"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@types/jest-image-snapshot": "^4.
|
|
48
|
+
"@types/jest-image-snapshot": "^6.4.1",
|
|
49
49
|
"find-root": "^1.1.0",
|
|
50
50
|
"glob-to-regexp": "^0.4.1",
|
|
51
51
|
"istanbul-lib-coverage": "^3.2.2",
|
|
52
|
-
"jest-image-snapshot": "^
|
|
53
|
-
"pptr-testing-library": "^0.
|
|
52
|
+
"jest-image-snapshot": "^6.5.1",
|
|
53
|
+
"pptr-testing-library": "^0.7.0",
|
|
54
54
|
"puppeteer": "^10.4.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|