@uxf/e2e-playwright 11.117.2 → 11.118.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/e2e-playwright",
3
- "version": "11.117.2",
3
+ "version": "11.118.0",
4
4
  "description": "UXF Playwright helpers",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,13 +18,13 @@
18
18
  "devDependencies": {
19
19
  "@playwright/test": "1.57.0",
20
20
  "@uxf/core": "11.114.0",
21
- "@uxf/ui": "11.117.2",
21
+ "@uxf/ui": "11.118.0",
22
22
  "dayjs": "^1.11.19"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@playwright/test": "1.57.0",
26
26
  "@uxf/core": "11.114.0",
27
- "@uxf/ui": "11.117.2",
27
+ "@uxf/ui": "11.118.0",
28
28
  "dayjs": "^1.11.19"
29
29
  }
30
30
  }
package/ui/button.e2e.js CHANGED
@@ -9,3 +9,12 @@ const components_1 = require("../components");
9
9
  await ui.button({ text: "Default" }).shouldExist();
10
10
  await ui.button({ text: "Not found" }).shouldNotExist();
11
11
  });
12
+ (0, test_1.test)("UI Button - parent scope", async ({ page }) => {
13
+ await page.goto("/examples/ui/button/OnlyForE2ETests");
14
+ const ui = (0, components_1.createUi)(page);
15
+ const cardA = page.getByTestId("card-a");
16
+ const cardB = page.getByTestId("card-b");
17
+ await ui.button({ parent: cardB, text: "Confirm" }).shouldExist();
18
+ await ui.button({ parent: cardA, text: "Confirm" }).click();
19
+ await ui.button({ parent: cardB, text: "Confirm" }).click();
20
+ });
package/ui/button.js CHANGED
@@ -4,8 +4,9 @@ exports.button = exports.ButtonModel = void 0;
4
4
  const base_model_1 = require("../utils/base-model");
5
5
  class ButtonModel extends base_model_1.BaseModel {
6
6
  constructor(page, finder) {
7
- var _a;
8
- const locator = page.locator("a.uxf-button", { hasText: finder.text }).nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0);
7
+ var _a, _b;
8
+ const root = (_a = finder.parent) !== null && _a !== void 0 ? _a : page;
9
+ const locator = root.locator("a.uxf-button", { hasText: finder.text }).nth((_b = finder.nth) !== null && _b !== void 0 ? _b : 0);
9
10
  super(page, locator);
10
11
  this.finder = finder;
11
12
  }
package/ui/combobox.js CHANGED
@@ -11,7 +11,6 @@ class ComboboxModel extends form_component_model_1.FormComponentModel {
11
11
  async change(value) {
12
12
  await this.inputLocator.fill(value);
13
13
  await this.page.locator("li.uxf-dropdown__item").filter({ hasText: value }).first().click();
14
- await this.page.locator("body").click();
15
14
  }
16
15
  }
17
16
  exports.ComboboxModel = ComboboxModel;