@telefonica/acceptance-testing 5.2.0 → 5.3.1

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 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
@@ -44,7 +44,7 @@ exports.serverPort = server.port;
44
44
  const toMatchImageSnapshot = (0, jest_image_snapshot_1.configureToMatchImageSnapshot)({
45
45
  failureThreshold: 0,
46
46
  failureThresholdType: 'percent',
47
- customSnapshotIdentifier: ({ defaultIdentifier }) => defaultIdentifier,
47
+ customSnapshotIdentifier: ({ defaultIdentifier }) => `${defaultIdentifier}-snap`,
48
48
  });
49
49
  let calledToMatchImageSnapshotOutsideDocker = false;
50
50
  const localToMatchImageSnapshot = () => {
@@ -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.2.0",
3
+ "version": "5.3.1",
4
4
  "author": "Telefonica",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",