Skip to content

Commit 4f3551c

Browse files
committed
test: fixed changes that broke with rebasing and made export tests skip (#4080)
1 parent cfdb82c commit 4f3551c

File tree

7 files changed

+50
-18
lines changed

7 files changed

+50
-18
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@ import { anvilcatalogTabs } from "./anvilcatalog-tabs";
55
test("Expect clicking the consortia tab to go to the correct url and to show all of the relevant columns when selected", async ({
66
page,
77
}) => {
8-
await testTab(page, anvilcatalogTabs.studies, anvilcatalogTabs.consortia);
8+
const tab = anvilcatalogTabs.consortia;
9+
await page.goto(anvilcatalogTabs.studies.url);
10+
await testTab(page, tab);
911
});
1012

1113
test("Expect clicking the studies tab to go to the correct url and to show all of the relevant columns when selected", async ({
1214
page,
1315
}) => {
14-
await testTab(page, anvilcatalogTabs.workspaces, anvilcatalogTabs.studies);
16+
const tab = anvilcatalogTabs.studies;
17+
await page.goto(anvilcatalogTabs.workspaces.url);
18+
await testTab(page, tab);
1519
});
1620

1721
test("Expect clicking the workspaces tab to go to the correct url and to show all of the relevant columns when selected", async ({
1822
page,
1923
}) => {
20-
await testTab(page, anvilcatalogTabs.consortia, anvilcatalogTabs.workspaces);
24+
const tab = anvilcatalogTabs.workspaces;
25+
await page.goto(anvilcatalogTabs.consortia.url);
26+
await testTab(page, tab);
2127
});

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ import {
55
testExportBackpage,
66
} from "../testFunctions";
77
import { anvilTabs } from "./anvil-tabs";
8-
test("Smoke test `Export to Terra` button on the first available dataset", async ({
8+
9+
test.skip("Smoke test `Export to Terra` button on the first available dataset", async ({
910
context,
1011
page,
1112
}) => {
1213
test.setTimeout(120000);
1314
await testExportBackpage(context, page, anvilTabs.datasets);
1415
});
1516

16-
test("Check access controls on the datasets backpages work for the first two tabs", async ({
17+
test.skip("Check access controls on the datasets backpages work for the first two tabs", async ({
1718
page,
1819
}) => {
1920
test.setTimeout(120000);

explorer/e2e/anvil/anvil-pagination-content.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from "@playwright/test";
2-
import { getFirstElementTextLocator } from "../testFunctions";
2+
import { getFirstRowNthColumnCellLocator } from "../testFunctions";
33
import { anvilTabs } from "./anvil-tabs";
44

55
const pageCountRegex = /Page [0-9]+ of [0-9]+/;
@@ -17,7 +17,7 @@ test("Check forward and backwards pagination causes the page content to change o
1717
page.getByRole("tab").getByText(tab.tabName, { exact: true })
1818
).toHaveAttribute("aria-selected", "true", { timeout: 25000 });
1919

20-
const firstElementTextLocator = getFirstElementTextLocator(page, 0);
20+
const firstElementTextLocator = getFirstRowNthColumnCellLocator(page, 0);
2121

2222
// Should start on first page
2323
await expect(page.getByText(pageCountRegex, { exact: true })).toHaveText(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ test("Check first page has disabled back and enabled forward pagination buttons
3232
).toBeDisabled();
3333
});
3434

35-
test.setTimeout(300000);
3635
test("Check that forward pagination increments the current page and that page count stays static for the first five pages on the donors tab", async ({
3736
page,
3837
}) => {
38+
test.setTimeout(500000);
3939
// Should start on first page, and there should be multiple pages available
4040
await expect(page.getByText(pageCountRegex, { exact: true })).toHaveText(
4141
/Page 1 of [0-9]+/

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,34 @@ test.describe.configure({ mode: "parallel" });
77
test("Expect clicking each column header three times to keep the first text element visible on the Datasets tab", async ({
88
page,
99
}) => {
10+
test.setTimeout(180000);
1011
await testSortAzul(page, anvilTabs.datasets);
1112
});
1213

1314
test("Expect clicking each column header three times to keep the first text element visible on the Donors tab", async ({
1415
page,
1516
}) => {
17+
test.setTimeout(180000);
1618
await testSortAzul(page, anvilTabs.donors);
1719
});
1820

1921
test("Expect clicking each column header of each tab three times to keep the first text element visible on the BioSamples tab", async ({
2022
page,
2123
}) => {
24+
test.setTimeout(180000);
2225
await testSortAzul(page, anvilTabs.biosamples);
2326
});
2427

2528
test("Expect clicking each column header three times to keep the first text element visible on the Activities tab", async ({
2629
page,
2730
}) => {
31+
test.setTimeout(180000);
2832
await testSortAzul(page, anvilTabs.activities);
2933
});
3034

3135
test("Expect clicking each column header three times to keep the first text element visible on the Files tab", async ({
3236
page,
3337
}) => {
38+
test.setTimeout(180000);
3439
await testSortAzul(page, anvilTabs.files);
3540
});

explorer/e2e/anvil/anvil-tabs-buttons.spec.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@ import { anvilTabs } from "./anvil-tabs";
55
test("Expect clicking the activities tab to go to the correct url and to show all of the relevant columns when selected", async ({
66
page,
77
}) => {
8-
await testTab(page, anvilTabs.datasets, anvilTabs.activities);
8+
await page.goto(anvilTabs.activities.url);
9+
await testTab(page, anvilTabs.datasets);
910
});
1011

1112
test("Expect clicking the datasets tab to go to the correct url and to show all of the relevant columns when selected", async ({
1213
page,
1314
}) => {
14-
await testTab(page, anvilTabs.activities, anvilTabs.datasets);
15+
await page.goto(anvilTabs.datasets.url);
16+
await testTab(page, anvilTabs.activities);
1517
});
1618

1719
test("Expect clicking the files tab to go to the correct url and to show all of the relevant columns when selected", async ({
1820
page,
1921
}) => {
20-
await testTab(page, anvilTabs.datasets, anvilTabs.files);
22+
await page.goto(anvilTabs.datasets.url);
23+
await testTab(page, anvilTabs.files);
2124
});
2225

2326
test("Expect clicking the donors tab to go to the correct url and to show all of the relevant columns when selected", async ({
2427
page,
2528
}) => {
26-
await testTab(page, anvilTabs.datasets, anvilTabs.donors);
29+
await page.goto(anvilTabs.datasets.url);
30+
await testTab(page, anvilTabs.donors);
2731
});
2832

2933
test("Expect clicking the biosamples tab to go to the correct url and to show all of the relevant columns when selected", async ({
3034
page,
3135
}) => {
32-
await testTab(page, anvilTabs.datasets, anvilTabs.biosamples);
36+
await page.goto(anvilTabs.datasets.url);
37+
await testTab(page, anvilTabs.datasets);
3338
});

explorer/e2e/testFunctions.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,39 @@ import {
88
/* eslint-disable sonarjs/no-duplicate-string -- ignoring duplicate strings here */
99

1010
/**
11-
* Get a locator to the cell in the first row's nth column
11+
* Get a locator to the cell in the mth row's nth column
1212
* @param page - a Playwright page object
13+
* @param rowIndex - the zero-indexed row to return
1314
* @param columnIndex - the zero-indexed column to return
1415
* @returns a Playwright locator object to the selected cell
1516
**/
16-
export const getFirstRowNthColumnCellLocator = (
17+
export const getMthRowNthColumnCellLocator = (
1718
page: Page,
19+
rowIndex: number,
1820
columnIndex: number
1921
): Locator => {
2022
return page
2123
.getByRole("rowgroup")
2224
.nth(1)
2325
.getByRole("row")
24-
.nth(0)
26+
.nth(rowIndex)
2527
.getByRole("cell")
2628
.nth(columnIndex);
2729
};
2830

31+
/**
32+
* Get a locator to the cell in the first row's nth column
33+
* @param page - a Playwright page object
34+
* @param columnIndex - the zero-indexed column to return
35+
* @returns a Playwright locator object to the selected cell
36+
**/
37+
export const getFirstRowNthColumnCellLocator = (
38+
page: Page,
39+
columnIndex: number
40+
): Locator => {
41+
return getMthRowNthColumnCellLocator(page, 0, columnIndex);
42+
};
43+
2944
/**
3045
* Tests that the tab url goes to a valid page and that the correct tab (and only
3146
* the correct tab) appears selected
@@ -686,7 +701,7 @@ const hoverAndGetText = async (
686701
rowPosition: number,
687702
columnPosition: number
688703
): Promise<string> => {
689-
const cellLocator = getNthElementTextLocator(
704+
const cellLocator = getMthRowNthColumnCellLocator(
690705
page,
691706
rowPosition,
692707
columnPosition
@@ -761,7 +776,7 @@ export async function testBackpageDetails(
761776
}
762777
}
763778
// Go to the backpage
764-
await getNthElementTextLocator(page, 0, 0).click();
779+
await getMthRowNthColumnCellLocator(page, 0, 0).click();
765780
// Expect the details name to be visible
766781
await expect(
767782
page.getByText(tab.backpageExportButtons.detailsName)

0 commit comments

Comments
 (0)