@skbkontur/playwright-react-ui-components 1.13.0 → 1.13.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.
@@ -5,7 +5,11 @@ import type { InnerTextOptions } from '../options';
5
5
  export declare class Loader extends BaseComponent {
6
6
  constructor(rootLocator: Locator);
7
7
  getText(options?: InnerTextOptions): Promise<string>;
8
- waitLoading(): Promise<void>;
9
- waitLoaded(): Promise<void>;
8
+ waitLoading(options?: {
9
+ timeout?: number;
10
+ }): Promise<void>;
11
+ waitLoaded(options?: {
12
+ timeout?: number;
13
+ }): Promise<void>;
10
14
  expect(): LoaderAssertions;
11
15
  }
@@ -71,11 +71,11 @@ var Loader = /** @class */ (function (_super) {
71
71
  });
72
72
  });
73
73
  };
74
- Loader.prototype.waitLoading = function () {
74
+ Loader.prototype.waitLoading = function (options) {
75
75
  return __awaiter(this, void 0, void 0, function () {
76
76
  return __generator(this, function (_a) {
77
77
  switch (_a.label) {
78
- case 0: return [4 /*yield*/, this.waitFor()];
78
+ case 0: return [4 /*yield*/, this.waitFor(options)];
79
79
  case 1:
80
80
  _a.sent();
81
81
  return [2 /*return*/];
@@ -83,11 +83,11 @@ var Loader = /** @class */ (function (_super) {
83
83
  });
84
84
  });
85
85
  };
86
- Loader.prototype.waitLoaded = function () {
86
+ Loader.prototype.waitLoaded = function (options) {
87
87
  return __awaiter(this, void 0, void 0, function () {
88
88
  return __generator(this, function (_a) {
89
89
  switch (_a.label) {
90
- case 0: return [4 /*yield*/, this.waitFor({ state: 'hidden' })];
90
+ case 0: return [4 /*yield*/, this.waitFor({ state: 'hidden', timeout: options === null || options === void 0 ? void 0 : options.timeout })];
91
91
  case 1:
92
92
  _a.sent();
93
93
  return [2 /*return*/];
@@ -6,7 +6,11 @@ export declare class Spinner extends BaseComponent {
6
6
  readonly rootLocator: Locator;
7
7
  constructor(rootLocator: Locator);
8
8
  getText(options?: InnerTextOptions): Promise<string>;
9
- waitLoading(): Promise<void>;
10
- waitLoaded(): Promise<void>;
9
+ waitLoading(options?: {
10
+ timeout?: number;
11
+ }): Promise<void>;
12
+ waitLoaded(options?: {
13
+ timeout?: number;
14
+ }): Promise<void>;
11
15
  expect(): SpinnerAssertions;
12
16
  }
@@ -71,11 +71,11 @@ var Spinner = /** @class */ (function (_super) {
71
71
  });
72
72
  });
73
73
  };
74
- Spinner.prototype.waitLoading = function () {
74
+ Spinner.prototype.waitLoading = function (options) {
75
75
  return __awaiter(this, void 0, void 0, function () {
76
76
  return __generator(this, function (_a) {
77
77
  switch (_a.label) {
78
- case 0: return [4 /*yield*/, this.waitFor()];
78
+ case 0: return [4 /*yield*/, this.waitFor(options)];
79
79
  case 1:
80
80
  _a.sent();
81
81
  return [2 /*return*/];
@@ -83,11 +83,11 @@ var Spinner = /** @class */ (function (_super) {
83
83
  });
84
84
  });
85
85
  };
86
- Spinner.prototype.waitLoaded = function () {
86
+ Spinner.prototype.waitLoaded = function (options) {
87
87
  return __awaiter(this, void 0, void 0, function () {
88
88
  return __generator(this, function (_a) {
89
89
  switch (_a.label) {
90
- case 0: return [4 /*yield*/, this.waitFor({ state: 'hidden' })];
90
+ case 0: return [4 /*yield*/, this.waitFor({ state: 'hidden', timeout: options === null || options === void 0 ? void 0 : options.timeout })];
91
91
  case 1:
92
92
  _a.sent();
93
93
  return [2 /*return*/];
@@ -12,7 +12,7 @@ export declare const formattedMatchers: import("@playwright/test").Expect<{
12
12
  pass: boolean;
13
13
  name: string;
14
14
  expected: string;
15
- actual: any;
15
+ actual: unknown;
16
16
  }>;
17
17
  toHaveFormattedText(this: ExpectMatcherState, locator: Locator, expected: string, options?: {
18
18
  timeout?: number;
@@ -22,7 +22,7 @@ export declare const formattedMatchers: import("@playwright/test").Expect<{
22
22
  pass: boolean;
23
23
  name: string;
24
24
  expected: string;
25
- actual: any;
25
+ actual: unknown;
26
26
  }>;
27
27
  toContainFormattedText(this: ExpectMatcherState, locator: Locator, expected: string, options?: {
28
28
  timeout?: number;
@@ -32,6 +32,6 @@ export declare const formattedMatchers: import("@playwright/test").Expect<{
32
32
  pass: boolean;
33
33
  name: string;
34
34
  expected: string;
35
- actual: any;
35
+ actual: unknown;
36
36
  }>;
37
37
  }>;
@@ -72,28 +72,28 @@ function toHaveFormatted(getter, assertionName, context, strictExpect) {
72
72
  });
73
73
  });
74
74
  }
75
- var _a, timeout, _b, transform, pass, actual, e_1, message;
76
- return __generator(this, function (_c) {
77
- switch (_c.label) {
75
+ var _a, timeout, _b, transform, pass, actual, _c, message;
76
+ return __generator(this, function (_d) {
77
+ switch (_d.label) {
78
78
  case 0:
79
79
  _a = options || {}, timeout = _a.timeout, _b = _a.transform, transform = _b === void 0 ? removeSpaces : _b;
80
- _c.label = 1;
80
+ _d.label = 1;
81
81
  case 1:
82
- _c.trys.push([1, 6, , 7]);
82
+ _d.trys.push([1, 6, , 7]);
83
83
  if (!strictExpect) return [3 /*break*/, 3];
84
84
  return [4 /*yield*/, test_1.expect.poll(pollAndTransform, { timeout: timeout }).toEqual(transform(expected))];
85
85
  case 2:
86
- _c.sent();
86
+ _d.sent();
87
87
  return [3 /*break*/, 5];
88
88
  case 3: return [4 /*yield*/, test_1.expect.poll(pollAndTransform, { timeout: timeout }).toContain(transform(expected))];
89
89
  case 4:
90
- _c.sent();
91
- _c.label = 5;
90
+ _d.sent();
91
+ _d.label = 5;
92
92
  case 5:
93
93
  pass = true;
94
94
  return [3 /*break*/, 7];
95
95
  case 6:
96
- e_1 = _c.sent();
96
+ _c = _d.sent();
97
97
  pass = false;
98
98
  return [3 /*break*/, 7];
99
99
  case 7:
@@ -1,25 +1,15 @@
1
1
  import { type Expect, type Locator } from '@playwright/test';
2
2
  import type { TransformOptions } from '../options';
3
- export declare const mergedExpects: Expect<{
4
- toHaveFormattedValue(locator: Locator, expected: string, options?: TransformOptions): Promise<{
5
- message: () => string;
6
- pass: boolean;
7
- name: string;
8
- expected: string;
9
- actual: any;
10
- }>;
11
- toHaveFormattedText(locator: Locator, expected: string, options?: TransformOptions): Promise<{
12
- message: () => string;
13
- pass: boolean;
14
- name: string;
15
- expected: string;
16
- actual: any;
17
- }>;
18
- toContainFormattedText(locator: Locator, expected: string, options?: TransformOptions): Promise<{
19
- message: () => string;
20
- pass: boolean;
21
- name: string;
22
- expected: string;
23
- actual: any;
24
- }>;
3
+ export interface FormattedMatcherResult {
4
+ message: () => string;
5
+ pass: boolean;
6
+ name: string;
7
+ expected: string;
8
+ actual: unknown;
9
+ }
10
+ export type ExtendedExpect = Expect<{
11
+ toHaveFormattedValue(locator: Locator, expected: string, options?: TransformOptions): Promise<FormattedMatcherResult>;
12
+ toHaveFormattedText(locator: Locator, expected: string, options?: TransformOptions): Promise<FormattedMatcherResult>;
13
+ toContainFormattedText(locator: Locator, expected: string, options?: TransformOptions): Promise<FormattedMatcherResult>;
25
14
  }>;
15
+ export declare const mergedExpects: ExtendedExpect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/playwright-react-ui-components",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Пакет для взаимодействия с компонентами @skbkontur/react-ui при тестировании с помощью Playwright",
5
5
  "main": "build/index.js",
6
6
  "files": [
@@ -9,8 +9,9 @@
9
9
  "scripts": {
10
10
  "prepare": "npm run build",
11
11
  "build": "tsc",
12
- "lint:eslint": "run -T eslint --ext .ts,.tsx src --quiet",
13
- "lint:types": "run -T tsc --noEmit"
12
+ "lint:eslint": "eslint --ext .ts,.tsx src --quiet",
13
+ "lint:types": "tsc --noEmit",
14
+ "test": "echo 'no tests in components package'"
14
15
  },
15
16
  "author": "Evgeniy Ivanov (https://staff.skbkontur.ru/profile/sephiroth) & Fintech",
16
17
  "repository": {