@flemist/simple-utils 2.1.4 → 2.1.5

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.
@@ -0,0 +1,2 @@
1
+ import { ElementHandle } from 'playwright';
2
+ export declare function clickAll(parent: ElementHandle, selector: string): Promise<void>;
@@ -0,0 +1,30 @@
1
+ import { Filters } from '../e2e/test';
2
+ import { IPool } from '@flemist/time-limits';
3
+ import { Priority } from '@flemist/priority-queue';
4
+ import { Browser, BrowserContextOptions, Page } from 'playwright';
5
+ import { IAbortSignalFast } from '@flemist/abort-controller-fast';
6
+ import { TestVariantsSetArgs } from '@flemist/test-variants';
7
+ export type TestE2eArgs = {
8
+ browser: Browser;
9
+ contextOptions: BrowserContextOptions;
10
+ /** just test name for logs */
11
+ name: string;
12
+ url: string;
13
+ /** error filters */
14
+ filters?: Filters;
15
+ pool: IPool;
16
+ priority?: Priority;
17
+ };
18
+ export type TestE2eFunc<Args = never> = (args: TestE2eArgs & Args, abortSignal?: null | IAbortSignalFast) => Promise<void>;
19
+ export type TestE2ePageArgs<Args> = {
20
+ page: Page;
21
+ url: string;
22
+ /** check http and js errors */
23
+ checkErrors: () => Promise<void>;
24
+ abortSignal: IAbortSignalFast;
25
+ /** custom test args */
26
+ args: Args;
27
+ };
28
+ export type TestE2ePageFunc<Args = never> = (args: TestE2ePageArgs<Args>) => Promise<void>;
29
+ export declare function createTestE2e<Args>(testPageFunc: TestE2ePageFunc<Args>): TestE2eFunc<Args>;
30
+ export declare function createTestE2eVariants<Args = never>(func: TestE2ePageFunc<Args>): TestVariantsSetArgs<TestE2eArgs & Args>;
@@ -0,0 +1,3 @@
1
+ export * from './common';
2
+ export * from './createTestE2e';
3
+ export * from './waitPageStable';
@@ -0,0 +1,35 @@
1
+ import { Page } from 'playwright';
2
+ /** At least one of `childList`, `attributes`, or `characterData` must be `true` */
3
+ export type WaitPageStableMutationOptions = {
4
+ /** Observe child element additions and removals */
5
+ childList?: null | boolean;
6
+ /** Observe attribute changes */
7
+ attributes?: null | boolean;
8
+ /** Observe text content changes */
9
+ characterData?: null | boolean;
10
+ /** Observe all descendants, not just direct children */
11
+ subtree?: null | boolean;
12
+ /** CSS selector of the target element. Default: document.documentElement */
13
+ selector?: null | string;
14
+ };
15
+ export type WaitPageStableResourceOptions = {
16
+ /** Observe resource loading (scripts, images, fonts, fetch, XHR, etc) */
17
+ resource?: null | boolean;
18
+ /** Observe navigation entries */
19
+ navigation?: null | boolean;
20
+ /** Observe paint entries */
21
+ paint?: null | boolean;
22
+ /** Observe long task entries */
23
+ longTask?: null | boolean;
24
+ };
25
+ export type WaitPageStableOptions = {
26
+ /** Milliseconds of no changes before resolving */
27
+ stableTime: number;
28
+ /** Maximum milliseconds to wait before throwing */
29
+ timeout: number;
30
+ /** MutationObserver options */
31
+ mutation?: null | WaitPageStableMutationOptions;
32
+ /** PerformanceObserver options */
33
+ resource?: null | WaitPageStableResourceOptions;
34
+ };
35
+ export declare function waitPageStable(page: Page, options: WaitPageStableOptions): Promise<void>;
@@ -1,2 +1,3 @@
1
1
  export * from './e2e';
2
+ export * from './helpers';
2
3
  export * from './refactor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flemist/simple-utils",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Simple simple utils",
5
5
  "sideEffects": false,
6
6
  "types": "build/common/index.d.ts",