Skip to content

Commit

Permalink
test: create tests for index export button (#4117) (#4217)
Browse files Browse the repository at this point in the history
* test: first draft index export tests (#4117)

* test: reduced duplication between index and details export workflows (#4117)

* test: added readme, cleanup on test descriptions (#4117)

* test: renamed 'testIndexExportDetails' to 'testIndexExportSummary' (#4117)

* test: addressed anvil index flakiness issues (#4117)

* test: cleaned up test code (#4117)

* test: increased timeouts for export action (#4117)
  • Loading branch information
jpaten authored Nov 8, 2024
1 parent 88717dd commit 71df859
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 57 deletions.
14 changes: 12 additions & 2 deletions explorer/e2e/anvil/anvil-backpages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ test.skip("Smoke test `Export to Terra` button on the first available dataset",
page,
}) => {
test.setTimeout(120000);
await testExportBackpage(context, page, ANVIL_TABS.DATASETS);
const testResult = await testExportBackpage(
context,
page,
ANVIL_TABS.DATASETS
);
if (!testResult) {
test.fail();
}
});

test.skip("Check access controls on the datasets backpages work for the first two tabs", async ({
page,
}) => {
test.setTimeout(120000);
await testBackpageAccess(page, ANVIL_TABS.DATASETS);
const testResult = await testBackpageAccess(page, ANVIL_TABS.DATASETS);
if (!testResult) {
test.fail();
}
});

test("Check that information on the backpages matches information in the data tables", async ({
Expand Down
28 changes: 28 additions & 0 deletions explorer/e2e/anvil/anvil-index-export-button.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import test from "@playwright/test";
import {
testBulkDownloadIndexExportWorkflow,
testIndexExportSummary,
} from "../testFunctions";
import { ANVIL_TABS } from "./anvil-tabs";

test("Smoke test File Manifest Request index export workflow on the Files tab", async ({
page,
}) => {
test.setTimeout(120000);
const testResult = await testBulkDownloadIndexExportWorkflow(
page,
ANVIL_TABS.FILES
);
if (!testResult) {
test.fail();
}
});

test("Check that figures in the Selected Data Summary tab on the index export page matches figures on the index page on the BioSamples tab", async ({
page,
}) => {
const testResult = await testIndexExportSummary(page, ANVIL_TABS.BIOSAMPLES);
if (!testResult) {
test.fail();
}
});
23 changes: 21 additions & 2 deletions explorer/e2e/anvil/anvil-tabs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable sonarjs/no-duplicate-string -- ignoring duplicate strings here */
import {
AnvilCMGTabCollection,
IndexExportButtons,
TabCollectionKeys,
TabDescription,
} from "../testInterfaces";
Expand Down Expand Up @@ -45,9 +46,22 @@ export const REPORTED_ETHNICITY_INDEX = 10;

const ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT = "Search all filters...";

export const ANVIL_INDEX_EXPORT_BUTTONS: IndexExportButtons = {
actionLandingMessage: "Confirm Organism Type and Manifest File Formats",
detailsName: "Selected Data Summary",
detailsToCheck: ["BioSamples", "Donors", "Files"],
exportActionButtonText: "Download Manifest",
exportOptionButtonText: "Request File Manifest",
exportRequestButtonText: "Prepare Manifest",
indexExportButtonText: "Export",
requestLandingMessage:
"Download a File Manifest with Metadata for the Selected Data",
};

export const ANVIL_TABS: AnvilCMGTabCollection = {
ACTIVITIES: {
emptyFirstColumn: false,
indexExportPage: ANVIL_INDEX_EXPORT_BUTTONS,
maxPages: 25,
preselectedColumns: ANVIL_ACTIVITIES_PRESELECTED_COLUMNS_BY_NAME,
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
Expand All @@ -57,6 +71,7 @@ export const ANVIL_TABS: AnvilCMGTabCollection = {
},
BIOSAMPLES: {
emptyFirstColumn: false,
indexExportPage: ANVIL_INDEX_EXPORT_BUTTONS,
maxPages: 25,
preselectedColumns: ANVIL_BIOSAMPLES_PRESELECTED_COLUMNS_BY_NAME,
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
Expand All @@ -74,15 +89,16 @@ export const ANVIL_TABS: AnvilCMGTabCollection = {
backpageExportButtons: {
accessNotGrantedMessage:
"To export this dataset, please sign in and, if necessary, request access.",
actionLandingMessage: "Your Terra Workspace Link is Ready",
detailsName: "Dataset Details",
exportActionButtonText: "Open Terra",
exportRequestButtonText: "Request Link",
exportTabName: "Export",
exportUrlRegExp: /\.*\/export-to-terra/,
firstLoadingMessage: "Your link will be ready shortly...",
newTabMessage:
"If you are a new user or returning user, click sign in to continue.",
secondLandingMessage: "Your Terra Workspace Link is Ready",
requestLandingMessage:
"Terra is a biomedical research platform to analyze data using workflows, Jupyter Notebooks, RStudio, and Galaxy.",
},
backpageHeaders: [
{
Expand Down Expand Up @@ -132,6 +148,7 @@ export const ANVIL_TABS: AnvilCMGTabCollection = {
},
],
emptyFirstColumn: false,
indexExportPage: ANVIL_INDEX_EXPORT_BUTTONS,
maxPages: 25,
preselectedColumns: ANVIL_DATASETS_PRESELECTED_COLUMNS_BY_NAME,
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
Expand All @@ -141,6 +158,7 @@ export const ANVIL_TABS: AnvilCMGTabCollection = {
},
DONORS: {
emptyFirstColumn: false,
indexExportPage: ANVIL_INDEX_EXPORT_BUTTONS,
maxPages: 25,
preselectedColumns: ANVIL_DONORS_PRESELECTED_COLUMNS_BY_NAME,
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
Expand All @@ -150,6 +168,7 @@ export const ANVIL_TABS: AnvilCMGTabCollection = {
},
FILES: {
emptyFirstColumn: true,
indexExportPage: ANVIL_INDEX_EXPORT_BUTTONS,
maxPages: 25,
preselectedColumns: ANVIL_FILES_PRESELECTED_COLUMNS_BY_NAME,
searchFiltersPlaceholderText: ANVIL_CMG_SEARCH_FILTERS_PLACEHOLDER_TEXT,
Expand Down
Loading

0 comments on commit 71df859

Please sign in to comment.