@tramvai/test-pw 2.93.0 → 2.94.2

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
@@ -14,6 +14,8 @@ export declare const initPlaywright: (serverUrl: string, { enableLogging, ...opt
14
14
  navigate: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<any>;
15
15
  navigateThenWaitForReload: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<[void, import("playwright-core").Response | null]>;
16
16
  updateCurrentRoute: (options: import("@tinkoff/router").BaseNavigateOptions) => Promise<any>;
17
+ getCurrentRoute: () => Promise<any>;
18
+ getCurrentUrl: () => Promise<any>;
17
19
  };
18
20
  close: () => Promise<void>;
19
21
  }>;
package/lib/router.d.ts CHANGED
@@ -7,5 +7,7 @@ export declare const wrapRouter: (page: Page) => {
7
7
  navigate: (options: NavigateOptions) => Promise<any>;
8
8
  navigateThenWaitForReload: (options: NavigateOptions) => Promise<[void, import("playwright-core").Response | null]>;
9
9
  updateCurrentRoute: (options: UpdateCurrentRouteOptions) => Promise<any>;
10
+ getCurrentRoute: () => Promise<any>;
11
+ getCurrentUrl: () => Promise<any>;
10
12
  };
11
13
  export {};
package/lib/router.es.js CHANGED
@@ -19,10 +19,22 @@ const wrapRouter = (page) => {
19
19
  .updateCurrentRoute(navigateOptions);
20
20
  }, options);
21
21
  };
22
+ const getCurrentRoute = async () => {
23
+ return page.evaluate(() => {
24
+ return window.contextExternal.di.get('router pageService').getCurrentRoute();
25
+ });
26
+ };
27
+ const getCurrentUrl = async () => {
28
+ return page.evaluate(() => {
29
+ return window.contextExternal.di.get('router pageService').getCurrentUrl();
30
+ });
31
+ };
22
32
  return {
23
33
  navigate,
24
34
  navigateThenWaitForReload,
25
35
  updateCurrentRoute,
36
+ getCurrentRoute,
37
+ getCurrentUrl,
26
38
  };
27
39
  };
28
40
 
package/lib/router.js CHANGED
@@ -23,10 +23,22 @@ const wrapRouter = (page) => {
23
23
  .updateCurrentRoute(navigateOptions);
24
24
  }, options);
25
25
  };
26
+ const getCurrentRoute = async () => {
27
+ return page.evaluate(() => {
28
+ return window.contextExternal.di.get('router pageService').getCurrentRoute();
29
+ });
30
+ };
31
+ const getCurrentUrl = async () => {
32
+ return page.evaluate(() => {
33
+ return window.contextExternal.di.get('router pageService').getCurrentUrl();
34
+ });
35
+ };
26
36
  return {
27
37
  navigate,
28
38
  navigateThenWaitForReload,
29
39
  updateCurrentRoute,
40
+ getCurrentRoute,
41
+ getCurrentUrl,
30
42
  };
31
43
  };
32
44
 
package/lib/wrapper.d.ts CHANGED
@@ -10,6 +10,8 @@ export declare const wrapPlaywrightPage: (page: Page) => {
10
10
  navigate: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<any>;
11
11
  navigateThenWaitForReload: (options: string | import("@tinkoff/router").NavigateOptions) => Promise<[void, import("playwright-core").Response | null]>;
12
12
  updateCurrentRoute: (options: import("@tinkoff/router").BaseNavigateOptions) => Promise<any>;
13
+ getCurrentRoute: () => Promise<any>;
14
+ getCurrentUrl: () => Promise<any>;
13
15
  };
14
16
  close: () => Promise<void>;
15
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-pw",
3
- "version": "2.93.0",
3
+ "version": "2.94.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@tinkoff/utils": "^2.1.2",
21
- "@tramvai/test-integration": "2.93.0",
22
- "@tramvai/tokens-router": "2.93.0",
21
+ "@tramvai/test-integration": "2.94.2",
22
+ "@tramvai/tokens-router": "2.94.2",
23
23
  "console-with-style": "^1.1.0",
24
24
  "supports-color": "8.1.1",
25
25
  "tslib": "^2.4.0"