@stablyai/playwright-test 0.1.1 → 0.1.2

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 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/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@stablyai/playwright-test",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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
15
  "@stablyai/internal-playwright-test": "^0.1.1",
12
16
  "@stablyai/playwright": "^0.1.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
- });