@tramvai/test-pw 5.49.1 → 6.59.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/lib/launch.d.ts CHANGED
@@ -25,6 +25,7 @@ export declare const initPlaywright: (serverUrl: string, { enableLogging, ...opt
25
25
  passphrase?: string | undefined;
26
26
  }[] | undefined;
27
27
  colorScheme?: "light" | "dark" | "no-preference" | null | undefined;
28
+ contrast?: "no-preference" | "more" | null | undefined;
28
29
  deviceScaleFactor?: number | undefined;
29
30
  extraHTTPHeaders?: {
30
31
  [key: string]: string;
@@ -112,6 +113,7 @@ export declare const initPlaywright: (serverUrl: string, { enableLogging, ...opt
112
113
  waitForUrl: (url: string) => Promise<import("playwright-core").JSHandle<boolean>>;
113
114
  router: {
114
115
  navigate: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<any>;
116
+ back: (to: number) => Promise<any>;
115
117
  navigateThenWaitForReload: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<[void, import("playwright-core").Response | null]>;
116
118
  updateCurrentRoute: (options: import("@tinkoff/router").BaseNavigateOptions) => Promise<any>;
117
119
  getCurrentRoute: () => Promise<any>;
package/lib/router.d.ts CHANGED
@@ -5,6 +5,7 @@ type NavigateOptions = Parameters<PageService['navigate']>[0];
5
5
  type UpdateCurrentRouteOptions = Parameters<PageService['updateCurrentRoute']>[0];
6
6
  export declare const wrapRouter: (page: Page) => {
7
7
  navigate: (options: NavigateOptions) => Promise<any>;
8
+ back: (to: number) => Promise<any>;
8
9
  navigateThenWaitForReload: (options: NavigateOptions) => Promise<[void, import("playwright-core").Response | null]>;
9
10
  updateCurrentRoute: (options: UpdateCurrentRouteOptions) => Promise<any>;
10
11
  getCurrentRoute: () => Promise<any>;
package/lib/router.es.js CHANGED
@@ -29,8 +29,14 @@ const wrapRouter = (page) => {
29
29
  return window.contextExternal.di.get('router pageService').getCurrentUrl();
30
30
  });
31
31
  };
32
+ const back = async (to) => {
33
+ return page.evaluate((backTo) => {
34
+ return window.contextExternal.di.get('router pageService').back(backTo);
35
+ }, to);
36
+ };
32
37
  return {
33
38
  navigate,
39
+ back,
34
40
  navigateThenWaitForReload,
35
41
  updateCurrentRoute,
36
42
  getCurrentRoute,
package/lib/router.js CHANGED
@@ -33,8 +33,14 @@ const wrapRouter = (page) => {
33
33
  return window.contextExternal.di.get('router pageService').getCurrentUrl();
34
34
  });
35
35
  };
36
+ const back = async (to) => {
37
+ return page.evaluate((backTo) => {
38
+ return window.contextExternal.di.get('router pageService').back(backTo);
39
+ }, to);
40
+ };
36
41
  return {
37
42
  navigate,
43
+ back,
38
44
  navigateThenWaitForReload,
39
45
  updateCurrentRoute,
40
46
  getCurrentRoute,
package/lib/wrapper.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare const wrapPlaywrightPage: (page: Page) => {
11
11
  waitForUrl: (url: string) => Promise<import("playwright-core").JSHandle<boolean>>;
12
12
  router: {
13
13
  navigate: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<any>;
14
+ back: (to: number) => Promise<any>;
14
15
  navigateThenWaitForReload: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<[void, import("playwright-core").Response | null]>;
15
16
  updateCurrentRoute: (options: import("@tinkoff/router").BaseNavigateOptions) => Promise<any>;
16
17
  getCurrentRoute: () => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-pw",
3
- "version": "5.49.1",
3
+ "version": "6.59.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -18,13 +18,13 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@tinkoff/utils": "^2.1.2",
21
- "@tramvai/test-integration": "5.49.1",
22
- "@tramvai/tokens-router": "5.49.1",
21
+ "@tramvai/test-integration": "6.59.0",
22
+ "@tramvai/tokens-router": "6.59.0",
23
23
  "console-with-style": "^1.1.0",
24
- "get-port": "^5.1.1",
25
- "supports-color": "8.1.1",
26
24
  "env-ci": "^5.0.2",
27
25
  "execa": "^5.1.1",
26
+ "get-port": "^5.1.1",
27
+ "supports-color": "8.1.1",
28
28
  "tslib": "^2.4.0",
29
29
  "wait-on": "^5.3.0"
30
30
  },
@@ -32,12 +32,12 @@
32
32
  "playwright-core": "*"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/supports-color": "^8.1.1",
35
+ "@playwright/test": "1.54.1",
36
+ "@tramvai/cli": "6.59.0",
36
37
  "@types/env-ci": "^3.1.0",
38
+ "@types/supports-color": "^8.1.1",
37
39
  "@types/wait-on": "^5.2.0",
38
- "@tramvai/cli": "5.49.1",
39
- "@playwright/test": "1.48.2",
40
- "playwright-core": "1.48.2"
40
+ "playwright-core": "1.54.1"
41
41
  },
42
42
  "license": "Apache-2.0",
43
43
  "module": "lib/index.es.js"