@stablyai/playwright-test 2.0.12-rc.0 → 2.0.12-rc.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.cjs +2009 -2212
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -0
- package/dist/index.d.mts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.mjs +2010 -2214
- package/dist/index.mjs.map +1 -1
- package/dist/reporter.cjs +3093 -3604
- package/dist/reporter.cjs.map +1 -1
- package/dist/reporter.d.cts +3 -0
- package/dist/reporter.mjs +3099 -3609
- package/dist/reporter.mjs.map +1 -1
- package/package.json +23 -11
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import "@stablyai/playwright-base";
|
|
2
|
+
import * as _stablyai_playwright_base from '@stablyai/playwright-base';
|
|
3
|
+
import { Agent } from '@stablyai/playwright-base';
|
|
4
|
+
export { Agent, setApiKey } from '@stablyai/playwright-base';
|
|
5
|
+
import * as _playwright_test from '@playwright/test';
|
|
6
|
+
import { test as test$1, defineConfig as defineConfig$1 } from '@playwright/test';
|
|
7
|
+
export * from '@playwright/test';
|
|
8
|
+
import { StablyNotificationConfig } from '@stablyai/playwright-reporter';
|
|
9
|
+
export { NotificationResultPolicy, ProjectNotificationConfig, StablyEmailNotificationConfig, StablyNotificationConfig, StablyReporterOptions, StablySlackNotificationConfig, stablyReporter } from '@stablyai/playwright-reporter';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get the directory name from an import.meta.url.
|
|
13
|
+
* This is the ESM equivalent of __dirname.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { getDirname } from '@stablyai/playwright-test';
|
|
18
|
+
* const __dirname = getDirname(import.meta.url);
|
|
19
|
+
*
|
|
20
|
+
* // Use in tests for file paths
|
|
21
|
+
* await page.setInputFiles('input', path.join(__dirname, 'fixtures', 'file.pdf'));
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function getDirname(importMetaUrl: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the filename from an import.meta.url.
|
|
27
|
+
* This is the ESM equivalent of __filename.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { getFilename } from '@stablyai/playwright-test';
|
|
32
|
+
* const __filename = getFilename(import.meta.url);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function getFilename(importMetaUrl: string): string;
|
|
36
|
+
declare const test: typeof test$1;
|
|
37
|
+
declare const expect: _playwright_test.Expect<{
|
|
38
|
+
readonly toMatchScreenshotPrompt: (this: {
|
|
39
|
+
isNot: boolean;
|
|
40
|
+
message?: () => string;
|
|
41
|
+
}, received: _playwright_test.Page | _playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<_playwright_test.MatcherReturnType>;
|
|
42
|
+
}>;
|
|
43
|
+
|
|
44
|
+
type StablyProjectConfig = {
|
|
45
|
+
notifications?: StablyNotificationConfig;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Stably-enhanced defineConfig with typed support for stably notification configuration in projects.
|
|
49
|
+
* The `stably` property on projects is available via module augmentation of `@playwright/test`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { defineConfig, stablyReporter } from "@stablyai/playwright-test";
|
|
54
|
+
*
|
|
55
|
+
* export default defineConfig({
|
|
56
|
+
* reporter: [stablyReporter({ apiKey: "..." })],
|
|
57
|
+
* projects: [
|
|
58
|
+
* {
|
|
59
|
+
* name: "smoke",
|
|
60
|
+
* stably: {
|
|
61
|
+
* notifications: {
|
|
62
|
+
* slack: { channelName: "#alerts", notifyOnResult: "failures-only" },
|
|
63
|
+
* },
|
|
64
|
+
* },
|
|
65
|
+
* },
|
|
66
|
+
* ],
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare const defineConfig: typeof defineConfig$1;
|
|
71
|
+
declare module "@playwright/test" {
|
|
72
|
+
type ScreenshotPromptOptions = _playwright_test.PageAssertionsToHaveScreenshotOptions;
|
|
73
|
+
interface LocatorAssertions {
|
|
74
|
+
toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
interface PageAssertions {
|
|
77
|
+
toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
interface PlaywrightTestArgs {
|
|
80
|
+
agent: Agent;
|
|
81
|
+
}
|
|
82
|
+
interface Project {
|
|
83
|
+
stably?: StablyProjectConfig;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { type StablyProjectConfig, defineConfig, expect, getDirname, getFilename, test };
|
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,31 @@ export * from '@playwright/test';
|
|
|
8
8
|
import { StablyNotificationConfig } from '@stablyai/playwright-reporter';
|
|
9
9
|
export { NotificationResultPolicy, ProjectNotificationConfig, StablyEmailNotificationConfig, StablyNotificationConfig, StablyReporterOptions, StablySlackNotificationConfig, stablyReporter } from '@stablyai/playwright-reporter';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Get the directory name from an import.meta.url.
|
|
13
|
+
* This is the ESM equivalent of __dirname.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { getDirname } from '@stablyai/playwright-test';
|
|
18
|
+
* const __dirname = getDirname(import.meta.url);
|
|
19
|
+
*
|
|
20
|
+
* // Use in tests for file paths
|
|
21
|
+
* await page.setInputFiles('input', path.join(__dirname, 'fixtures', 'file.pdf'));
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function getDirname(importMetaUrl: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the filename from an import.meta.url.
|
|
27
|
+
* This is the ESM equivalent of __filename.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { getFilename } from '@stablyai/playwright-test';
|
|
32
|
+
* const __filename = getFilename(import.meta.url);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function getFilename(importMetaUrl: string): string;
|
|
11
36
|
declare const test: typeof test$1;
|
|
12
37
|
declare const expect: _playwright_test.Expect<{
|
|
13
38
|
readonly toMatchScreenshotPrompt: (this: {
|
|
@@ -59,4 +84,4 @@ declare module "@playwright/test" {
|
|
|
59
84
|
}
|
|
60
85
|
}
|
|
61
86
|
|
|
62
|
-
export { type StablyProjectConfig, defineConfig, expect, test };
|
|
87
|
+
export { type StablyProjectConfig, defineConfig, expect, getDirname, getFilename, test };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,31 @@ export * from '@playwright/test';
|
|
|
8
8
|
import { StablyNotificationConfig } from '@stablyai/playwright-reporter';
|
|
9
9
|
export { NotificationResultPolicy, ProjectNotificationConfig, StablyEmailNotificationConfig, StablyNotificationConfig, StablyReporterOptions, StablySlackNotificationConfig, stablyReporter } from '@stablyai/playwright-reporter';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Get the directory name from an import.meta.url.
|
|
13
|
+
* This is the ESM equivalent of __dirname.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { getDirname } from '@stablyai/playwright-test';
|
|
18
|
+
* const __dirname = getDirname(import.meta.url);
|
|
19
|
+
*
|
|
20
|
+
* // Use in tests for file paths
|
|
21
|
+
* await page.setInputFiles('input', path.join(__dirname, 'fixtures', 'file.pdf'));
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function getDirname(importMetaUrl: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the filename from an import.meta.url.
|
|
27
|
+
* This is the ESM equivalent of __filename.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { getFilename } from '@stablyai/playwright-test';
|
|
32
|
+
* const __filename = getFilename(import.meta.url);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function getFilename(importMetaUrl: string): string;
|
|
11
36
|
declare const test: typeof test$1;
|
|
12
37
|
declare const expect: _playwright_test.Expect<{
|
|
13
38
|
readonly toMatchScreenshotPrompt: (this: {
|
|
@@ -59,4 +84,4 @@ declare module "@playwright/test" {
|
|
|
59
84
|
}
|
|
60
85
|
}
|
|
61
86
|
|
|
62
|
-
export { type StablyProjectConfig, defineConfig, expect, test };
|
|
87
|
+
export { type StablyProjectConfig, defineConfig, expect, getDirname, getFilename, test };
|