@test2doc/playwright 0.13.1 → 0.14.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.
Files changed (2) hide show
  1. package/README.md +8 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -97,14 +97,14 @@ The `TEST2DOC=true` is required to activate the test2doc metadata to pass to the
97
97
  ...
98
98
  "scripts": {
99
99
  ...
100
- "docs:generate": "TEST2DOC=true playwright test --config=playwright-test2doc.config.ts"
100
+ "doc:gen": "TEST2DOC=true playwright test --config=playwright-test2doc.config.ts"
101
101
  }
102
102
  ...
103
103
  }
104
104
  ```
105
105
 
106
106
  ## Verify installation
107
- To verify your setup works, run `npm run docs:generate` and check that markdown files appear in your `./doc/docs` directory, or wherever you specified the output directory in the `playwright-test2doc.config.ts` file.
107
+ To verify your setup works, run `npm run doc:gen` and check that markdown files appear in your `./doc/docs` directory, or wherever you specified the output directory in the `playwright-test2doc.config.ts` file.
108
108
 
109
109
  ## Filtering Tests
110
110
  It is possible you may wish to opt-in some tests or opt-out other tests from doc generation. This is possible with playwright tags.
@@ -151,7 +151,7 @@ Run only tests with the `@test2doc` tag.
151
151
  ...
152
152
  "scripts": {
153
153
  ...
154
- "docs:generate": "TEST2DOC=true playwright test --config=playwright-test2doc.config.ts --grep @test2doc"
154
+ "doc:gen": "TEST2DOC=true playwright test --config=playwright-test2doc.config.ts --grep @test2doc"
155
155
  }
156
156
  ...
157
157
  }
@@ -168,7 +168,7 @@ Skip tests with the `@skip-docs` tag.
168
168
  ...
169
169
  "scripts": {
170
170
  ...
171
- "docs:generate": "TEST2DOC=true playwright test --config=playwright-test2doc.config.ts --grep-invert @skip-docs"
171
+ "doc:gen": "TEST2DOC=true playwright test --config=playwright-test2doc.config.ts --grep-invert @skip-docs"
172
172
  }
173
173
  ...
174
174
  }
@@ -361,9 +361,9 @@ To style the highlight and label we expose a few properties on the `annotation`
361
361
  - **Default**: `2`
362
362
 
363
363
  - **`position`**:
364
- - **Type**: `"above" | "below" | "left" | "right"`
365
- - **Description**: Determines the position of the label text relative to the highlighted element.
366
- - **Default**: `"below"` - automatically repositioned if insufficient space below the element.
364
+ - **Type**: `"above" | "below" | "left" | "right" | number`
365
+ - **Description**: Determines the position of the label text relative to the highlighted element. Uses clock convention where 0° = top, 90° = right, etc. If a number is provided, it positions the label at that degree angle. Defaults to automatically positioning towards the screen center.
366
+ - **Default**: Automatically positions label towards the center of the screen.
367
367
  - **`showArrow`**:
368
368
  - **Type**: `boolean`
369
369
  - **Description**: Whether to display an arrow pointing from the label to the highlighted element. When enabled, creates a visual connection between the annotation text and the target element.
@@ -439,7 +439,6 @@ export default defineConfig({
439
439
  })
440
440
  ```
441
441
 
442
-
443
442
  #### Highlight multiple elements
444
443
  In the event that you need to highlight multiple elements, you can pass in an array with `MultiLocatorScreenshot` objects.
445
444
 
@@ -469,7 +468,7 @@ test.describe(withDocMeta("describe block"), async () => {
469
468
  options: {
470
469
  annotation: {
471
470
  text: "Sidebar Element",
472
- position: "left",
471
+ position: 270,
473
472
  showArrow: true,
474
473
  arrowStrokeStyle: "red",
475
474
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@test2doc/playwright",
3
- "version": "0.13.1",
3
+ "version": "0.14.1",
4
4
  "description": "A reporter that generates docs based off playwright test files",
5
5
  "keywords": [
6
6
  "documentation",