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.
- package/README.md +60 -62
- 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
|
-
|
|
23
|
+
Install `allure-playwright` using a package manager of your choice. For example:
|
|
18
24
|
|
|
19
|
-
```
|
|
20
|
-
npm
|
|
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.
|
|
53
|
-
|
|
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
|
-
> [
|
|
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
|
|
72
|
+
Open the generated report:
|
|
67
73
|
|
|
68
74
|
```bash
|
|
69
75
|
allure open ./allure-report
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
##
|
|
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
|
-
|
|
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 {
|
|
94
|
-
import
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "Allure Playwright integration",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"allure",
|
|
6
7
|
"playwright",
|
|
7
|
-
"
|
|
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.
|
|
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.
|
|
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": "^
|
|
89
|
+
"npm-run-all2": "^7.0.0",
|
|
84
90
|
"rimraf": "^6.0.0",
|
|
85
91
|
"typescript": "^5.2.2",
|
|
86
|
-
"vitest": "^1.
|
|
92
|
+
"vitest": "^2.1.5"
|
|
87
93
|
},
|
|
88
94
|
"peerDependencies": {
|
|
89
95
|
"@playwright/test": ">=1.36.0"
|