@stablyai/playwright-test 0.1.1 → 0.1.3
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/README.md +22 -0
- package/dist/index.d.mts +0 -10
- package/dist/index.d.ts +0 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
- package/src/index.ts +0 -50
- package/tsconfig.json +0 -19
- package/tsup.config.ts +0 -20
package/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Stably Playwright Test
|
2
|
+
This package extends Playwright to add new AI functionality
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
First ensure you remove any previous playwright/playwright-test installation
|
6
|
+
```shell
|
7
|
+
npm remove playwright @playwright/test
|
8
|
+
```
|
9
|
+
|
10
|
+
Afterwards you can install Stably
|
11
|
+
```shell
|
12
|
+
npm install @stablyai/playwright-test
|
13
|
+
```
|
14
|
+
|
15
|
+
## Setup
|
16
|
+
Make sure you also get your [api-key](https://auth.stably.ai/account/api_keys) to use the AI features.
|
17
|
+
Either set the `process.env.STABLY_API_KEY` variable or programtically call `setApiKey` from `"@stablyai/playwright-test"`
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
1. Replace "@playwright/test" with "@stablyai/playwright-test"
|
21
|
+
1. Ex: imports should look like: import { test, expect } from "@stablyai/playwright-test";
|
22
|
+
2. Simply run tests with `npx playwright test` as you would normally using Playwright
|
package/dist/index.d.mts
CHANGED
@@ -16,14 +16,4 @@ declare const expect: _stablyai_internal_playwright_test.Expect<{
|
|
16
16
|
}>;
|
17
17
|
}>;
|
18
18
|
|
19
|
-
declare module "@stablyai/internal-playwright-test" {
|
20
|
-
type ScreenshotPromptOptions = _stablyai_internal_playwright_test.PageAssertionsToHaveScreenshotOptions;
|
21
|
-
interface LocatorAssertions {
|
22
|
-
toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
|
23
|
-
}
|
24
|
-
interface PageAssertions {
|
25
|
-
toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
19
|
export { expect, test };
|
package/dist/index.d.ts
CHANGED
@@ -16,14 +16,4 @@ declare const expect: _stablyai_internal_playwright_test.Expect<{
|
|
16
16
|
}>;
|
17
17
|
}>;
|
18
18
|
|
19
|
-
declare module "@stablyai/internal-playwright-test" {
|
20
|
-
type ScreenshotPromptOptions = _stablyai_internal_playwright_test.PageAssertionsToHaveScreenshotOptions;
|
21
|
-
interface LocatorAssertions {
|
22
|
-
toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
|
23
|
-
}
|
24
|
-
interface PageAssertions {
|
25
|
-
toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
19
|
export { expect, test };
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"@stablyai/playwright-base\";\n\nimport {\n expect as playwrightExpect,\n test as playwrightTest,\n} from \"@stablyai/internal-playwright-test\";\n\nimport {\n augmentBrowser,\n augmentBrowserContext,\n augmentPage,\n stablyPlaywrightMatchers,\n} from \"@stablyai/playwright-base\";\n\nexport { setApiKey } from \"@stablyai/playwright-base\";\n\nexport const test: typeof playwrightTest = playwrightTest.extend({\n browser: async ({ browser }, use) => {\n await use(augmentBrowser(browser));\n },\n context: async ({ context }, use) => {\n await use(augmentBrowserContext(context));\n },\n page: async ({ page }, use) => {\n await use(augmentPage(page));\n },\n});\n\nexport const expect = playwrightExpect.extend(stablyPlaywrightMatchers);\n\nexport * from \"@stablyai/internal-playwright-test\";\n\
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"@stablyai/playwright-base\";\n\nimport {\n expect as playwrightExpect,\n test as playwrightTest,\n} from \"@stablyai/internal-playwright-test\";\n\nimport {\n augmentBrowser,\n augmentBrowserContext,\n augmentPage,\n stablyPlaywrightMatchers,\n} from \"@stablyai/playwright-base\";\n\nexport { setApiKey } from \"@stablyai/playwright-base\";\n\nexport const test: typeof playwrightTest = playwrightTest.extend({\n browser: async ({ browser }, use) => {\n await use(augmentBrowser(browser));\n },\n context: async ({ context }, use) => {\n await use(augmentBrowserContext(context));\n },\n page: async ({ page }, use) => {\n await use(augmentPage(page));\n },\n});\n\nexport const expect = playwrightExpect.extend(stablyPlaywrightMatchers);\n\nexport * from \"@stablyai/internal-playwright-test\";\n\n// declare module \"@stablyai/internal-playwright-test\" {\n// export type ScreenshotPromptOptions =\n// import(\"@stablyai/internal-playwright-test\").PageAssertionsToHaveScreenshotOptions;\n\n// interface LocatorAssertions {\n// toMatchScreenshotPrompt(\n// condition: string,\n// options?: ScreenshotPromptOptions\n// ): Promise<void>;\n// }\n\n// interface PageAssertions {\n// toMatchScreenshotPrompt(\n// condition: string,\n// options?: ScreenshotPromptOptions\n// ): Promise<void>;\n// }\n// }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAO;AAEP,sCAGO;AAEP,IAAAA,0BAKO;AAEP,IAAAA,0BAA0B;AAgB1B,0BAAc,+CA9Bd;AAgBO,IAAM,OAA8B,gCAAAC,KAAe,OAAO;AAAA,EAC/D,SAAS,OAAO,EAAE,QAAQ,GAAG,QAAQ;AACnC,UAAM,QAAI,wCAAe,OAAO,CAAC;AAAA,EACnC;AAAA,EACA,SAAS,OAAO,EAAE,QAAQ,GAAG,QAAQ;AACnC,UAAM,QAAI,+CAAsB,OAAO,CAAC;AAAA,EAC1C;AAAA,EACA,MAAM,OAAO,EAAE,KAAK,GAAG,QAAQ;AAC7B,UAAM,QAAI,qCAAY,IAAI,CAAC;AAAA,EAC7B;AACF,CAAC;AAEM,IAAM,SAAS,gCAAAC,OAAiB,OAAO,gDAAwB;","names":["import_playwright_base","playwrightTest","playwrightExpect"]}
|
package/dist/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"@stablyai/playwright-base\";\n\nimport {\n expect as playwrightExpect,\n test as playwrightTest,\n} from \"@stablyai/internal-playwright-test\";\n\nimport {\n augmentBrowser,\n augmentBrowserContext,\n augmentPage,\n stablyPlaywrightMatchers,\n} from \"@stablyai/playwright-base\";\n\nexport { setApiKey } from \"@stablyai/playwright-base\";\n\nexport const test: typeof playwrightTest = playwrightTest.extend({\n browser: async ({ browser }, use) => {\n await use(augmentBrowser(browser));\n },\n context: async ({ context }, use) => {\n await use(augmentBrowserContext(context));\n },\n page: async ({ page }, use) => {\n await use(augmentPage(page));\n },\n});\n\nexport const expect = playwrightExpect.extend(stablyPlaywrightMatchers);\n\nexport * from \"@stablyai/internal-playwright-test\";\n\
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"@stablyai/playwright-base\";\n\nimport {\n expect as playwrightExpect,\n test as playwrightTest,\n} from \"@stablyai/internal-playwright-test\";\n\nimport {\n augmentBrowser,\n augmentBrowserContext,\n augmentPage,\n stablyPlaywrightMatchers,\n} from \"@stablyai/playwright-base\";\n\nexport { setApiKey } from \"@stablyai/playwright-base\";\n\nexport const test: typeof playwrightTest = playwrightTest.extend({\n browser: async ({ browser }, use) => {\n await use(augmentBrowser(browser));\n },\n context: async ({ context }, use) => {\n await use(augmentBrowserContext(context));\n },\n page: async ({ page }, use) => {\n await use(augmentPage(page));\n },\n});\n\nexport const expect = playwrightExpect.extend(stablyPlaywrightMatchers);\n\nexport * from \"@stablyai/internal-playwright-test\";\n\n// declare module \"@stablyai/internal-playwright-test\" {\n// export type ScreenshotPromptOptions =\n// import(\"@stablyai/internal-playwright-test\").PageAssertionsToHaveScreenshotOptions;\n\n// interface LocatorAssertions {\n// toMatchScreenshotPrompt(\n// condition: string,\n// options?: ScreenshotPromptOptions\n// ): Promise<void>;\n// }\n\n// interface PageAssertions {\n// toMatchScreenshotPrompt(\n// condition: string,\n// options?: ScreenshotPromptOptions\n// ): Promise<void>;\n// }\n// }\n"],"mappings":";AAAA,OAAO;AAEP;AAAA,EACE,UAAU;AAAA,EACV,QAAQ;AAAA,OACH;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAgB1B,cAAc;AAdP,IAAM,OAA8B,eAAe,OAAO;AAAA,EAC/D,SAAS,OAAO,EAAE,QAAQ,GAAG,QAAQ;AACnC,UAAM,IAAI,eAAe,OAAO,CAAC;AAAA,EACnC;AAAA,EACA,SAAS,OAAO,EAAE,QAAQ,GAAG,QAAQ;AACnC,UAAM,IAAI,sBAAsB,OAAO,CAAC;AAAA,EAC1C;AAAA,EACA,MAAM,OAAO,EAAE,KAAK,GAAG,QAAQ;AAC7B,UAAM,IAAI,YAAY,IAAI,CAAC;AAAA,EAC7B;AACF,CAAC;AAEM,IAAM,SAAS,iBAAiB,OAAO,wBAAwB;","names":[]}
|
package/package.json
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "@stablyai/playwright-test",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.3",
|
4
4
|
"description": "Playwright Test wrapper with Stably AI matchers",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"bin": {
|
8
8
|
"playwright": "cli.js"
|
9
9
|
},
|
10
|
+
"files": [
|
11
|
+
"dist",
|
12
|
+
"cli.js"
|
13
|
+
],
|
10
14
|
"dependencies": {
|
11
|
-
"@stablyai/internal-playwright-test": "^0.1.
|
12
|
-
"@stablyai/playwright": "
|
13
|
-
"@stablyai/playwright-base": "
|
15
|
+
"@stablyai/internal-playwright-test": "^0.1.3",
|
16
|
+
"@stablyai/playwright": "latest",
|
17
|
+
"@stablyai/playwright-base": "latest"
|
14
18
|
},
|
15
19
|
"devDependencies": {
|
16
20
|
"tsup": "^8.5.0"
|
package/src/index.ts
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
import "@stablyai/playwright-base";
|
2
|
-
|
3
|
-
import {
|
4
|
-
expect as playwrightExpect,
|
5
|
-
test as playwrightTest,
|
6
|
-
} from "@stablyai/internal-playwright-test";
|
7
|
-
|
8
|
-
import {
|
9
|
-
augmentBrowser,
|
10
|
-
augmentBrowserContext,
|
11
|
-
augmentPage,
|
12
|
-
stablyPlaywrightMatchers,
|
13
|
-
} from "@stablyai/playwright-base";
|
14
|
-
|
15
|
-
export { setApiKey } from "@stablyai/playwright-base";
|
16
|
-
|
17
|
-
export const test: typeof playwrightTest = playwrightTest.extend({
|
18
|
-
browser: async ({ browser }, use) => {
|
19
|
-
await use(augmentBrowser(browser));
|
20
|
-
},
|
21
|
-
context: async ({ context }, use) => {
|
22
|
-
await use(augmentBrowserContext(context));
|
23
|
-
},
|
24
|
-
page: async ({ page }, use) => {
|
25
|
-
await use(augmentPage(page));
|
26
|
-
},
|
27
|
-
});
|
28
|
-
|
29
|
-
export const expect = playwrightExpect.extend(stablyPlaywrightMatchers);
|
30
|
-
|
31
|
-
export * from "@stablyai/internal-playwright-test";
|
32
|
-
|
33
|
-
declare module "@stablyai/internal-playwright-test" {
|
34
|
-
export type ScreenshotPromptOptions =
|
35
|
-
import("@stablyai/internal-playwright-test").PageAssertionsToHaveScreenshotOptions;
|
36
|
-
|
37
|
-
interface LocatorAssertions {
|
38
|
-
toMatchScreenshotPrompt(
|
39
|
-
condition: string,
|
40
|
-
options?: ScreenshotPromptOptions,
|
41
|
-
): Promise<void>;
|
42
|
-
}
|
43
|
-
|
44
|
-
interface PageAssertions {
|
45
|
-
toMatchScreenshotPrompt(
|
46
|
-
condition: string,
|
47
|
-
options?: ScreenshotPromptOptions,
|
48
|
-
): Promise<void>;
|
49
|
-
}
|
50
|
-
}
|
package/tsconfig.json
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "@tsconfig/node18/tsconfig.json",
|
3
|
-
"compilerOptions": {
|
4
|
-
"declaration": true,
|
5
|
-
"outDir": "./dist",
|
6
|
-
"rootDir": "src",
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
8
|
-
"resolveJsonModule": true,
|
9
|
-
"noEmit": true,
|
10
|
-
"moduleResolution": "bundler",
|
11
|
-
"module": "ESNext",
|
12
|
-
"baseUrl": ".",
|
13
|
-
"paths": {
|
14
|
-
"~/*": ["src/*"]
|
15
|
-
}
|
16
|
-
},
|
17
|
-
"include": ["src/**/*"],
|
18
|
-
"exclude": ["node_modules", "dist"]
|
19
|
-
}
|
package/tsup.config.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { defineConfig } from "tsup";
|
2
|
-
|
3
|
-
export default defineConfig({
|
4
|
-
entry: ["src/index.ts"],
|
5
|
-
format: ["cjs", "esm"],
|
6
|
-
splitting: false,
|
7
|
-
sourcemap: true,
|
8
|
-
clean: true,
|
9
|
-
dts: {
|
10
|
-
banner: 'import "@stablyai/playwright-base";',
|
11
|
-
},
|
12
|
-
target: "es2019",
|
13
|
-
outDir: "dist",
|
14
|
-
platform: "node",
|
15
|
-
external: [
|
16
|
-
"@playwright/test",
|
17
|
-
"@stablyai/playwright",
|
18
|
-
"@stablyai/playwright-base",
|
19
|
-
],
|
20
|
-
});
|