@uuv/playwright 1.4.2 → 1.5.0

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
@@ -90,7 +90,7 @@ yarn add -D @uuv/playwright
90
90
  ## Usage
91
91
 
92
92
  ### Scenarios example
93
- You can find test examples here : [google.feature](https://github.com/e2e-test-quest/uuv/blob/main/example/google.fr.feature)
93
+ You can find test examples here : [weather-app.feature](https://github.com/e2e-test-quest/uuv/blob/main/example/weather-app.feature)
94
94
 
95
95
  ### Write test
96
96
  To write your first test, create the file `uuv/e2e/first-test.feature` in the project root with the following content :
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/playwright",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "type": "commonjs",
5
5
  "author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
6
6
  "description": "A solution to run E2E tests written in cucumber(BDD) with playwright.",
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "@cucumber/cucumber": "9.1.2",
48
48
  "@playwright/test": "1.33.0",
49
- "@uuv/runner-commons": "1.4.1",
49
+ "@uuv/runner-commons": "1.5.0",
50
50
  "axe-core": "4.7.0",
51
51
  "axe-playwright": "1.2.3",
52
52
  "chalk": "4.1.2",
@@ -55,7 +55,7 @@
55
55
  "figlet": "1.6.0",
56
56
  "minimist": "1.2.8",
57
57
  "multiple-cucumber-html-reporter": "3.3.0",
58
- "nanoid": "3.1.22",
58
+ "nanoid": "3.1.31",
59
59
  "ts-node": "10.9.1",
60
60
  "typescript": "4.9.5"
61
61
  },
@@ -71,6 +71,7 @@
71
71
  "postinstall.js",
72
72
  "target-config/**/*",
73
73
  "src/cucumber/step_definitions/playwright/generated/**/*",
74
+ "src/cucumber/step_definitions/playwright/unsafe/**/*",
74
75
  "*.md",
75
76
  ".npmignore"
76
77
  ],
@@ -22,6 +22,7 @@ import { DEFAULT_TIMEOUT, fs, key } from "@uuv/runner-commons";
22
22
  import { checkA11y, injectAxe } from "axe-playwright";
23
23
  import { Locator } from "playwright";
24
24
  import { devices, expect } from "@playwright/test";
25
+ import { Page } from "playwright";
25
26
  import { DataTable } from "@cucumber/cucumber";
26
27
  import {
27
28
  addCookieWhenValueIsList,
@@ -183,8 +184,8 @@ Then(`I should not see an element with testId {string}`, async function(this: Wo
183
184
  Then(
184
185
  `I should not have any accessibility issue`,
185
186
  async function (this: World) {
186
- await injectAxe(this.page);
187
- await checkA11y(this.page);
187
+ await injectAxe(this.page as Page);
188
+ await checkA11y(this.page as Page);
188
189
  });
189
190
 
190
191
  Then(
@@ -22,6 +22,7 @@ import { DEFAULT_TIMEOUT, fs, key } from "@uuv/runner-commons";
22
22
  import { checkA11y, injectAxe } from "axe-playwright";
23
23
  import { Locator } from "playwright";
24
24
  import { devices, expect } from "@playwright/test";
25
+ import { Page } from "playwright";
25
26
  import { DataTable } from "@cucumber/cucumber";
26
27
  import {
27
28
  addCookieWhenValueIsList,
@@ -183,8 +184,8 @@ Then(`je ne dois pas voir un élément ayant pour testId {string}`, async functi
183
184
  Then(
184
185
  `je ne dois pas avoir de problèmes d'accessibilité`,
185
186
  async function (this: World) {
186
- await injectAxe(this.page);
187
- await checkA11y(this.page);
187
+ await injectAxe(this.page as Page);
188
+ await checkA11y(this.page as Page);
188
189
  });
189
190
 
190
191
  Then(
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright UUV.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { When } from "@cucumber/cucumber";
18
+ import { World } from "../../../preprocessor/run/world";
19
+
20
+ When("je suis une phrase custom qui vérifie l'existence d'un noeud par le sélecteur {string}", async function (this: World, selector: string) {
21
+ await this.page.locator(selector);
22
+ });
23
+