Skip to content

Commit aa9ac51

Browse files
committed
test: added anvil-catalog filter search test (#4125)
1 parent 8c3e797 commit aa9ac51

File tree

6 files changed

+242
-26
lines changed

6 files changed

+242
-26
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { test } from "@playwright/test";
2+
import {
3+
testDeselectFiltersThroughSearchBar,
4+
testSelectFiltersThroughSearchBar,
5+
} from "../testFunctions";
6+
import {
7+
anvilcatalogTabs,
8+
ANVIL_CATALOG_FILTERS,
9+
CONSENT_CODE_INDEX,
10+
DBGAP_ID_INDEX,
11+
TERRA_WORKSPACE_INDEX,
12+
} from "./anvilcatalog-tabs";
13+
14+
const filterList = [CONSENT_CODE_INDEX, DBGAP_ID_INDEX, TERRA_WORKSPACE_INDEX];
15+
16+
test('Check that selecting filters through the "Search all Filters" textbox works correctly on the Consortia tab', async ({
17+
page,
18+
}) => {
19+
await testSelectFiltersThroughSearchBar(
20+
page,
21+
anvilcatalogTabs.consortia,
22+
filterList.map((i: number) => ANVIL_CATALOG_FILTERS[i])
23+
);
24+
});
25+
26+
test('Check that selecting filters through the "Search all Filters" textbox works correctly on the Studies tab', async ({
27+
page,
28+
}) => {
29+
await testSelectFiltersThroughSearchBar(
30+
page,
31+
anvilcatalogTabs.studies,
32+
filterList.map((i: number) => ANVIL_CATALOG_FILTERS[i])
33+
);
34+
});
35+
36+
test('Check that selecting filters through the "Search all Filters" textbox works correctly on the Workspaces tab', async ({
37+
page,
38+
}) => {
39+
await testSelectFiltersThroughSearchBar(
40+
page,
41+
anvilcatalogTabs.workspaces,
42+
filterList.map((i: number) => ANVIL_CATALOG_FILTERS[i])
43+
);
44+
});
45+
46+
test('Check that deselecting filters through the "Search all Filters" textbox works correctly on the Consortia tab', async ({
47+
page,
48+
}) => {
49+
await testDeselectFiltersThroughSearchBar(
50+
page,
51+
anvilcatalogTabs.consortia,
52+
filterList.map((i: number) => ANVIL_CATALOG_FILTERS[i])
53+
);
54+
});
55+
56+
test('Check that deselecting filters through the "Search all Filters" textbox works correctly on the Studies tab', async ({
57+
page,
58+
}) => {
59+
await testDeselectFiltersThroughSearchBar(
60+
page,
61+
anvilcatalogTabs.studies,
62+
filterList.map((i: number) => ANVIL_CATALOG_FILTERS[i])
63+
);
64+
});
65+
66+
test('Check that deselecting filters through the "Search all Filters" textbox works correctly on the Workspaces tab', async ({
67+
page,
68+
}) => {
69+
await testDeselectFiltersThroughSearchBar(
70+
page,
71+
anvilcatalogTabs.workspaces,
72+
filterList.map((i: number) => ANVIL_CATALOG_FILTERS[i])
73+
);
74+
});

explorer/e2e/anvil-catalog/anvilcatalog-tabs.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
import { AnvilCatalogTabCollection, TabDescription } from "../testInterfaces";
44

5+
const ANVIL_CATALOG_SEARCH_FILTERS_PLACEHOLDER_TEXT = "Search all filters...";
6+
export const ANVIL_CATALOG_FILTERS = [
7+
"Consent Code",
8+
"Consortium",
9+
"Data Type",
10+
"dbGap Id",
11+
"Disease (indication)",
12+
"Study Design",
13+
"Study",
14+
"Terra Workspace Name",
15+
];
16+
17+
export const CONSENT_CODE_INDEX = 0;
18+
export const CONSORTIUM_INDEX = 1;
19+
export const DATA_TYPE_INDEX = 2;
20+
export const DBGAP_ID_INDEX = 3;
21+
export const DISEASE_INDICATION_INDEX = 4;
22+
export const STUDY_DESIGN_INDEX = 5;
23+
export const STUDY_INDEX = 6;
24+
export const TERRA_WORKSPACE_INDEX = 7;
25+
526
export const anvilcatalogTabs: AnvilCatalogTabCollection = {
627
consortia: {
728
emptyFirstColumn: false,
@@ -15,6 +36,7 @@ export const anvilcatalogTabs: AnvilCatalogTabCollection = {
1536
{ name: "Participants", sortable: true },
1637
{ name: "Size (TB)", sortable: true },
1738
],
39+
searchFiltersPlaceholderText: ANVIL_CATALOG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
1840
selectableColumns: [
1941
{ name: "Study", sortable: true },
2042
{ name: "Workspaces", sortable: true },
@@ -36,6 +58,7 @@ export const anvilcatalogTabs: AnvilCatalogTabCollection = {
3658
{ name: "Participants", sortable: true },
3759
{ name: "Size (TB)", sortable: true },
3860
],
61+
searchFiltersPlaceholderText: ANVIL_CATALOG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
3962
selectableColumns: [],
4063
tabName: "Studies",
4164
url: "/data/studies",
@@ -54,6 +77,7 @@ export const anvilcatalogTabs: AnvilCatalogTabCollection = {
5477
{ name: "Participants", sortable: true },
5578
{ name: "Size (TB)", sortable: true },
5679
],
80+
searchFiltersPlaceholderText: ANVIL_CATALOG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
5781
selectableColumns: [],
5882
tabName: "Workspaces",
5983
url: "/data/workspaces",

explorer/e2e/anvil/anvil-tabs.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export const ORGANISM_TYPE_INDEX = 8;
3030
export const PHENOTYPIC_SEX_INDEX = 9;
3131
export const REPORTED_ETHNICITY_INDEX = 10;
3232

33+
const ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT = "Search all filters...";
34+
3335
export const anvilTabs: AnvilCMGTabCollection = {
3436
activities: {
3537
emptyFirstColumn: false,
@@ -42,6 +44,7 @@ export const anvilTabs: AnvilCMGTabCollection = {
4244
{ name: "Organism Type", sortable: true },
4345
{ name: "Dataset", sortable: true },
4446
],
47+
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
4548
selectableColumns: [
4649
{ name: "Phenotypic Sex", sortable: true },
4750
{ name: "Reported Ethnicity", sortable: true },
@@ -61,6 +64,7 @@ export const anvilTabs: AnvilCMGTabCollection = {
6164
{ name: "Diagnosis", sortable: true },
6265
{ name: "Dataset", sortable: true },
6366
],
67+
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
6468
selectableColumns: [
6569
{ name: "Phenotypic Sex", sortable: true },
6670
{ name: "Reported Ethnicity", sortable: true },
@@ -80,6 +84,7 @@ export const anvilTabs: AnvilCMGTabCollection = {
8084
{ name: "Diagnosis", sortable: true },
8185
{ name: "Data Modality", sortable: true },
8286
],
87+
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
8388
selectableColumns: [
8489
{ name: "Phenotypic Sex", sortable: true },
8590
{ name: "Reported Ethnicity", sortable: true },
@@ -98,6 +103,7 @@ export const anvilTabs: AnvilCMGTabCollection = {
98103
{ name: "Diagnosis", sortable: true },
99104
{ name: "Dataset", sortable: true },
100105
],
106+
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
101107
selectableColumns: [],
102108
tabName: "Donors",
103109
url: "/donors",
@@ -114,6 +120,7 @@ export const anvilTabs: AnvilCMGTabCollection = {
114120
{ name: "Organism Type", sortable: true },
115121
{ name: "Dataset", sortable: true },
116122
],
123+
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
117124
selectableColumns: [
118125
{ name: "Phenotypic Sex", sortable: true },
119126
{ name: "Reported Ethnicity", sortable: true },

0 commit comments

Comments
 (0)