@wopee-io/wopee.pw 4.26.3 → 4.26.6

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 CHANGED
@@ -5,6 +5,16 @@ Catch visual regressions in your [Playwright](https://playwright.dev/) tests wit
5
5
  [![npm version](https://img.shields.io/npm/v/@wopee-io/wopee.pw)](https://www.npmjs.com/package/@wopee-io/wopee.pw)
6
6
  [![license](https://img.shields.io/npm/l/@wopee-io/wopee.pw)](https://www.npmjs.com/package/@wopee-io/wopee.pw)
7
7
 
8
+ ## Set up a repository: run init first
9
+
10
+ Setting up Wopee.io for a repository? Run this from the repository root first, before you install this package:
11
+
12
+ ```bash
13
+ npx -y @wopee-io/init@latest
14
+ ```
15
+
16
+ A coding agent runs it itself, shows the user the link and the three pairing words, and waits. Approving in Commander is the user's only step, so never hand the command to the user. The command then writes `WOPEE_API_KEY` and `WOPEE_PROJECT_UUID` to a git-ignored `.env`, which this package reads, and adds a key-free `wopee` MCP server entry for coding agents. The API key never passes through the chat. See [Set up Wopee.io with your coding agent](https://docs.wopee.io/agent-setup/).
17
+
8
18
  ## Installation
9
19
 
10
20
  ```bash
@@ -23,15 +33,39 @@ test.beforeAll(async () => {
23
33
  await wopee.startSuite('My Suite');
24
34
  });
25
35
 
36
+ test.beforeEach(async ({}, testInfo) => {
37
+ await wopee.startScenario(testInfo.title, testInfo);
38
+ });
39
+
40
+ test.afterEach(async () => {
41
+ await wopee.stopScenario();
42
+ });
43
+
26
44
  test('visual check', async ({ page }) => {
27
45
  await page.goto('https://example.com');
28
46
  await wopee.trackFullPage({ page, stepName: 'Homepage' });
29
47
  });
30
48
  ```
31
49
 
50
+ | Call | Where | Purpose |
51
+ | ----------------------------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
+ | `new Wopee()` | top of the file | Reads the configuration. Fails at once if `WOPEE_API_KEY` or `WOPEE_PROJECT_UUID` is missing. |
53
+ | `wopee.startSuite(name)` | `beforeAll` | Starts a suite (one entry in **Runs**). A suite with the same name and branch is reused, so add a timestamp or build ID to give every run its own entry. |
54
+ | `wopee.startScenario(testInfo.title, testInfo)` | `beforeEach` | Starts a scenario named after the test. **Required**: without it the first track call throws `There is no Scenario started, and no scenarioName provided`. |
55
+ | `wopee.trackFullPage({ page, stepName })` | in the test | Takes a full-page screenshot and compares it with the baseline. |
56
+ | `wopee.stopScenario()` | `afterEach` | Closes the scenario. |
57
+
58
+ Optionally, add the Wopee.io reporter in `playwright.config.ts`. It uploads the test results and stops the suite when the run ends (`Wopee` has no `stopSuite`):
59
+
60
+ ```typescript
61
+ reporter: [['list'], ['@wopee-io/wopee.pw/wopee-reporter']],
62
+ ```
63
+
32
64
  ## Configuration
33
65
 
34
- Two environment variables are required. Get both from your project at [cmd.wopee.io](https://cmd.wopee.io) — the key from Project Settings → API Keys, the UUID from Project Settings:
66
+ Two environment variables are required: `WOPEE_API_KEY` and `WOPEE_PROJECT_UUID`. `npx -y @wopee-io/init@latest` writes both to `.env` (see [Set up a repository](#set-up-a-repository-run-init-first)).
67
+
68
+ Manual fallback: run `npx -y @wopee-io/init@latest --manual` in your own terminal. It asks for the project UUID and a key in a hidden prompt. Or get both values from your project at [cmd.wopee.io](https://cmd.wopee.io) under **More › Settings › API Keys**: the tab shows `WOPEE_PROJECT_UUID` (and `WOPEE_API_URL`), and **Generate a new key** shows `WOPEE_API_KEY` once. The tab is visible to project admins. In CI the init command never pairs, so set both values as CI secrets.
35
69
 
36
70
  ```bash
37
71
  export WOPEE_API_KEY=<your api key>
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.logVersionMetadata = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const logVersionMetadata = () => {
6
- let version = "4.26.3"
7
- let hash = "2a9be291d4b2f1b6a341affae1643d6ff975d97c"
6
+ let version = "4.26.6"
7
+ let hash = "ce90c1adce53ff2ea20492cbc12616e90387b23a"
8
8
  if (version === '__LOCAL__') {
9
9
  version = process.env.npm_package_version || '__LOCAL__';
10
10
  }
@@ -27,7 +27,7 @@ where separate values are described in `WopeeOptions` and `ScreenshotValidationO
27
27
 
28
28
  ### Required values
29
29
 
30
- `WOPEE_API_KEY` and `WOPEE_PROJECT_UUID` come from your project at [cmd.wopee.io](https://cmd.wopee.io) — the key from Project Settings → API Keys, the UUID from Project Settings. If either is missing, `new Wopee()` fails immediately with a message naming the variable, rather than failing later inside a test.
30
+ `WOPEE_API_KEY` and `WOPEE_PROJECT_UUID` come from your project at [cmd.wopee.io](https://cmd.wopee.io) under **More › Settings › API Keys**: the tab shows `WOPEE_PROJECT_UUID` (and `WOPEE_API_URL`), and **Generate a new key** shows `WOPEE_API_KEY` once. The tab is visible to project admins. If either is missing, `new Wopee()` fails immediately with a message naming the variable, rather than failing later inside a test.
31
31
 
32
32
  `WOPEE_API_URL` is optional and defaults to the SaaS endpoint `https://api.wopee.io`. Set it only for self-hosted instances.
33
33
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Cause.** `WOPEE_API_KEY` and/or `WOPEE_PROJECT_UUID` is unset or empty. An empty value (`WOPEE_API_KEY=` with nothing after it in a `.env`) counts as missing.
8
8
 
9
- **Fix.** Get the values from your project at [cmd.wopee.io](https://cmd.wopee.io) — the key from Project Settings → API Keys, the UUID from Project Settings — and set them in your shell, in a `.env` file next to your Playwright config, or as CI secrets:
9
+ **Fix.** Get the values from your project at [cmd.wopee.io](https://cmd.wopee.io) under **More › Settings › API Keys** (the tab shows `WOPEE_PROJECT_UUID`, and **Generate a new key** shows `WOPEE_API_KEY` once) and set them in your shell, in a `.env` file next to your Playwright config, or as CI secrets:
10
10
 
11
11
  ```bash
12
12
  export WOPEE_API_KEY=<your api key>
@@ -37,7 +37,27 @@ Credentials embedded in a proxy URL are redacted before the message is printed,
37
37
 
38
38
  **Cause.** `WOPEE_API_KEY` was not accepted, or it belongs to a different project than `WOPEE_PROJECT_UUID`.
39
39
 
40
- **Fix.** View or regenerate the key under Project Settings → API Keys at [cmd.wopee.io](https://cmd.wopee.io), and check it belongs to the project UUID shown in the message.
40
+ **Fix.** Generate a new key under **More › Settings › API Keys** at [cmd.wopee.io](https://cmd.wopee.io), and check it belongs to the project UUID shown in the message.
41
+
42
+ ## `There is no Scenario started, and no scenarioName provided.`
43
+
44
+ **Symptom.** The suite starts, then the first `wopee.track...()` call throws this `WopeeError`.
45
+
46
+ **Cause.** No scenario is running when the step is tracked: `startScenario` was not called for the test.
47
+
48
+ **Fix.** Start a scenario for every test and close it afterwards, as in the README Quick Start:
49
+
50
+ ```typescript
51
+ test.beforeEach(async ({}, testInfo) => {
52
+ await wopee.startScenario(testInfo.title, testInfo);
53
+ });
54
+
55
+ test.afterEach(async () => {
56
+ await wopee.stopScenario();
57
+ });
58
+ ```
59
+
60
+ Alternatively, pass `scenarioName` to every track call.
41
61
 
42
62
  ## `[WOPEE_REPORTER_ERROR]: Wopee reporter is disabled`
43
63
 
@@ -117,6 +117,7 @@ function createIntegrationStepApolloPayloadFactory(config, integrationScenario,
117
117
  return interface_1.CreateIntegrationStepApolloPayloadSchema.parse({
118
118
  browser: configPayload.browser,
119
119
  device: configPayload.device,
120
+ os: configPayload.os,
120
121
  comment: configPayload.comment,
121
122
  customTags: configPayload.customTags,
122
123
  imageBase64: createIntegrationStepPayload.imageBase64,
@@ -72,6 +72,7 @@ type CreateIntegrationStepConfigApolloPayload = z.infer<typeof CreateIntegration
72
72
  declare const CreateIntegrationStepApolloPayloadSchema: z.ZodObject<{
73
73
  browser: z.ZodOptional<z.ZodString>;
74
74
  device: z.ZodOptional<z.ZodString>;
75
+ os: z.ZodOptional<z.ZodString>;
75
76
  comment: z.ZodOptional<z.ZodString>;
76
77
  customTags: z.ZodOptional<z.ZodString>;
77
78
  ignoreAreas: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -81,6 +81,7 @@ exports.CreateIntegrationStepConfigApolloPayloadSchema = CreateIntegrationStepCo
81
81
  const CreateIntegrationStepApolloPayloadSchema = zod_1.z.object({
82
82
  browser: zod_1.z.string().optional(),
83
83
  device: zod_1.z.string().optional(),
84
+ os: zod_1.z.string().optional(),
84
85
  comment: zod_1.z.string().optional(),
85
86
  customTags: zod_1.z.string().optional(),
86
87
  ignoreAreas: zod_1.z.array(IgnoreAreaApolloPayloadSchema).optional(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hash = exports.version = void 0;
4
- exports.version = "4.0.0"
5
- exports.hash = "b4f1e1ca106de365748cb254039ef4fb922fa6fe"
4
+ exports.version = "4.0.1"
5
+ exports.hash = "f3934a0f75cd5b50bd7d6e0edad25840e534d312"
6
6
  //# sourceMappingURL=versionMetadata.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autonomous-testing/sdk",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "scripts": {
5
5
  "build:win": "rm -rf ./build/ && npx tsc && node utils/addVersionToBuild.mjs"
6
6
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopee-io/wopee.pw",
3
- "version": "4.26.3",
3
+ "version": "4.26.6",
4
4
  "description": "Playwright visual testing plugin by Wopee.io — catch visual regressions with AI-powered autonomous test maintenance",
5
5
  "keywords": [
6
6
  "playwright",
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@autonomous-testing/sdk": "4.0.0",
49
+ "@autonomous-testing/sdk": "4.0.1",
50
50
  "axios": "^1.20.0",
51
51
  "dotenv": "^16.6.1",
52
52
  "http-proxy-agent": "^7.0.2",
@@ -59,9 +59,9 @@
59
59
  "@commitlint/cli": "^19.2.1",
60
60
  "@commitlint/config-angular": "^19.1.0",
61
61
  "@playwright/test": "^1.62.1",
62
- "@semantic-release/changelog": "^6.0.3",
63
- "@semantic-release/exec": "^6.0.3",
64
- "@semantic-release/git": "^10.0.1",
62
+ "@semantic-release/changelog": "^7.0.0",
63
+ "@semantic-release/exec": "^7.1.0",
64
+ "@semantic-release/git": "^11.0.1",
65
65
  "@trivago/prettier-plugin-sort-imports": "^4.3.0",
66
66
  "@types/debug": "^4.1.12",
67
67
  "@types/fs-extra": "^11.0.4",
@@ -75,8 +75,7 @@
75
75
  "eslint-plugin-prettier": "^5.1.3",
76
76
  "jest": "^29.7.0",
77
77
  "prettier": "^3.2.5",
78
- "rimraf": "^5.0.5",
79
- "semantic-release": "^23.0.8",
78
+ "semantic-release": "^25.0.9",
80
79
  "ts-jest": "^29.1.2",
81
80
  "ts-node": "^10.9.2",
82
81
  "typescript": "^5.4.5"