@uuv/playwright 2.9.1 → 2.9.2

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.
@@ -195,7 +195,7 @@ async function checkTextContentLocator(locator, expectedTextContent) {
195
195
  catch (err) {
196
196
  console.error("No value found for locator: ", locator);
197
197
  try {
198
- await (0, test_1.expect)(await locator.getAttribute("value")).toBe(expectedTextContent);
198
+ await (0, test_1.expect)(locator).toHaveAttribute("value", expectedTextContent);
199
199
  }
200
200
  catch (err) {
201
201
  console.error("No attribute value found for locator: ", locator);
@@ -214,7 +214,7 @@ function getConfigDir() {
214
214
  (0, cucumber_1.Then)(`I should see an element with aria-label {string} and content {string}`, async function (expectedAriaLabel, expectedTextContent) {
215
215
  expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
216
216
  await (0, core_engine_1.getPageOrElement)(this).then(async (element) => {
217
- const byLabel = await element.getByLabel(expectedAriaLabel, { exact: true });
217
+ const byLabel = element.getByLabel(expectedAriaLabel, { exact: true });
218
218
  await (0, test_1.expect)(byLabel).toHaveCount(1);
219
219
  await (0, test_1.expect)(byLabel.filter({ hasText: expectedTextContent })).toHaveCount(1);
220
220
  });
@@ -240,7 +240,7 @@ function getConfigDir() {
240
240
  const attributeName = expectedAttribute[0];
241
241
  const attributeValue = expectedAttribute[1];
242
242
  // await showAttributesInLocator(element);
243
- (0, test_1.expect)(await element.getAttribute(attributeName)).toEqual(attributeValue);
243
+ await (0, test_1.expect)(element).toHaveAttribute(attributeName, attributeValue);
244
244
  }
245
245
  });
246
246
  });
@@ -288,7 +288,7 @@ async function pressKey(world, element, key) {
288
288
  }
289
289
  async function click(world, role, name) {
290
290
  await (0, core_engine_1.getPageOrElement)(world).then(async (element) => {
291
- const byRole = await element.getByRole(role, { name: name, includeHidden: true, exact: true });
291
+ const byRole = element.getByRole(role, { name: name, includeHidden: true, exact: true });
292
292
  await (0, test_1.expect)(byRole).toHaveCount(1);
293
293
  await byRole.click({ timeout: runner_commons_1.DEFAULT_TIMEOUT });
294
294
  await world.context.clearCookies();
@@ -214,7 +214,7 @@ function getConfigDir() {
214
214
  (0, cucumber_1.Then)(`je dois voir un élément ayant pour aria-label {string} et pour contenu {string}`, async function (expectedAriaLabel, expectedTextContent) {
215
215
  expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
216
216
  await (0, core_engine_1.getPageOrElement)(this).then(async (element) => {
217
- const byLabel = await element.getByLabel(expectedAriaLabel, { exact: true });
217
+ const byLabel = element.getByLabel(expectedAriaLabel, { exact: true });
218
218
  await (0, test_1.expect)(byLabel).toHaveCount(1);
219
219
  await (0, test_1.expect)(byLabel.filter({ hasText: expectedTextContent })).toHaveCount(1);
220
220
  });
@@ -240,7 +240,7 @@ function getConfigDir() {
240
240
  const attributeName = expectedAttribute[0];
241
241
  const attributeValue = expectedAttribute[1];
242
242
  // await showAttributesInLocator(element);
243
- (0, test_1.expect)(await element.getAttribute(attributeName)).toEqual(attributeValue);
243
+ await (0, test_1.expect)(element).toHaveAttribute(attributeName, attributeValue);
244
244
  }
245
245
  });
246
246
  });
@@ -288,7 +288,7 @@ async function pressKey(world, element, key) {
288
288
  }
289
289
  async function click(world, role, name) {
290
290
  await (0, core_engine_1.getPageOrElement)(world).then(async (element) => {
291
- const byRole = await element.getByRole(role, { name: name, includeHidden: true, exact: true });
291
+ const byRole = element.getByRole(role, { name: name, includeHidden: true, exact: true });
292
292
  await (0, test_1.expect)(byRole).toHaveCount(1);
293
293
  await byRole.click({ timeout: runner_commons_1.DEFAULT_TIMEOUT });
294
294
  await world.context.clearCookies();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/playwright",
3
- "version": "2.9.1",
3
+ "version": "2.9.2",
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 facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and playwright",
@@ -92,7 +92,7 @@
92
92
  "cross-env": "7.0.3",
93
93
  "eslint-plugin-cucumber": "2.0.0",
94
94
  "eslint-plugin-jest": "27.9.0",
95
- "eslint-plugin-playwright": "0.12.0",
95
+ "eslint-plugin-playwright": "0.22.2",
96
96
  "ts-loader": "9.4.2",
97
97
  "tsconfig-paths": "4.2.0",
98
98
  "webpack": "5.90.3"
@@ -313,7 +313,7 @@ Then(`I should not see an element with aria-label {string}`, async function(this
313
313
  Then(`I should see an element with aria-label {string} and content {string}`, async function(this: World, expectedAriaLabel: string, expectedTextContent: string) {
314
314
  expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
315
315
  await getPageOrElement(this).then(async (element) => {
316
- const byLabel = await element.getByLabel(expectedAriaLabel, { exact: true });
316
+ const byLabel = element.getByLabel(expectedAriaLabel, { exact: true });
317
317
  await expect(byLabel).toHaveCount(1);
318
318
  await expect(byLabel.filter({ hasText: expectedTextContent })).toHaveCount(1);
319
319
  });
@@ -343,7 +343,7 @@ Then(
343
343
  const attributeName = expectedAttribute[0];
344
344
  const attributeValue = expectedAttribute[1];
345
345
  // await showAttributesInLocator(element);
346
- expect(await element.getAttribute(attributeName)).toEqual(attributeValue);
346
+ await expect(element).toHaveAttribute(attributeName, attributeValue);
347
347
  }
348
348
  });
349
349
  }
@@ -398,7 +398,7 @@ async function pressKey(world: World, element: Locator, key: string) {
398
398
 
399
399
  async function click(world: World, role: any, name: string) {
400
400
  await getPageOrElement(world).then(async (element) => {
401
- const byRole = await element.getByRole(role, { name: name, includeHidden: true, exact: true });
401
+ const byRole = element.getByRole(role, { name: name, includeHidden: true, exact: true });
402
402
  await expect(byRole).toHaveCount(1);
403
403
  await byRole.click({ timeout: DEFAULT_TIMEOUT });
404
404
  await world.context.clearCookies();
@@ -313,7 +313,7 @@ Then(`je ne dois pas voir un élément ayant pour aria-label {string}`, async fu
313
313
  Then(`je dois voir un élément ayant pour aria-label {string} et pour contenu {string}`, async function(this: World, expectedAriaLabel: string, expectedTextContent: string) {
314
314
  expectedAriaLabel = encodeURIComponent(expectedAriaLabel);
315
315
  await getPageOrElement(this).then(async (element) => {
316
- const byLabel = await element.getByLabel(expectedAriaLabel, { exact: true });
316
+ const byLabel = element.getByLabel(expectedAriaLabel, { exact: true });
317
317
  await expect(byLabel).toHaveCount(1);
318
318
  await expect(byLabel.filter({ hasText: expectedTextContent })).toHaveCount(1);
319
319
  });
@@ -343,7 +343,7 @@ Then(
343
343
  const attributeName = expectedAttribute[0];
344
344
  const attributeValue = expectedAttribute[1];
345
345
  // await showAttributesInLocator(element);
346
- expect(await element.getAttribute(attributeName)).toEqual(attributeValue);
346
+ await expect(element).toHaveAttribute(attributeName, attributeValue);
347
347
  }
348
348
  });
349
349
  }
@@ -398,7 +398,7 @@ async function pressKey(world: World, element: Locator, key: string) {
398
398
 
399
399
  async function click(world: World, role: any, name: string) {
400
400
  await getPageOrElement(world).then(async (element) => {
401
- const byRole = await element.getByRole(role, { name: name, includeHidden: true, exact: true });
401
+ const byRole = element.getByRole(role, { name: name, includeHidden: true, exact: true });
402
402
  await expect(byRole).toHaveCount(1);
403
403
  await byRole.click({ timeout: DEFAULT_TIMEOUT });
404
404
  await world.context.clearCookies();