@uuv/playwright 1.5.0 → 1.6.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
@@ -34,7 +34,7 @@ Make test writing fast, understandable by any human understanding English or Fre
34
34
  ## Benefits
35
35
  - If used correctly, integrates accessibility from the development stage
36
36
  - A living documentation is possible because we propose an unified language for developers and non-developers with a rich dictionary of ready-to-use sentences
37
- - A wizard that facilitates the writing of tests by suggesting the most accessible sentences
37
+ - [@uuv/assistant](https://www.npmjs.com/package/@uuv/assistant) that facilitates the writing of tests by suggesting the most accessible sentences
38
38
  - Integrates several runtime engines: Cypress / Playwright
39
39
  - User-friendly and standardized execution report
40
40
  ### <u>Comparison</u>
@@ -103,6 +103,7 @@ To write your first test, create the file `uuv/e2e/first-test.feature` in the pr
103
103
  ```
104
104
 
105
105
  For more details, please go to the documentation:
106
+
106
107
  <a href="https://e2e-test-quest.github.io/uuv/docs/test/first-test"><img src="https://img.shields.io/badge/Write%20test%20doc-red?&style=for-the-badge&logo=github&logoColor=white" alt="documentation for write test"/></a>
107
108
 
108
109
  ### Run test
@@ -135,6 +136,7 @@ yarn uuv e2e --browser=edge --env="{'TAGS':'@mobile'}" --generateHtmlReport
135
136
  ```
136
137
 
137
138
  For more details, please go to the documentation:
139
+
138
140
  <a href="https://e2e-test-quest.github.io/uuv/docs/test/running-test"><img src="https://img.shields.io/badge/Run%20test%20doc-red?&style=for-the-badge&logo=github&logoColor=white" alt="documentation for run test"/></a>
139
141
 
140
142
  ## License
@@ -35,9 +35,9 @@ const cucumber_1 = require("@cucumber/cucumber");
35
35
  });
36
36
  // TODO : permet de gérer les label accessibles donc pas que les aria : https://playwright.dev/docs/api/class-locator#locator-get-by-label
37
37
  (0, cucumber_1.When)(`${runner_commons_1.key.when.withinElement.ariaLabel}`, async function (expectedAriaLabel) {
38
- expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
39
- await (0, core_engine_1.getPageOrElement)(this).then((element) => (0, test_1.expect)(element.getByLabel(expectedAriaLabel)).toHaveCount(1));
40
- await (0, core_engine_1.addCookieWhenValueIsList)(this, core_engine_1.COOKIE_NAME.SELECTED_ELEMENT, { name: core_engine_1.FILTER_TYPE.ARIA_LABEL, value: expectedAriaLabel });
38
+ const sanitizedExpectedAriaLabel = encodeURIComponent(expectedAriaLabel).replaceAll("%20", " ");
39
+ await (0, core_engine_1.getPageOrElement)(this).then((element) => (0, test_1.expect)(element.getByLabel(sanitizedExpectedAriaLabel)).toHaveCount(1));
40
+ await (0, core_engine_1.addCookieWhenValueIsList)(this, core_engine_1.COOKIE_NAME.SELECTED_ELEMENT, { name: core_engine_1.FILTER_TYPE.ARIA_LABEL, value: sanitizedExpectedAriaLabel });
41
41
  });
42
42
  (0, cucumber_1.When)(`${runner_commons_1.key.when.resetContext}`, async function () {
43
43
  await this.context.clearCookies();
@@ -38,9 +38,9 @@ const cucumber_1 = require("@cucumber/cucumber");
38
38
  });
39
39
  // TODO : permet de gérer les label accessibles donc pas que les aria : https://playwright.dev/docs/api/class-locator#locator-get-by-label
40
40
  (0, cucumber_1.When)(`Within the element with aria-label {string}`, async function (expectedAriaLabel) {
41
- expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
42
- await (0, core_engine_1.getPageOrElement)(this).then((element) => (0, test_1.expect)(element.getByLabel(expectedAriaLabel)).toHaveCount(1));
43
- await (0, core_engine_1.addCookieWhenValueIsList)(this, core_engine_1.COOKIE_NAME.SELECTED_ELEMENT, { name: core_engine_1.FILTER_TYPE.ARIA_LABEL, value: expectedAriaLabel });
41
+ const sanitizedExpectedAriaLabel = encodeURIComponent(expectedAriaLabel).replaceAll("%20", " ");
42
+ await (0, core_engine_1.getPageOrElement)(this).then((element) => (0, test_1.expect)(element.getByLabel(sanitizedExpectedAriaLabel)).toHaveCount(1));
43
+ await (0, core_engine_1.addCookieWhenValueIsList)(this, core_engine_1.COOKIE_NAME.SELECTED_ELEMENT, { name: core_engine_1.FILTER_TYPE.ARIA_LABEL, value: sanitizedExpectedAriaLabel });
44
44
  });
45
45
  (0, cucumber_1.When)(`I reset context`, async function () {
46
46
  await this.context.clearCookies();
@@ -38,9 +38,9 @@ const cucumber_1 = require("@cucumber/cucumber");
38
38
  });
39
39
  // TODO : permet de gérer les label accessibles donc pas que les aria : https://playwright.dev/docs/api/class-locator#locator-get-by-label
40
40
  (0, cucumber_1.When)(`je vais à l'intérieur de l'élément ayant pour aria-label {string}`, async function (expectedAriaLabel) {
41
- expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
42
- await (0, core_engine_1.getPageOrElement)(this).then((element) => (0, test_1.expect)(element.getByLabel(expectedAriaLabel)).toHaveCount(1));
43
- await (0, core_engine_1.addCookieWhenValueIsList)(this, core_engine_1.COOKIE_NAME.SELECTED_ELEMENT, { name: core_engine_1.FILTER_TYPE.ARIA_LABEL, value: expectedAriaLabel });
41
+ const sanitizedExpectedAriaLabel = encodeURIComponent(expectedAriaLabel).replaceAll("%20", " ");
42
+ await (0, core_engine_1.getPageOrElement)(this).then((element) => (0, test_1.expect)(element.getByLabel(sanitizedExpectedAriaLabel)).toHaveCount(1));
43
+ await (0, core_engine_1.addCookieWhenValueIsList)(this, core_engine_1.COOKIE_NAME.SELECTED_ELEMENT, { name: core_engine_1.FILTER_TYPE.ARIA_LABEL, value: sanitizedExpectedAriaLabel });
44
44
  });
45
45
  (0, cucumber_1.When)(`je reinitialise le contexte`, async function () {
46
46
  await this.context.clearCookies();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/playwright",
3
- "version": "1.5.0",
3
+ "version": "1.6.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.",
@@ -65,9 +65,9 @@ When(`I click`, async function (this: World) {
65
65
 
66
66
  // TODO : permet de gérer les label accessibles donc pas que les aria : https://playwright.dev/docs/api/class-locator#locator-get-by-label
67
67
  When(`Within the element with aria-label {string}`, async function (this: World, expectedAriaLabel: string) {
68
- expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
69
- await getPageOrElement(this).then((element) => expect(element.getByLabel(expectedAriaLabel)).toHaveCount(1));
70
- await addCookieWhenValueIsList(this, COOKIE_NAME.SELECTED_ELEMENT, { name: FILTER_TYPE.ARIA_LABEL, value: expectedAriaLabel });
68
+ const sanitizedExpectedAriaLabel = encodeURIComponent(expectedAriaLabel).replaceAll("%20", " ");
69
+ await getPageOrElement(this).then((element) => expect(element.getByLabel(sanitizedExpectedAriaLabel)).toHaveCount(1));
70
+ await addCookieWhenValueIsList(this, COOKIE_NAME.SELECTED_ELEMENT, { name: FILTER_TYPE.ARIA_LABEL, value: sanitizedExpectedAriaLabel });
71
71
  });
72
72
  When(`I reset context`, async function (this: World) {
73
73
  await this.context.clearCookies();
@@ -65,9 +65,9 @@ When(`je clique`, async function (this: World) {
65
65
 
66
66
  // TODO : permet de gérer les label accessibles donc pas que les aria : https://playwright.dev/docs/api/class-locator#locator-get-by-label
67
67
  When(`je vais à l'intérieur de l'élément ayant pour aria-label {string}`, async function (this: World, expectedAriaLabel: string) {
68
- expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
69
- await getPageOrElement(this).then((element) => expect(element.getByLabel(expectedAriaLabel)).toHaveCount(1));
70
- await addCookieWhenValueIsList(this, COOKIE_NAME.SELECTED_ELEMENT, { name: FILTER_TYPE.ARIA_LABEL, value: expectedAriaLabel });
68
+ const sanitizedExpectedAriaLabel = encodeURIComponent(expectedAriaLabel).replaceAll("%20", " ");
69
+ await getPageOrElement(this).then((element) => expect(element.getByLabel(sanitizedExpectedAriaLabel)).toHaveCount(1));
70
+ await addCookieWhenValueIsList(this, COOKIE_NAME.SELECTED_ELEMENT, { name: FILTER_TYPE.ARIA_LABEL, value: sanitizedExpectedAriaLabel });
71
71
  });
72
72
  When(`je reinitialise le contexte`, async function (this: World) {
73
73
  await this.context.clearCookies();