Skip to content

Commit cca06e0

Browse files
committed
fix: updated variable names and tsdocs for e2e tests (#4068)
1 parent a8b31a2 commit cca06e0

File tree

3 files changed

+182
-74
lines changed

3 files changed

+182
-74
lines changed

explorer/e2e/anvil/anvil-filters.spec.ts

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { expect, test } from "@playwright/test";
22
import {
33
filterRegex,
4-
getFirstElementTextLocator,
4+
getFirstRowNthColumnCellLocator,
55
testClearAll,
6-
testFilterBubbles,
76
testFilterCounts,
87
testFilterPersistence,
98
testFilterPresence,
9+
testFilterTags,
1010
} from "../testFunctions";
1111
import {
12-
anvilFilters,
12+
anvilFilterNames,
1313
anvilTabs,
1414
anvilTabTestOrder,
1515
BIOSAMPLE_TYPE_INDEX,
@@ -38,31 +38,31 @@ const FILTER_INDEX_LIST_SHORT = [
3838
test("Check that all filters exist on the Datasets tab and are clickable", async ({
3939
page,
4040
}) => {
41-
await testFilterPresence(page, anvilTabs.datasets, anvilFilters);
41+
await testFilterPresence(page, anvilTabs.datasets, anvilFilterNames);
4242
});
4343

4444
test("Check that all filters exist on the Donors tab and are clickable", async ({
4545
page,
4646
}) => {
47-
await testFilterPresence(page, anvilTabs.donors, anvilFilters);
47+
await testFilterPresence(page, anvilTabs.donors, anvilFilterNames);
4848
});
4949

5050
test("Check that all filters exist on the BioSamples tab and are clickable", async ({
5151
page,
5252
}) => {
53-
await testFilterPresence(page, anvilTabs.biosamples, anvilFilters);
53+
await testFilterPresence(page, anvilTabs.biosamples, anvilFilterNames);
5454
});
5555

5656
test("Check that all filters exist on the Activities tab and are clickable", async ({
5757
page,
5858
}) => {
59-
await testFilterPresence(page, anvilTabs.activities, anvilFilters);
59+
await testFilterPresence(page, anvilTabs.activities, anvilFilterNames);
6060
});
6161

6262
test("Check that all filters exist on the Files tab and are clickable", async ({
6363
page,
6464
}) => {
65-
await testFilterPresence(page, anvilTabs.files, anvilFilters);
65+
await testFilterPresence(page, anvilTabs.files, anvilFilterNames);
6666
});
6767

6868
test("Check that the first filter on the Datasets tab creates at least one checkbox, and that checking up to the first five does not cause an error and does not cause there to be no entries in the table", async ({
@@ -79,7 +79,9 @@ test("Check that the first filter on the Datasets tab creates at least one check
7979
await page
8080
.getByRole("button")
8181
.getByText(
82-
filterRegex(anvilFilters[Math.floor(Math.random() * anvilFilters.length)])
82+
filterRegex(
83+
anvilFilterNames[Math.floor(Math.random() * anvilFilterNames.length)]
84+
)
8385
)
8486
.click();
8587
// Expect all checkboxes to be unchecked initially and to work properly
@@ -93,18 +95,21 @@ test("Check that the first filter on the Datasets tab creates at least one check
9395
await expect(checkbox).toBeChecked();
9496
}
9597
await page.locator("body").click();
96-
await expect(getFirstElementTextLocator(page, 0)).toBeVisible();
98+
await expect(getFirstRowNthColumnCellLocator(page, 0)).toBeVisible();
9799
});
98100

99101
test("Check that filter checkboxes are persistent across pages on an arbitrary filter", async ({
100102
page,
101103
}) => {
102104
test.setTimeout(120000);
103-
await testFilterPersistence(
105+
const result = await testFilterPersistence(
104106
page,
105-
anvilFilters[FILE_FORMAT_INDEX],
107+
anvilFilterNames[FILE_FORMAT_INDEX],
106108
anvilTabTestOrder.map((x) => anvilTabs[x])
107109
);
110+
if (!result) {
111+
test.fail();
112+
}
108113
});
109114

110115
test("Check that filter menu counts match actual counts on the Datasets tab", async ({
@@ -114,7 +119,7 @@ test("Check that filter menu counts match actual counts on the Datasets tab", as
114119
const result = await testFilterCounts(
115120
page,
116121
anvilTabs.datasets,
117-
FILTER_INDEX_LIST.map((x) => anvilFilters[x]),
122+
FILTER_INDEX_LIST.map((x) => anvilFilterNames[x]),
118123
anvilTabs.datasets.maxPages ?? 0
119124
);
120125
if (!result) {
@@ -129,30 +134,30 @@ test("Check that filter menu counts match actual counts on the Activities tab",
129134
await testFilterCounts(
130135
page,
131136
anvilTabs.activities,
132-
FILTER_INDEX_LIST.map((x) => anvilFilters[x]),
137+
FILTER_INDEX_LIST.map((x) => anvilFilterNames[x]),
133138
anvilTabs.activities.maxPages ?? 0
134139
);
135140
});
136141

137-
test("Check that the blue filter bubbles match the selected filter for an arbitrary filter on the Files tab", async ({
142+
test("Check that the filter tags match the selected filter for an arbitrary filter on the Files tab", async ({
138143
page,
139144
}) => {
140145
test.setTimeout(120000);
141-
await testFilterBubbles(
146+
await testFilterTags(
142147
page,
143148
anvilTabs.files,
144-
FILTER_INDEX_LIST_SHORT.map((x) => anvilFilters[x])
149+
FILTER_INDEX_LIST_SHORT.map((x) => anvilFilterNames[x])
145150
);
146151
});
147152

148-
test("Check that the blue filter bubbles match the selected filter for an arbitrary filter on the BioSamples tab", async ({
153+
test("Check that the filter tags match the selected filter for an arbitrary filter on the BioSamples tab", async ({
149154
page,
150155
}) => {
151156
test.setTimeout(120000);
152-
await testFilterBubbles(
157+
await testFilterTags(
153158
page,
154159
anvilTabs.biosamples,
155-
FILTER_INDEX_LIST_SHORT.map((x) => anvilFilters[x])
160+
FILTER_INDEX_LIST_SHORT.map((x) => anvilFilterNames[x])
156161
);
157162
});
158163

@@ -163,6 +168,6 @@ test("Check that the clear all button functions on the files tab", async ({
163168
await testClearAll(
164169
page,
165170
anvilTabs.files,
166-
FILTER_INDEX_LIST_SHORT.map((x) => anvilFilters[x])
171+
FILTER_INDEX_LIST_SHORT.map((x) => anvilFilterNames[x])
167172
);
168173
});

explorer/e2e/anvil/anvil-tabs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
TabDescription,
66
} from "../testInterfaces";
77

8-
export const anvilFilters: string[] = [
8+
export const anvilFilterNames: string[] = [
99
"Anatomical Site",
1010
"BioSample Type",
1111
"Consent Group",

0 commit comments

Comments
 (0)