Skip to content

Commit 8c2f4f2

Browse files
committed
fix: update screenshot, fix e2e
1 parent 1de71e5 commit 8c2f4f2

File tree

10 files changed

+85
-85
lines changed

10 files changed

+85
-85
lines changed
Loading

packages/pluggableWidgets/datagrid-dropdown-filter-web/e2e/DataGridDropDownFilter.spec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ test.describe("datagrid-dropdown-filter-web", () => {
2626

2727
test.describe("using enumeration as attribute", () => {
2828
test("shows the expected result", async ({ page }) => {
29-
await page.click(".mx-name-datagrid1 .mx-name-dataGridDrop_downFilter1");
30-
await page.waitForSelector(".widget-dropdown-filter-menu-slot > ul > li:nth-child(2)");
31-
await page.click(".widget-dropdown-filter-menu-slot > ul > li:nth-child(2)");
29+
await page.locator(".mx-name-datagrid1 .mx-name-dataGridDrop_downFilter1").click({ delay: 1 });
30+
await page.waitForSelector(".widget-dropdown-filter-menu-slot > ul > li:nth-child(1)");
31+
await page.locator(".widget-dropdown-filter-menu-slot > ul > li:nth-child(1)").click({ delay: 1 });
3232
await page.waitForTimeout(300); // wait for filter to apply
33-
await page.click("#DataGrid4-column0");
33+
await page.locator("#DataGrid4-column0").click({ delay: 1 });
3434
const cells = await page.$$eval(".mx-name-datagrid1 .td", elements =>
3535
elements.map(element => element.textContent)
3636
);
3737
await expect(cells).toEqual(["10", "test", "test", "Yes", ""]);
3838
});
3939

4040
test("shows the expected result with multiple selected items", async ({ page }) => {
41-
await page.click(".mx-name-datagrid1 .mx-name-dataGridDrop_downFilter1");
41+
await page.locator(".mx-name-datagrid1 .mx-name-dataGridDrop_downFilter1").click({ delay: 1 });
4242
await page.waitForSelector(".widget-dropdown-filter-menu-slot > ul > li:nth-child(2)");
43-
await page.click(".widget-dropdown-filter-menu-slot > ul > li:nth-child(2)");
43+
await page.locator(".widget-dropdown-filter-menu-slot > ul > li:nth-child(1)").click({ delay: 1 });
4444
await page.waitForSelector(".widget-dropdown-filter-menu-slot > ul > li:nth-child(3)");
45-
await page.click(".widget-dropdown-filter-menu-slot > ul > li:nth-child(3)");
45+
await page.locator(".widget-dropdown-filter-menu-slot > ul > li:nth-child(2)").click({ delay: 1 });
4646
await page.waitForTimeout(300); // wait for filter to apply
47-
await page.click("#DataGrid4-column0");
47+
await page.locator("#DataGrid4-column0").click({ delay: 1 });
4848
const cells = await page.$$eval(".mx-name-datagrid1 .td", elements =>
4949
elements.map(element => element.textContent)
5050
);
@@ -54,20 +54,20 @@ test.describe("datagrid-dropdown-filter-web", () => {
5454

5555
test.describe("using boolean as attribute", () => {
5656
test("shows the expected result", async ({ page }) => {
57-
await page.getByRole("combobox", { name: "Empty" }).click();
57+
await page.getByRole("combobox", { name: "Active column filter" }).click({ delay: 1 });
5858
const dropdownItem = await page.locator(".widget-dropdown-filter-menu-slot > ul > li:nth-child(3)");
5959
await expect(dropdownItem).toHaveText("No");
60-
await dropdownItem.click();
61-
await page.locator("#DataGrid4-column1").click();
60+
await dropdownItem.click({ delay: 1 });
61+
await page.locator("#DataGrid4-column1").click({ delay: 1 });
6262
const cells = await page.locator(".mx-name-datagrid1 .tr");
6363
expect(cells).toHaveCount(1);
6464
});
6565

6666
test("shows no results when no items selected", async ({ page }) => {
67-
await page.getByRole("combobox", { name: "Empty" }).click();
67+
await page.getByRole("combobox", { name: "Active column filter" }).click({ delay: 1 });
6868
const dropdownItem = await page.locator(".widget-dropdown-filter-menu-slot > ul > li:nth-child(1)"); //the first item means none selected
69-
await dropdownItem.click();
70-
await page.locator("#DataGrid4-column1").click();
69+
await dropdownItem.click({ delay: 1 });
70+
await page.locator("#DataGrid4-column1").click({ delay: 1 });
7171
const cells = await page.locator(".mx-name-datagrid1 .tr");
7272
expect(cells).toHaveCount(4);
7373
});
Loading

packages/pluggableWidgets/datagrid-dropdown-filter-web/e2e/DataGridDropDownFilterAssociation.spec.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test.describe("datagrid-dropdown-filter-web", () => {
1515
test("show list of Companies with empty option on top of the list", async ({ page }) => {
1616
const menu = () => page.locator("text=FMC Corp");
1717

18-
await page.locator(".mx-name-drop_downFilter2").click();
18+
await page.locator(".mx-name-drop_downFilter2").click({ delay: 1 });
1919
await expect(menu()).toBeVisible();
2020
const list = page.locator(".widget-dropdown-filter-menu-slot > ul > li");
2121
await expect(list).toHaveCount(21);
@@ -25,15 +25,15 @@ test.describe("datagrid-dropdown-filter-web", () => {
2525
});
2626

2727
test("set value after option is clicked", async ({ page }) => {
28-
const select = () => page.getByRole("columnheader", { name: "sort Company" }).getByLabel("Search");
28+
const select = () => page.getByRole("combobox", { name: "Company column filter" });
2929
const toggle = page.locator(".widget-dropdown-filter-toggle");
3030
const menu = () => page.locator("text=FMC Corp");
3131
const option1 = () => page.getByRole("option", { name: "Brown-Forman Corporation" });
32-
const clickOutside = async () => page.locator("body").click();
32+
const clickOutside = async () => page.locator("body").click({ delay: 1 });
3333

34-
await select().click();
34+
await select().click({ delay: 1 });
3535
await expect(menu()).toBeVisible();
36-
await option1().click();
36+
await option1().click({ delay: 1 });
3737
await expect(toggle.nth(3)).toHaveText("Brown-Forman Corporation");
3838
await clickOutside();
3939
await expect(menu()).not.toBeVisible();
@@ -45,25 +45,25 @@ test.describe("datagrid-dropdown-filter-web", () => {
4545

4646
test.describe("multiselect", () => {
4747
test("shows list of Roles", async ({ page }) => {
48-
const select = () => page.getByRole("columnheader", { name: "Roles" }).getByLabel("Search");
48+
const select = () => page.getByRole("combobox", { name: "Role column filter" });
4949
const menu = () => page.locator("text=Economist");
5050
const option1 = () => page.getByRole("option", { name: "Economist" });
5151
const option2 = () => page.getByRole("option", { name: "Public librarian" });
5252
const option3 = () => page.getByRole("option", { name: "Prison officer" });
5353

54-
await select().click();
54+
await select().click({ delay: 1 });
5555
await expect(menu().first()).toBeVisible();
5656
await expect(option1()).toBeVisible();
5757
await expect(option2()).toBeVisible();
5858
await expect(option3()).toBeVisible();
5959
});
6060

6161
test("does filtering when option is checked", async ({ page }) => {
62-
const select = () => page.getByRole("columnheader", { name: "Roles" }).getByLabel("Search");
62+
const select = () => page.getByRole("combobox", { name: "Role column filter" });
6363
const option2 = () => page.getByRole("option", { name: "Public librarian" });
6464

65-
await select().click();
66-
await option2().click();
65+
await select().click({ delay: 1 });
66+
await option2().click({ delay: 1 });
6767
const rows = page.locator(".mx-name-dataGrid21 .tr");
6868
await expect(rows).toHaveCount(5); // 4 rows + 1 header row
6969
});
@@ -73,9 +73,9 @@ test.describe("datagrid-dropdown-filter-web", () => {
7373
test("open menu with no options selected", async ({ page }) => {
7474
const select = () => page.locator(".mx-name-drop_downFilter1");
7575
const menu = () => page.getByRole("option", { name: "Environmental scientist" });
76-
const clickOutside = async () => (await page.locator("body")).click();
76+
const clickOutside = async () => (await page.locator("body")).click({ delay: 1 });
7777

78-
await select().click();
78+
await select().click({ delay: 1 });
7979
const checkedOptions = await menu().locator("input:checked");
8080
await expect(checkedOptions).toHaveCount(0);
8181
await clickOutside();
@@ -88,8 +88,8 @@ test.describe("datagrid-dropdown-filter-web", () => {
8888
const menu = () => page.getByRole("option", { name: "Environmental scientist" });
8989
const option1 = () => page.getByRole("option", { name: "Environmental scientist" });
9090

91-
await select().click();
92-
await option1().click();
91+
await select().click({ delay: 1 });
92+
await option1().click({ delay: 1 });
9393
const checkedOptions = await menu().locator("input:checked");
9494
await expect(checkedOptions).toHaveCount(1);
9595
await expect(checkedOptions.first()).toBeChecked();
@@ -106,9 +106,9 @@ test.describe("datagrid-dropdown-filter-web", () => {
106106
const option1 = () => page.getByRole("option", { name: "Environmental scientist" });
107107
const option2 = () => page.getByRole("option", { name: "Trader" });
108108

109-
await select().click();
110-
await option1().click();
111-
await option2().click();
109+
await select().click({ delay: 1 });
110+
await option1().click({ delay: 1 });
111+
await option2().click({ delay: 1 });
112112
const checkedOptions = await menu().locator("input:checked");
113113
await expect(checkedOptions).toHaveCount(2);
114114
await expect(checkedOptions.first()).toBeChecked();

packages/pluggableWidgets/datagrid-web/e2e/filtering/DataGridFilteringIntegration.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ test("datagrid-web filtering integration", async ({ page }) => {
2323

2424
await page.getByRole("columnheader", { name: "Birth date" }).getByRole("textbox").fill("1/1/1990");
2525
//await select("Birth date").fill("1/1/1990");
26-
await page.getByRole("columnheader", { name: "First name" }).getByRole("textbox").click();
26+
await page.getByRole("columnheader", { name: "First name" }).getByRole("textbox").click({ delay: 1 });
2727
await expect(await rows()).toHaveCount(14);
2828

2929
await page.getByRole("columnheader", { name: "Birth year" }).getByRole("textbox").fill("1995");
3030
await expect(await rows()).toHaveCount(9);
3131

32-
await page.getByRole("columnheader", { name: "Color (enum)" }).getByRole("combobox").click();
32+
await page.getByRole("columnheader", { name: "Color (enum)" }).getByRole("combobox").click({ delay: 1 });
3333
//await select("Color (enum)").click();
34-
await page.locator(`[role="option"]:has-text("Black")`).click();
34+
await page.locator(`[role="option"]:has-text("Black")`).click({ delay: 1 });
3535
//await option("Black").click();
3636
await expect(await rows()).toHaveCount(4);
3737

38-
await page.getByRole("columnheader", { name: "Roles (ref set)" }).getByRole("combobox").click();
38+
await page.getByRole("columnheader", { name: "Roles (ref set)" }).getByRole("combobox").click({ delay: 1 });
3939
//await select("Roles (ref set)").click();
40-
await page.locator(`[role="option"]:has-text("Careers adviser")`).click();
40+
await page.locator(`[role="option"]:has-text("Careers adviser")`).click({ delay: 1 });
4141
//await option("Careers adviser").click();
4242
await expect(await rows()).toHaveCount(3);
4343

44-
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click();
44+
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click({ delay: 1 });
4545
//await select("Company").click();
46-
await page.locator(`[role="option"]:has-text("Sierra Health Services Inc")`).click();
46+
await page.locator(`[role="option"]:has-text("Sierra Health Services Inc")`).click({ delay: 1 });
4747
//await option("Sierra Health Services Inc").click();
4848
await expect(await rows()).toHaveCount(2);
4949

packages/pluggableWidgets/datagrid-web/e2e/filtering/DataGridFilteringMulti.spec.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ test.describe("datagrid-web filtering multi select", () => {
1212
};
1313
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
1414
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
15-
const enumSelect = () => page.locator(".mx-name-drop_downFilter1 [role=combobox]");
15+
const enumSelect = () => page.locator(".mx-name-drop_downFilter1[role=combobox]");
1616
const rowCount = await rows();
1717
await page.goto("/p/filtering-multi");
1818
await page.waitForLoadState("networkidle");
1919
await expect(rowCount).toHaveCount(11);
2020
await expect(await column(2).first()).toHaveText("Black");
2121
await expect(await column(2).last()).toHaveText("Blue");
22-
await enumSelect().click();
23-
await option("Pink").click();
22+
await enumSelect().click({ delay: 1 });
23+
await option("Pink").click({ delay: 1 });
2424
await expect(await rows()).toHaveCount(6);
25-
await option("Blush").click();
25+
await option("Blush").click({ delay: 1 });
2626
await expect(await rows()).toHaveCount(8);
27-
await page.getByRole("columnheader", { name: "Color (enum)" }).getByRole("combobox").click();
27+
await page.getByRole("columnheader", { name: "Color (enum)" }).getByRole("combobox").click({ delay: 1 });
2828
const columnText = await column(2).allTextContents();
2929
await expect(columnText).toEqual(
3030
expect.arrayContaining(["Pink", "Pink", "Pink", "Blush", "Blush", "Pink", "Pink"])
@@ -37,7 +37,7 @@ test.describe("datagrid-web filtering multi select", () => {
3737
};
3838
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
3939
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
40-
const roleSelect = () => page.locator(".mx-name-drop_downFilter3 [role=combobox]");
40+
const roleSelect = () => page.locator(".mx-name-drop_downFilter3[role=combobox]");
4141
const expectedColumnText = [
4242
"EconomistArmed forces officerTraderHealth service manager",
4343
"EconomistArmed forces officerTrader",
@@ -52,12 +52,12 @@ test.describe("datagrid-web filtering multi select", () => {
5252
await page.goto("/p/filtering-multi");
5353
await page.waitForLoadState("networkidle");
5454
await expect(await column(3).first()).toHaveText(expectedColumnText[0]);
55-
await roleSelect().click();
56-
await option("Economist").click();
55+
await roleSelect().click({ delay: 1 });
56+
await option("Economist").click({ delay: 1 });
5757
await expect(await rows()).toHaveCount(6);
58-
await option("Public librarian").click();
58+
await option("Public librarian").click({ delay: 1 });
5959
await expect(await rows()).toHaveCount(10);
60-
await page.getByRole("columnheader", { name: "Roles (ref set)" }).getByRole("combobox").click();
60+
await page.getByRole("columnheader", { name: "Roles (ref set)" }).getByRole("combobox").click({ delay: 1 });
6161
const columnTexts = await column(3).allTextContents();
6262
expectedColumnText.forEach((text, index) => {
6363
expect(columnTexts[index]).toBe(text);
@@ -70,20 +70,20 @@ test.describe("datagrid-web filtering multi select", () => {
7070
};
7171
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
7272
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
73-
const companySelect = () => page.locator(".mx-name-drop_downFilter4 [role=combobox]");
73+
const companySelect = () => page.locator(".mx-name-drop_downFilter4[role=combobox]");
7474

7575
const rowCount = await rows();
7676
await page.goto("/p/filtering-multi");
7777
await page.waitForLoadState("networkidle");
7878
await expect(rowCount).toHaveCount(11);
7979
await expect(await column(4).first()).toHaveText("W.R. Berkley Corporation");
8080
await expect(await column(4).last()).toHaveText("PETsMART Inc");
81-
await companySelect().click();
82-
await option("FMC Corp").click();
81+
await companySelect().click({ delay: 1 });
82+
await option("FMC Corp").click({ delay: 1 });
8383
await expect(await rows()).toHaveCount(2);
84-
await option("ALLETE, Inc.").click();
84+
await option("ALLETE, Inc.").click({ delay: 1 });
8585
await expect(await rows()).toHaveCount(6);
86-
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click();
86+
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click({ delay: 1 });
8787
const columnText = await column(4).allTextContents();
8888
expect(columnText).toEqual(
8989
expect.arrayContaining(["ALLETE, Inc.", "FMC Corp", "ALLETE, Inc.", "ALLETE, Inc.", "ALLETE, Inc."])

0 commit comments

Comments
 (0)