Skip to content

Commit

Permalink
Merge branch 'TASK-4847' of github.com:opencb/jsorolla into TASK-4847
Browse files Browse the repository at this point in the history
  • Loading branch information
gpveronica committed Nov 6, 2023
2 parents e2cfb63 + 23c0056 commit a9bd78b
Show file tree
Hide file tree
Showing 20 changed files with 574 additions and 771 deletions.
45 changes: 15 additions & 30 deletions cypress/e2e/iva/cohort-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ context("Cohort Browser Grid", () => {
});
});

it("should hidden columns [Cohort ID,Creation Date]",() => {
it("should hide columns [Cohort ID,Creation Date]",() => {
const columns = ["Cohort ID","Creation Date"];
cy.get(`${browserGrid} thead th`)
.as("headerColumns");
Expand Down Expand Up @@ -290,49 +290,34 @@ context("Cohort Browser Grid", () => {
.find("li")
.contains("New Catalog Tab")
.click()
.should('be.visible');
.should("be.visible");
});
});

context("detail tab", () => {
it("should render", () => {
cy.get(browserDetail)
cy.get("detail-tabs")
.should("be.visible");
});

it("should display info from the selected row",() => {
BrowserTest.getColumnIndexByHeader("Cohort ID");
cy.get("@indexColumn")
.then((indexColumn) => {
const indexRow = 2;
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get(`tbody tr`)
.eq(indexRow)
.click() // select the row
.find("td")
.eq(indexColumn)
.invoke("text")
.as("textRow");
});

cy.get("@textRow")
.then((textRow) => {
cy.get("detail-tabs > div.panel")
.invoke("text")
.then((text) => {
const textTab = text.trim().split(" ");
expect(textRow.trim()).to.equal(textTab[1].trim());
});
});
it("should display info from the selected row", () => {
const cohort = "FIN";
cy.get(`tbody tr[data-uniqueid="${cohort}"]`)
.find(`td:first`)
.trigger("click");

cy.get(`detail-tabs h3`)
.should("contain.text", `Cohort ${cohort}`);
});

it("should display 'JSON Data' Tab", () => {
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get(`detail-tabs > div.detail-tabs > ul`)
.find("li")
.contains("JSON Data")
.click()
.should('be.visible');
.trigger("click");

cy.get("json-viewer")
.should("be.visible");
});
});
});
41 changes: 11 additions & 30 deletions cypress/e2e/iva/disease-panel-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ context("Disease Panel Browser Grid", () => {
});
});

it("should hidden columns [Disorders,Source,Extra column]",() => {
it("should hide columns [Disorders,Source,Extra column]",() => {
const columns = ["Disorders","Source","Extra column"];
cy.get("disease-panel-grid thead th")
.as("headerColumns");
Expand Down Expand Up @@ -345,42 +345,23 @@ context("Disease Panel Browser Grid", () => {
});

it("should display info from the selected row",() => {
BrowserTest.getColumnIndexByHeader("Panel");
cy.get("@indexColumn")
.then(indexColumn => {
const indexRow = 2;
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get("tbody tr")
.eq(indexRow)
.click() // select the row
.find("td")
.eq(indexColumn)
.invoke("text")
.as("textRow");
});

cy.get("@textRow")
.then((textRow) => {
const textRowTrimmed = textRow.trim();
const lastLineMatch = textRowTrimmed.match(/(?:^|\n)([^\n]+)$/);
const id = lastLineMatch ? lastLineMatch[1].trim() : textRowTrimmed;
cy.get("detail-tabs > div.panel")
.invoke("text")
.then((text) => {
const textTab = text.trim().split(" ");
expect(id).to.equal(textTab[2].trim());
});
});
const panel = "Familial_non_syndromic_congenital_heart_disease-PanelAppId-212";
cy.get(`tbody tr[data-uniqueid="${panel}"]`)
.find(`td:first`)
.trigger("click");

cy.get(`detail-tabs h3`)
.should("contain.text", `Disease Panel ${panel}`);
});

it("should display 'JSON Data' Tab", () => {
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get("@detail")
.find("li")
.contains("JSON Data")
.click()
.trigger("click");

cy.get("json-viewer")
.should("be.visible");
});
});

});
42 changes: 14 additions & 28 deletions cypress/e2e/iva/family-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ context("Family Browser Grid", () => {
});
});

it("should hidden columns [Case ID,Phenotypes]",() => {
it("should hide columns [Case ID,Phenotypes]",() => {
const columns = ["Case ID","Phenotypes"];
cy.get(`${browserGrid} thead th`)
.as("headerColumns");
Expand Down Expand Up @@ -298,44 +298,30 @@ context("Family Browser Grid", () => {
});
});

context("detail tab",{tags: ["@shortTask","@testTask"]}, () => {
context("detail tab", {tags: ["@shortTask","@testTask"]}, () => {
it("should render", () => {
cy.get(browserDetail)
.should("be.visible");
});

it("should display info from the selected row",() => {
BrowserTest.getColumnIndexByHeader("Family");
cy.get("@indexColumn")
.then((indexColumn) => {
const indexRow = 1;
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get("tbody tr")
.eq(indexRow)
.click() // select the row
.find("td")
.eq(indexColumn)
.invoke("text")
.as("textRow");
});

cy.get("@textRow")
.then((textRow) => {
cy.get("detail-tabs > div.panel")
.invoke("text")
.then((text) => {
const textTab = text.trim().split(" ");
expect(textRow).to.equal(textTab[1].trim());
});
});
it("should display info from the selected row", () => {
const family = "919278";
cy.get(`tbody tr[data-uniqueid="${family}"]`)
.find(`td`)
.eq(1)
.trigger("click");

cy.get(`detail-tabs h3`)
.should("contain.text", `Family ${family}`);
});

it("should display 'JSON Data' Tab", () => {
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get("detail-tabs > div.detail-tabs > ul")
.find("li")
.contains("JSON Data")
.click()
.trigger("click");

cy.get("json-viewer")
.should("be.visible");
});
});
Expand Down
49 changes: 15 additions & 34 deletions cypress/e2e/iva/file-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ context("File Browser Grid", () => {
});
});

it("should hidden columns [Name,Format]",() => {
it("should hide columns [Name,Format]",() => {
const columns = ["Name","Format"];
cy.get(`${browserGrid} thead th`)
.as("headerColumns");
Expand Down Expand Up @@ -229,7 +229,7 @@ context("File Browser Grid", () => {
it("should display 'Extra Column' column", () => {
cy.get("thead th")
.contains("Extra column")
.should('be.visible');
.should("be.visible");
});

it("should display 'New Catalog Tab' Tab", () => {
Expand All @@ -238,7 +238,7 @@ context("File Browser Grid", () => {
.find("li")
.contains("New Catalog Tab")
.click()
.should('be.visible');
.should("be.visible");
});
});

Expand All @@ -248,43 +248,24 @@ context("File Browser Grid", () => {
.should("be.visible");
});

it("should display info from the selected row",() => {
BrowserTest.getColumnIndexByHeader("Name");
cy.get("@indexColumn")
.then((indexColumn) => {
const indexRow = 2;
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get(`tbody tr`)
.eq(indexRow)
.click() // select the row
.find("td")
.eq(indexColumn)
.invoke("text")
.as("textRow");
});

cy.get("@textRow")
.then((textRow) => {
cy.get("detail-tabs > div.panel")
.invoke("text")
.then((text) => {
const textRowTrimmed = textRow.trim();
const firstLineMatch = textRowTrimmed.match(/^([^\n]+)/);
const id = firstLineMatch ? firstLineMatch[1].trim() : textRowTrimmed;

const textTab = text.split(":");
expect(id).to.equal(textTab[1].trim());
});
});
it("should display info from the selected row", () => {
const file = "chinese:HG007_GRCh38_1_22_v4.2.1_benchmark.vcf.gz";
cy.get(`tbody tr[data-uniqueid="${file}"]`)
.find(`td:first`)
.trigger("click");

cy.get(`detail-tabs h3`)
.should("contain.text", `File ${file}`);
});

it("should display 'Preview' Tab", () => {
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get(`detail-tabs > div.detail-tabs > ul`)
.find("li")
.contains("Preview")
.click()
.should('be.visible');
.trigger("click");

cy.get("file-preview")
.should("be.visible");
});
});
});
48 changes: 14 additions & 34 deletions cypress/e2e/iva/individual-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ context("Individual Browser Grid", () => {
});
});

it("should hidden columns [Disorders,Case ID,Ethnicity]",() => {
it("should hide columns [Disorders,Case ID,Ethnicity]",() => {
const columns = ["Disorders","Case ID","Ethnicity"];
cy.get(`${browserGrid} thead th`)
.as("headerColumns");
Expand Down Expand Up @@ -425,7 +425,6 @@ context("Individual Browser Grid", () => {

// DETAIL TABS
context("Detail", () => {

beforeEach(() => {
cy.get("@container")
.find(`div[data-cy="ib-detail"]`)
Expand All @@ -437,44 +436,25 @@ context("Individual Browser Grid", () => {
.should("be.visible");
});

it("should display info from the selected row",() => {
BrowserTest.getColumnIndexByHeader("Individual");
cy.get("@indexColumn")
.then(indexColumn => {
const indexRow = 2;
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get(`tbody tr`)
.eq(indexRow)
.click() // select the row
.find("td")
.eq(indexColumn)
.invoke("text")
.as("textRow");
});

cy.get("@textRow")
.then((textRow) => {
cy.get("detail-tabs > div.panel")
.invoke("text")
.then((text) => {
const textRowTrimmed = textRow.trim();
const firstLineMatch = textRowTrimmed.match(/^([^\n]+)/);
const id = firstLineMatch ? firstLineMatch[1].trim() : textRowTrimmed;

const textTab = text.trim().split(" ");
expect(id).to.equal(textTab[1].trim());
});
});
it("should display info from the selected row", () => {
const individual = "NA12877";
cy.get(`tbody tr[data-uniqueid="${individual}"]`)
.find(`td`)
.eq(1)
.trigger("click");

cy.get(`detail-tabs h3`)
.should("contain.text", `Individual ${individual}`);
});

it("should display 'JSON Data' Tab", () => {
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get("@detail")
.find("li")
.contains("JSON Data")
.click()
.should('be.visible');
.trigger("click");

cy.get("json-viewer")
.should("be.visible");
});
});

});
Loading

0 comments on commit a9bd78b

Please sign in to comment.