@stablyai/playwright-test 0.1.0
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.d.mts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +32 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +22 -0
- package/src/index.ts +50 -0
- package/tsconfig.json +9 -0
- package/tsup.config.ts +20 -0
package/dist/index.d.mts
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
import "@stablyai/playwright-base";
|
2
|
+
import * as _stablyai_playwright_base from '@stablyai/playwright-base';
|
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';
|
7
|
+
|
8
|
+
declare const test: typeof test$1;
|
9
|
+
declare const expect: _playwright_test.Expect<{
|
10
|
+
readonly toMatchScreenshotPrompt: (this: {
|
11
|
+
isNot: boolean;
|
12
|
+
message?: () => string;
|
13
|
+
}, received: _playwright_test.Page | _playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<{
|
14
|
+
pass: boolean;
|
15
|
+
message: () => string;
|
16
|
+
}>;
|
17
|
+
}>;
|
18
|
+
|
19
|
+
declare module '@playwright/test' {
|
20
|
+
type ScreenshotPromptOptions = _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
|
+
export { expect, test };
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
import "@stablyai/playwright-base";
|
2
|
+
import * as _stablyai_playwright_base from '@stablyai/playwright-base';
|
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';
|
7
|
+
|
8
|
+
declare const test: typeof test$1;
|
9
|
+
declare const expect: _playwright_test.Expect<{
|
10
|
+
readonly toMatchScreenshotPrompt: (this: {
|
11
|
+
isNot: boolean;
|
12
|
+
message?: () => string;
|
13
|
+
}, received: _playwright_test.Page | _playwright_test.Locator, condition: string, options?: _stablyai_playwright_base.ScreenshotPromptOptions) => Promise<{
|
14
|
+
pass: boolean;
|
15
|
+
message: () => string;
|
16
|
+
}>;
|
17
|
+
}>;
|
18
|
+
|
19
|
+
declare module '@playwright/test' {
|
20
|
+
type ScreenshotPromptOptions = _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
|
+
export { expect, test };
|
package/dist/index.js
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/index.ts
|
22
|
+
var index_exports = {};
|
23
|
+
__export(index_exports, {
|
24
|
+
expect: () => expect,
|
25
|
+
setApiKey: () => import_playwright_base3.setApiKey,
|
26
|
+
test: () => test
|
27
|
+
});
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
29
|
+
var import_playwright_base = require("@stablyai/playwright-base");
|
30
|
+
var import_test = require("@playwright/test");
|
31
|
+
var import_playwright_base2 = require("@stablyai/playwright-base");
|
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({
|
35
|
+
browser: async ({ browser }, use) => {
|
36
|
+
await use((0, import_playwright_base2.augmentBrowser)(browser));
|
37
|
+
},
|
38
|
+
context: async ({ context }, use) => {
|
39
|
+
await use((0, import_playwright_base2.augmentBrowserContext)(context));
|
40
|
+
},
|
41
|
+
page: async ({ page }, use) => {
|
42
|
+
await use((0, import_playwright_base2.augmentPage)(page));
|
43
|
+
}
|
44
|
+
});
|
45
|
+
var expect = import_test.expect.extend(import_playwright_base2.stablyPlaywrightMatchers);
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
47
|
+
0 && (module.exports = {
|
48
|
+
expect,
|
49
|
+
setApiKey,
|
50
|
+
test,
|
51
|
+
...require("@playwright/test")
|
52
|
+
});
|
53
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +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"]}
|
package/dist/index.mjs
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
// src/index.ts
|
2
|
+
import "@stablyai/playwright-base";
|
3
|
+
import {
|
4
|
+
expect as playwrightExpect,
|
5
|
+
test as playwrightTest
|
6
|
+
} from "@playwright/test";
|
7
|
+
import {
|
8
|
+
augmentBrowser,
|
9
|
+
augmentBrowserContext,
|
10
|
+
augmentPage,
|
11
|
+
stablyPlaywrightMatchers
|
12
|
+
} from "@stablyai/playwright-base";
|
13
|
+
import { setApiKey } from "@stablyai/playwright-base";
|
14
|
+
export * from "@playwright/test";
|
15
|
+
var test = playwrightTest.extend({
|
16
|
+
browser: async ({ browser }, use) => {
|
17
|
+
await use(augmentBrowser(browser));
|
18
|
+
},
|
19
|
+
context: async ({ context }, use) => {
|
20
|
+
await use(augmentBrowserContext(context));
|
21
|
+
},
|
22
|
+
page: async ({ page }, use) => {
|
23
|
+
await use(augmentPage(page));
|
24
|
+
}
|
25
|
+
});
|
26
|
+
var expect = playwrightExpect.extend(stablyPlaywrightMatchers);
|
27
|
+
export {
|
28
|
+
expect,
|
29
|
+
setApiKey,
|
30
|
+
test
|
31
|
+
};
|
32
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +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":[]}
|
package/package.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "@stablyai/playwright-test",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"description": "Playwright Test wrapper with Stably AI matchers",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"dependencies": {
|
8
|
+
"@stablyai/playwright": "^0.1.0",
|
9
|
+
"@stablyai/playwright-base": "^0.1.0"
|
10
|
+
},
|
11
|
+
"devDependencies": {
|
12
|
+
"tsup": "^8.5.0"
|
13
|
+
},
|
14
|
+
"peerDependencies": {
|
15
|
+
"@playwright/test": "^1.44.0",
|
16
|
+
"playwright": "^1.44.0",
|
17
|
+
"zod": "^3.0.0"
|
18
|
+
},
|
19
|
+
"scripts": {
|
20
|
+
"build": "tsup --config tsup.config.ts"
|
21
|
+
}
|
22
|
+
}
|
package/src/index.ts
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
import '@stablyai/playwright-base';
|
2
|
+
|
3
|
+
import {
|
4
|
+
expect as playwrightExpect,
|
5
|
+
test as playwrightTest,
|
6
|
+
} from '@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 '@playwright/test';
|
32
|
+
|
33
|
+
declare module '@playwright/test' {
|
34
|
+
export type ScreenshotPromptOptions =
|
35
|
+
import('@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
ADDED
package/tsup.config.ts
ADDED
@@ -0,0 +1,20 @@
|
|
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
|
+
});
|