Skip to content

Commit 8b37ec3

Browse files
committed
chore: more e2e fixes
1 parent d19bd5e commit 8b37ec3

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ test("datagrid-web filtering integration", async ({ page }) => {
3131

3232
await page.getByRole("columnheader", { name: "Color (enum)" }).getByRole("combobox").click();
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

3838
await page.getByRole("columnheader", { name: "Roles (ref set)" }).getByRole("combobox").click();
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

4444
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click();
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: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ 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");
2222
await enumSelect().click();
23-
await option("Pink").click();
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);
2727
await page.getByRole("columnheader", { name: "Color (enum)" }).getByRole("combobox").click();
2828
const columnText = await column(2).allTextContents();
@@ -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",
@@ -53,11 +53,12 @@ test.describe("datagrid-web filtering multi select", () => {
5353
await page.waitForLoadState("networkidle");
5454
await expect(await column(3).first()).toHaveText(expectedColumnText[0]);
5555
await roleSelect().click();
56-
await option("Economist").click();
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 roleSelect().click();
60+
await roleSelect().click({ delay: 1 });
61+
await page.waitForTimeout(300);
6162
const columnTexts = await column(3).allTextContents();
6263
expectedColumnText.forEach((text, index) => {
6364
expect(columnTexts[index]).toBe(text);
@@ -70,20 +71,21 @@ test.describe("datagrid-web filtering multi select", () => {
7071
};
7172
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
7273
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
73-
const companySelect = () => page.locator(".mx-name-drop_downFilter4 [role=combobox]");
74+
const companySelect = () => page.locator(".mx-name-drop_downFilter4[role=combobox]");
7475

7576
const rowCount = await rows();
7677
await page.goto("/p/filtering-multi");
7778
await page.waitForLoadState("networkidle");
7879
await expect(rowCount).toHaveCount(11);
7980
await expect(await column(4).first()).toHaveText("W.R. Berkley Corporation");
8081
await expect(await column(4).last()).toHaveText("PETsMART Inc");
81-
await companySelect().click();
82-
await option("FMC Corp").click();
82+
await companySelect().click({ delay: 1 });
83+
await option("FMC Corp").click({ delay: 1 });
8384
await expect(await rows()).toHaveCount(2);
84-
await option("ALLETE, Inc.").click();
85+
await option("ALLETE, Inc.").click({ delay: 1 });
8586
await expect(await rows()).toHaveCount(6);
86-
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click();
87+
await page.getByRole("columnheader", { name: "Company" }).getByRole("combobox").click({ delay: 1 });
88+
await page.waitForTimeout(300);
8789
const columnText = await column(4).allTextContents();
8890
expect(columnText).toEqual(
8991
expect.arrayContaining(["ALLETE, Inc.", "FMC Corp", "ALLETE, Inc.", "ALLETE, Inc.", "ALLETE, Inc."])

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ test.describe("datagrid-web filtering single select", () => {
2525
};
2626
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
2727
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
28-
const booleanSelect = () => page.locator(".mx-name-drop_downFilter2").getByRole("combobox");
28+
const booleanSelect = () => page.locator('.mx-name-drop_downFilter2[role="combobox"]');
2929

3030
await booleanSelect().click();
31-
await option("Yes").click();
31+
await option("Yes").click({ delay: 1 });
3232
const rowCount = await rows();
3333
await expect(rowCount).toHaveCount(11);
3434
const columnTexts = await column(3).allTextContents();
@@ -40,7 +40,7 @@ test.describe("datagrid-web filtering single select", () => {
4040
return page.locator('.mx-name-dataGrid21 [role="row"]');
4141
};
4242
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
43-
const booleanSelect = () => page.locator(".mx-name-drop_downFilter2").getByRole("combobox");
43+
const booleanSelect = () => page.locator('.mx-name-drop_downFilter2[role="combobox"]');
4444

4545
await booleanSelect().click();
4646

@@ -57,10 +57,10 @@ test.describe("datagrid-web filtering single select", () => {
5757
};
5858
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
5959
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
60-
const booleanSelect = () => page.locator(".mx-name-drop_downFilter2").getByRole("combobox");
60+
const booleanSelect = () => page.locator('.mx-name-drop_downFilter2[role="combobox"]');
6161

6262
await booleanSelect().click();
63-
await option("Yes").click();
63+
await option("Yes").click({ delay: 1 });
6464
const rowCount = await rows();
6565
await expect(rowCount).toHaveCount(11);
6666
await expect(await column(3).allTextContents()).toEqual(
@@ -80,10 +80,10 @@ test.describe("datagrid-web filtering single select", () => {
8080
};
8181
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
8282
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
83-
const enumSelect = () => page.locator(".mx-name-drop_downFilter1").getByRole("combobox");
83+
const enumSelect = () => page.locator('.mx-name-drop_downFilter1[role="combobox"]');
8484

8585
await enumSelect().click();
86-
await option("Cyan").click();
86+
await option("Cyan").click({ delay: 1 });
8787
const rowCount = await rows();
8888
await expect(rowCount).toHaveCount(6);
8989
const columnTexts = await column(2).allTextContents();
@@ -96,10 +96,10 @@ test.describe("datagrid-web filtering single select", () => {
9696
};
9797
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
9898
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
99-
const enumSelect = () => page.locator(".mx-name-drop_downFilter1").getByRole("combobox");
99+
const enumSelect = () => page.locator('.mx-name-drop_downFilter1[role="combobox"]');
100100

101101
await enumSelect().click();
102-
await option("Black").click();
102+
await option("Black").click({ delay: 1 });
103103
const rowCount = await rows();
104104
await expect(rowCount).toHaveCount(9);
105105
const columnTexts = await column(2).allTextContents();
@@ -112,12 +112,12 @@ test.describe("datagrid-web filtering single select", () => {
112112
};
113113
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
114114
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
115-
const roleSelect = () => page.locator(".mx-name-drop_downFilter3").getByRole("combobox");
115+
const roleSelect = () => page.locator('.mx-name-drop_downFilter3[role="combobox"]');
116116

117117
const rowCount = await rows();
118118
await expect(rowCount).toHaveCount(11);
119119
await roleSelect().click();
120-
await option("Trader").click();
120+
await option("Trader").click({ delay: 1 });
121121
const rowCount2 = await rows();
122122
await expect(rowCount2).toHaveCount(8);
123123
const columnTexts = await column(4).allTextContents();
@@ -130,12 +130,12 @@ test.describe("datagrid-web filtering single select", () => {
130130
};
131131
const column = n => page.locator(`[role="gridcell"]:nth-child(${n})`);
132132
const option = label => page.locator(`[role="option"]:has-text("${label}")`);
133-
const companySelect = () => page.locator(".mx-name-drop_downFilter4").getByRole("combobox");
133+
const companySelect = () => page.locator('.mx-name-drop_downFilter4[role="combobox"]');
134134

135135
const rowCount = await rows();
136136
await expect(rowCount).toHaveCount(11);
137137
await companySelect().click();
138-
await option("PETsMART Inc").click();
138+
await option("PETsMART Inc").click({ delay: 1 });
139139
const rowCount2 = await rows();
140140
await expect(rowCount2).toHaveCount(9);
141141
const columnTexts = await column(5).allTextContents();

0 commit comments

Comments
 (0)