allure-playwright 3.0.5 → 3.0.7

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 +60 -62
  2. package/package.json +15 -9
package/README.md CHANGED
@@ -12,12 +12,18 @@
12
12
 
13
13
  ---
14
14
 
15
+ ## The documentation and examples
16
+
17
+ The docs for Allure Playwright are available at [https://allurereport.org/docs/playwright/](https://allurereport.org/docs/playwright/).
18
+
19
+ Also, check out the examples at [github.com/allure-examples](https://github.com/orgs/allure-examples/repositories?q=visibility%3Apublic+archived%3Afalse+topic%3Aexample+topic%3Aplaywright).
20
+
15
21
  ## Installation
16
22
 
17
- Use your favorite node package manager to install the package:
23
+ Install `allure-playwright` using a package manager of your choice. For example:
18
24
 
19
- ```bash
20
- npm i -D allure-playwright
25
+ ```shell
26
+ npm install -D allure-playwright
21
27
  ```
22
28
 
23
29
  ## Usage
@@ -49,82 +55,74 @@ npx playwright test --reporter=line,allure-playwright
49
55
  ```
50
56
 
51
57
  When the test run completes, the result files will be generated in the `./allure-results`
52
- directory. If you want to use another location, provide it via the `resultsDir`
53
- reporter option ([see below](#allure-playwright-options)).
58
+ directory.
59
+
60
+ You may select another location, or further customize the reporter's behavior with [the configuration options](https://allurereport.org/docs/playwright-configuration/).
54
61
 
55
62
  ### View the report
56
63
 
57
- > [!NOTE]
58
- > You need Allure Report to generate and open the report from the result files. See the [installation instructions](https://allurereport.org/docs/install/) for more details.
64
+ > You need Allure Report to be installed on your machine to generate and open the report from the result files. See the [installation instructions](https://allurereport.org/docs/install/) on how to get it.
59
65
 
60
- Generate Allure Report:
66
+ Generate Allure Report after the tests are executed:
61
67
 
62
68
  ```bash
63
69
  allure generate ./allure-results -o ./allure-report
64
70
  ```
65
71
 
66
- Open Allure Report:
72
+ Open the generated report:
67
73
 
68
74
  ```bash
69
75
  allure open ./allure-report
70
76
  ```
71
77
 
72
- ## The documentation
73
-
74
- Learn more about Allure Playwright from the official documentation at
75
- [https://allurereport.org/docs/playwright/](https://allurereport.org/docs/playwright/).
78
+ ## Allure API
76
79
 
77
- ## Allure Playwright options
78
-
79
- Use following options to configure Allure Playwright:
80
-
81
- | Option | Description | Default |
82
- |-----------------|----------------------------------------------------------------------------------------------------------------------|--------------------|
83
- | resultsDir | The path of the results folder. | `./allure-results` |
84
- | detail | Hide the `pw:api` and `hooks` steps in report. | `true` |
85
- | suiteTitle | Use test title instead of `allure.suite()`. | `true` |
86
- | links | Allure Runtime API link templates. | `undefined` |
87
- | environmentInfo | A set of key-value pairs to display in the Environment section of the report | `undefined` |
88
- | categories | An array of category definitions, each describing a [category of defects](https://allurereport.org/docs/categories/) | `undefined` |
89
-
90
- Here is an example of the reporter configuration:
80
+ Enhance the report by utilizing the runtime API:
91
81
 
92
82
  ```js
93
- import { defineConfig } from '@playwright/test';
94
- import os from "node:os";
95
-
96
- export default defineConfig({
97
- reporter: [
98
- [
99
- "allure-playwright",
100
- {
101
- detail: true,
102
- resultsDir: "my-allure-results",
103
- suiteTitle: false,
104
- links: {
105
- link: {
106
- urlTemplate: "https://github.com/allure-framework/allure-js/blob/main/%s",
107
- },
108
- issue: {
109
- urlTemplate: "https://github.com/allure-framework/allure-js/issues/%s",
110
- nameTemplate: "ISSUE-%s",
111
- },
112
- },
113
- environmentInfo: {
114
- OS: os.platform(),
115
- Architecture: os.arch(),
116
- NodeVersion: process.version,
117
- },
118
- categories: [
119
- {
120
- name: "Missing file errors",
121
- messageRegex: /^ENOENT: no such file or directory/,
122
- },
123
- ],
124
- },
125
- ],
126
- ],
83
+ import { describe, test } from "playwright";
84
+ import * as allure from "allure-js-commons";
85
+
86
+ describe("signing in with a password", () => {
87
+ test("sign in with a valid password", async () => {
88
+ await allure.description("The test checks if an active user with a valid password can sign in to the app.");
89
+ await allure.epic("Signing in");
90
+ await allure.feature("Sign in with a password");
91
+ await allure.story("As an active user, I want to successfully sign in using a valid password");
92
+ await allure.tags("signin", "ui", "positive");
93
+ await allure.issue("https://github.com/allure-framework/allure-js/issues/331", "ISSUE-331");
94
+ await allure.owner("eroshenkoam");
95
+ await allure.parameter("browser", "chrome");
96
+
97
+ const user = await allure.step("Prepare the user", async () => {
98
+ return await createAnActiveUserInDb();
99
+ });
100
+
101
+ await allure.step("Make a sign-in attempt", async () => {
102
+ await allure.step("Navigate to the sign in page", async () => {
103
+ // ...
104
+ });
105
+
106
+ await allure.step("Fill the sign-in form", async (stepContext) => {
107
+ await stepContext.parameter("login", user.login);
108
+ await stepContext.parameter("password", user.password, "masked");
109
+
110
+ // ...
111
+ });
112
+
113
+ await allure.step("Submit the form", async () => {
114
+ // ...
115
+ // const responseData = ...
116
+
117
+ await allure.attachment("response", JSON.stringify(responseData), { contentType: "application/json" });
118
+ });
119
+ });
120
+
121
+ await allure.step("Assert the signed-in state", async () => {
122
+ // ...
123
+ });
124
+ });
127
125
  });
128
126
  ```
129
127
 
130
- More details about Allure Playwright configuration are available at [https://allurereport.org/docs/playwright-configuration/](https://allurereport.org/docs/playwright-configuration/).
128
+ More details about the API are available at [https://allurereport.org/docs/playwright-reference/](https://allurereport.org/docs/playwright-reference/).
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "allure-playwright",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Allure Playwright integration",
5
5
  "keywords": [
6
+ "allure",
6
7
  "playwright",
7
- "allure"
8
+ "html",
9
+ "test",
10
+ "report",
11
+ "reporter",
12
+ "testing",
13
+ "testops"
8
14
  ],
9
15
  "homepage": "https://allurereport.org/",
10
16
  "repository": {
@@ -20,18 +26,18 @@
20
26
  },
21
27
  "exports": {
22
28
  ".": {
23
- "require": "./dist/cjs/index.js",
24
29
  "types": "./dist/types/index.d.ts",
30
+ "require": "./dist/cjs/index.js",
25
31
  "default": "./dist/cjs/index.js"
26
32
  },
27
33
  "./testplan": {
28
- "require": "./dist/cjs/testplan.js",
29
34
  "types": "./dist/types/testplan.d.ts",
35
+ "require": "./dist/cjs/testplan.js",
30
36
  "default": "./dist/cjs/testplan.js"
31
37
  },
32
38
  "./autoconfig": {
33
- "require": "./dist/cjs/autoconfig.js",
34
39
  "types": "./dist/types/autoconfig.d.ts",
40
+ "require": "./dist/cjs/autoconfig.js",
35
41
  "default": "./dist/cjs/autoconfig.js"
36
42
  }
37
43
  },
@@ -55,7 +61,7 @@
55
61
  "test": "vitest run"
56
62
  },
57
63
  "dependencies": {
58
- "allure-js-commons": "3.0.5"
64
+ "allure-js-commons": "3.0.7"
59
65
  },
60
66
  "devDependencies": {
61
67
  "@babel/cli": "^7.24.6",
@@ -72,7 +78,7 @@
72
78
  "@typescript-eslint/eslint-plugin": "^8.0.0",
73
79
  "@typescript-eslint/parser": "^8.0.0",
74
80
  "allure-commandline": "^2.29.0",
75
- "allure-vitest": "3.0.5",
81
+ "allure-vitest": "3.0.7",
76
82
  "eslint": "^8.57.0",
77
83
  "eslint-config-prettier": "^9.1.0",
78
84
  "eslint-plugin-import": "^2.29.1",
@@ -80,10 +86,10 @@
80
86
  "eslint-plugin-n": "^17.10.1",
81
87
  "eslint-plugin-no-null": "^1.0.2",
82
88
  "eslint-plugin-prefer-arrow": "^1.2.3",
83
- "npm-run-all2": "^6.1.2",
89
+ "npm-run-all2": "^7.0.0",
84
90
  "rimraf": "^6.0.0",
85
91
  "typescript": "^5.2.2",
86
- "vitest": "^1.6.0"
92
+ "vitest": "^2.1.5"
87
93
  },
88
94
  "peerDependencies": {
89
95
  "@playwright/test": ">=1.36.0"