Skip to content

Commit

Permalink
Merge branch 'develop' into TASK-5199
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed Nov 13, 2023
2 parents 71b2632 + bc072b0 commit 2be2c70
Show file tree
Hide file tree
Showing 85 changed files with 2,574 additions and 1,998 deletions.
47 changes: 16 additions & 31 deletions cypress/e2e/iva/cohort-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ context("Cohort Browser Grid", () => {
});
});

it("should hidden columns [Date,Type]",() => {
const columns = ["Cohort ID","Date","Type"];
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).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");
});
});
});
39 changes: 11 additions & 28 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,40 +345,23 @@ context("Disease Panel Browser Grid", () => {
});

it("should display info from the selected row",() => {
BrowserTest.getColumnIndexByHeader("Panel 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) => {
const textRowTrimmed = textRow.trim();
cy.get("detail-tabs > div.panel")
.invoke("text")
.then((text) => {
const textTab = text.trim().split(" ");
expect(textRowTrimmed).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
50 changes: 17 additions & 33 deletions cypress/e2e/iva/file-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ context("File Browser Grid", () => {
const browserDetail = "file-detail";

beforeEach(() => {
cy.visit("#file-browser-grid")
cy.visit("#file-browser-grid");
cy.waitUntil(() => {
return cy.get(browserGrid)
.should("be.visible");
Expand Down Expand Up @@ -151,8 +151,8 @@ context("File Browser Grid", () => {
});
});

it("should hidden columns [Directory,Format,Bioformat]",() => {
const columns = ["Directory","Format","Bioformat"];
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,50 +238,34 @@ context("File Browser Grid", () => {
.find("li")
.contains("New Catalog Tab")
.click()
.should('be.visible');
.should("be.visible");
});
});


context("detail tab", () => {
it("should render", () => {
cy.get(browserDetail)
.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 textTab = text.split(":");
expect(textRow).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");
});
});
});
Loading

0 comments on commit 2be2c70

Please sign in to comment.