@stablyai/playwright-test 0.1.0 → 0.1.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/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ const { program } = require("@stablyai/internal-playwright-test");
2
+ program.parse(process.argv);
package/dist/index.d.mts CHANGED
@@ -1,23 +1,23 @@
1
1
  import "@stablyai/playwright-base";
2
2
  import * as _stablyai_playwright_base from '@stablyai/playwright-base';
3
3
  export { setApiKey } from '@stablyai/playwright-base';
4
- import * as _playwright_test from '@playwright/test';
5
- import { test as test$1 } from '@playwright/test';
6
- export * from '@playwright/test';
4
+ import * as _stablyai_internal_playwright_test from '@stablyai/internal-playwright-test';
5
+ import { test as test$1 } from '@stablyai/internal-playwright-test';
6
+ export * from '@stablyai/internal-playwright-test';
7
7
 
8
8
  declare const test: typeof test$1;
9
- declare const expect: _playwright_test.Expect<{
9
+ declare const expect: _stablyai_internal_playwright_test.Expect<{
10
10
  readonly toMatchScreenshotPrompt: (this: {
11
11
  isNot: boolean;
12
12
  message?: () => string;
13
- }, received: _playwright_test.Page | _playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<{
13
+ }, received: _stablyai_internal_playwright_test.Page | _stablyai_internal_playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<{
14
14
  pass: boolean;
15
15
  message: () => string;
16
16
  }>;
17
17
  }>;
18
18
 
19
- declare module '@playwright/test' {
20
- type ScreenshotPromptOptions = _playwright_test.PageAssertionsToHaveScreenshotOptions;
19
+ declare module "@stablyai/internal-playwright-test" {
20
+ type ScreenshotPromptOptions = _stablyai_internal_playwright_test.PageAssertionsToHaveScreenshotOptions;
21
21
  interface LocatorAssertions {
22
22
  toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
23
23
  }
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
1
1
  import "@stablyai/playwright-base";
2
2
  import * as _stablyai_playwright_base from '@stablyai/playwright-base';
3
3
  export { setApiKey } from '@stablyai/playwright-base';
4
- import * as _playwright_test from '@playwright/test';
5
- import { test as test$1 } from '@playwright/test';
6
- export * from '@playwright/test';
4
+ import * as _stablyai_internal_playwright_test from '@stablyai/internal-playwright-test';
5
+ import { test as test$1 } from '@stablyai/internal-playwright-test';
6
+ export * from '@stablyai/internal-playwright-test';
7
7
 
8
8
  declare const test: typeof test$1;
9
- declare const expect: _playwright_test.Expect<{
9
+ declare const expect: _stablyai_internal_playwright_test.Expect<{
10
10
  readonly toMatchScreenshotPrompt: (this: {
11
11
  isNot: boolean;
12
12
  message?: () => string;
13
- }, received: _playwright_test.Page | _playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<{
13
+ }, received: _stablyai_internal_playwright_test.Page | _stablyai_internal_playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<{
14
14
  pass: boolean;
15
15
  message: () => string;
16
16
  }>;
17
17
  }>;
18
18
 
19
- declare module '@playwright/test' {
20
- type ScreenshotPromptOptions = _playwright_test.PageAssertionsToHaveScreenshotOptions;
19
+ declare module "@stablyai/internal-playwright-test" {
20
+ type ScreenshotPromptOptions = _stablyai_internal_playwright_test.PageAssertionsToHaveScreenshotOptions;
21
21
  interface LocatorAssertions {
22
22
  toMatchScreenshotPrompt(condition: string, options?: ScreenshotPromptOptions): Promise<void>;
23
23
  }
package/dist/index.js CHANGED
@@ -27,11 +27,11 @@ __export(index_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(index_exports);
29
29
  var import_playwright_base = require("@stablyai/playwright-base");
30
- var import_test = require("@playwright/test");
30
+ var import_internal_playwright_test = require("@stablyai/internal-playwright-test");
31
31
  var import_playwright_base2 = require("@stablyai/playwright-base");
32
32
  var import_playwright_base3 = require("@stablyai/playwright-base");
33
- __reExport(index_exports, require("@playwright/test"), module.exports);
34
- var test = import_test.test.extend({
33
+ __reExport(index_exports, require("@stablyai/internal-playwright-test"), module.exports);
34
+ var test = import_internal_playwright_test.test.extend({
35
35
  browser: async ({ browser }, use) => {
36
36
  await use((0, import_playwright_base2.augmentBrowser)(browser));
37
37
  },
@@ -42,12 +42,12 @@ var test = import_test.test.extend({
42
42
  await use((0, import_playwright_base2.augmentPage)(page));
43
43
  }
44
44
  });
45
- var expect = import_test.expect.extend(import_playwright_base2.stablyPlaywrightMatchers);
45
+ var expect = import_internal_playwright_test.expect.extend(import_playwright_base2.stablyPlaywrightMatchers);
46
46
  // Annotate the CommonJS export names for ESM import in node:
47
47
  0 && (module.exports = {
48
48
  expect,
49
49
  setApiKey,
50
50
  test,
51
- ...require("@playwright/test")
51
+ ...require("@stablyai/internal-playwright-test")
52
52
  });
53
53
  //# sourceMappingURL=index.js.map
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 '@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 '@playwright/test';\n\ndeclare module '@playwright/test' {\n export type ScreenshotPromptOptions =\n import('@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,kBAGO;AAEP,IAAAA,0BAKO;AAEP,IAAAA,0BAA0B;AAgB1B,0BAAc,6BA9Bd;AAgBO,IAAM,OAA8B,YAAAC,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,YAAAC,OAAiB,OAAO,gDAAwB;","names":["import_playwright_base","playwrightTest","playwrightExpect"]}
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\ndeclare 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 CHANGED
@@ -3,7 +3,7 @@ import "@stablyai/playwright-base";
3
3
  import {
4
4
  expect as playwrightExpect,
5
5
  test as playwrightTest
6
- } from "@playwright/test";
6
+ } from "@stablyai/internal-playwright-test";
7
7
  import {
8
8
  augmentBrowser,
9
9
  augmentBrowserContext,
@@ -11,7 +11,7 @@ import {
11
11
  stablyPlaywrightMatchers
12
12
  } from "@stablyai/playwright-base";
13
13
  import { setApiKey } from "@stablyai/playwright-base";
14
- export * from "@playwright/test";
14
+ export * from "@stablyai/internal-playwright-test";
15
15
  var test = playwrightTest.extend({
16
16
  browser: async ({ browser }, use) => {
17
17
  await use(augmentBrowser(browser));
@@ -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 '@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 '@playwright/test';\n\ndeclare module '@playwright/test' {\n export type ScreenshotPromptOptions =\n import('@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":[]}
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\ndeclare 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,10 +1,14 @@
1
1
  {
2
2
  "name": "@stablyai/playwright-test",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Playwright Test wrapper with Stably AI matchers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "playwright": "cli.js"
9
+ },
7
10
  "dependencies": {
11
+ "@stablyai/internal-playwright-test": "^0.1.1",
8
12
  "@stablyai/playwright": "^0.1.0",
9
13
  "@stablyai/playwright-base": "^0.1.0"
10
14
  },
@@ -12,9 +16,7 @@
12
16
  "tsup": "^8.5.0"
13
17
  },
14
18
  "peerDependencies": {
15
- "@playwright/test": "^1.44.0",
16
- "playwright": "^1.44.0",
17
- "zod": "^3.0.0"
19
+ "zod": "^3.25.0 || ^4.0.0"
18
20
  },
19
21
  "scripts": {
20
22
  "build": "tsup --config tsup.config.ts"
package/src/index.ts CHANGED
@@ -1,18 +1,18 @@
1
- import '@stablyai/playwright-base';
1
+ import "@stablyai/playwright-base";
2
2
 
3
3
  import {
4
4
  expect as playwrightExpect,
5
5
  test as playwrightTest,
6
- } from '@playwright/test';
6
+ } from "@stablyai/internal-playwright-test";
7
7
 
8
8
  import {
9
9
  augmentBrowser,
10
10
  augmentBrowserContext,
11
11
  augmentPage,
12
12
  stablyPlaywrightMatchers,
13
- } from '@stablyai/playwright-base';
13
+ } from "@stablyai/playwright-base";
14
14
 
15
- export { setApiKey } from '@stablyai/playwright-base';
15
+ export { setApiKey } from "@stablyai/playwright-base";
16
16
 
17
17
  export const test: typeof playwrightTest = playwrightTest.extend({
18
18
  browser: async ({ browser }, use) => {
@@ -28,11 +28,11 @@ export const test: typeof playwrightTest = playwrightTest.extend({
28
28
 
29
29
  export const expect = playwrightExpect.extend(stablyPlaywrightMatchers);
30
30
 
31
- export * from '@playwright/test';
31
+ export * from "@stablyai/internal-playwright-test";
32
32
 
33
- declare module '@playwright/test' {
33
+ declare module "@stablyai/internal-playwright-test" {
34
34
  export type ScreenshotPromptOptions =
35
- import('@playwright/test').PageAssertionsToHaveScreenshotOptions;
35
+ import("@stablyai/internal-playwright-test").PageAssertionsToHaveScreenshotOptions;
36
36
 
37
37
  interface LocatorAssertions {
38
38
  toMatchScreenshotPrompt(
package/tsconfig.json CHANGED
@@ -1,9 +1,19 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
2
+ "extends": "@tsconfig/node18/tsconfig.json",
3
3
  "compilerOptions": {
4
+ "declaration": true,
5
+ "outDir": "./dist",
4
6
  "rootDir": "src",
5
- "outDir": "dist"
7
+ "forceConsistentCasingInFileNames": true,
8
+ "resolveJsonModule": true,
9
+ "noEmit": true,
10
+ "moduleResolution": "bundler",
11
+ "module": "ESNext",
12
+ "baseUrl": ".",
13
+ "paths": {
14
+ "~/*": ["src/*"]
15
+ }
6
16
  },
7
- "include": ["src"],
8
- "exclude": ["dist", "node_modules"]
9
- }
17
+ "include": ["src/**/*"],
18
+ "exclude": ["node_modules", "dist"]
19
+ }
package/tsup.config.ts CHANGED
@@ -1,20 +1,20 @@
1
- import { defineConfig } from 'tsup';
1
+ import { defineConfig } from "tsup";
2
2
 
3
3
  export default defineConfig({
4
- entry: ['src/index.ts'],
5
- format: ['cjs', 'esm'],
4
+ entry: ["src/index.ts"],
5
+ format: ["cjs", "esm"],
6
6
  splitting: false,
7
7
  sourcemap: true,
8
8
  clean: true,
9
9
  dts: {
10
10
  banner: 'import "@stablyai/playwright-base";',
11
11
  },
12
- target: 'es2019',
13
- outDir: 'dist',
14
- platform: 'node',
12
+ target: "es2019",
13
+ outDir: "dist",
14
+ platform: "node",
15
15
  external: [
16
- '@playwright/test',
17
- '@stablyai/playwright',
18
- '@stablyai/playwright-base',
16
+ "@playwright/test",
17
+ "@stablyai/playwright",
18
+ "@stablyai/playwright-base",
19
19
  ],
20
20
  });