Skip to content

Commit

Permalink
E2E minor fixes in Case Portal/Case Interpreter #411
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioaltamura committed Feb 16, 2022
1 parent 0086f12 commit 0674432
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
38 changes: 19 additions & 19 deletions cypress/integration/005-opencga-case-portal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,71 +27,71 @@ context("5 - Case Portal", () => {
it("5.1 - check query results", () => {
cy.get("a[data-id=clinicalAnalysisPortal]", {timeout: TIMEOUT}).click({force: true});
cy.get("div.page-title h2", {timeout: TIMEOUT}).should("be.visible").and("contain", "Case Portal");
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");
});

it("5.2 - Filter: caseId", () => {
// reading from the first row the case Id, the proband Id, and the Family Id and use them as filters
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
.find("td:nth-child(1) a[data-cy='case-id']")
.then($a => {
const caseId = $a.text().trim();
selectToken("div[data-cy='form-case']", caseId);
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");

});
});

it("5.3 - Filter: Proband Sample Id", () => {
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
.find("td:nth-child(2) p[data-cy='proband-sample-id']").first()
.then($p => {
const probandSampleId = $p.text().trim();
console.log("probandSampleId", probandSampleId);
selectToken("div[data-cy='form-sample']", probandSampleId);
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");

});
});

it("5.4 - Filter: Proband Id", () => {
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
.find("td:nth-child(2) span[data-cy='proband-id']")
.then($span => {
const probandId = $span.text().trim();
console.log("probandId", probandId);
selectToken("div[data-cy='form-proband']", probandId);
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");

});
});

it("5.5 - Filter: Disorder name", () => {
// check whether there is a disorder-name, then it tests the filter itself (Cancer studies (type=SINGLE) doesn't have disorder names)
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
.find("td:nth-child(4)")
.then($td => {
const span = Cypress.$("span[data-cy='disorder-name']", $td).first();
const disorderName = span.text().trim();
console.log("disorderName", disorderName);
if (disorderName) {
selectToken("div[data-cy='form-disorder']", disorderName);
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");
}
});
});

it("5.6 - Filter: Family Id", () => {
// check whether there is a family-id, then it tests the filter itself (Cancer studies doesn't have family ids)
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
.find("td:nth-child(3)")
.then($td => {
const spans = Cypress.$("span[data-cy='family-id']", $td);
if (spans.length) {
const familyId = spans.first().text().trim();
// console.log("familyId", familyId);
selectToken("div[data-cy='form-family']", familyId);
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");
}
});
});
Expand All @@ -100,13 +100,13 @@ context("5 - Case Portal", () => {
// check whether priority filter is enabled and visible first, then it tests the filter itself
cy.get("div.lhs", {timeout: 5000}).then($wc => {
if (Cypress.$("div[data-cy='form-priority']", $wc).length) {
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT})
.find("td:nth-child(7) span.label").then($span => {
const priority = $span.text().trim();
// console.error("priority", priority);
cy.get("div[data-cy='form-priority'] button").click();
cy.get("div[data-cy='form-priority'] ul.dropdown-menu li").contains(priority).click({force: true});
checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");
});
}
});
Expand All @@ -121,15 +121,15 @@ context("5 - Case Portal", () => {
cy.get("div.page-title h2", {timeout: TIMEOUT}).should("be.visible").and("contain", "Case Portal");


cy.get("opencga-clinical-analysis-grid .columns-toggle-wrapper button").should("be.visible").and("contain", "Columns").click();
cy.get("opencga-clinical-analysis-grid .columns-toggle-wrapper ul li").should("have.length.gt", 1);
cy.get("clinical-analysis-grid .columns-toggle-wrapper button").should("be.visible").and("contain", "Columns").click();
cy.get("clinical-analysis-grid .columns-toggle-wrapper ul li").should("have.length.gt", 1);


cy.get("opencga-clinical-analysis-grid .columns-toggle-wrapper ul li a").click({multiple: true, timeout: TIMEOUT}); // deactivate all the columns
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT}).find("td", {timeout: TIMEOUT}).should("have.lengthOf", 1);
cy.get("clinical-analysis-grid .columns-toggle-wrapper ul li a").click({multiple: true, timeout: TIMEOUT}); // deactivate all the columns
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT}).find("td", {timeout: TIMEOUT}).should("have.lengthOf", 1);

cy.get("opencga-clinical-analysis-grid .columns-toggle-wrapper ul li a").click({multiple: true, timeout: TIMEOUT}); // reactivate all the columns
cy.get("opencga-clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT}).find("td", {timeout: TIMEOUT}).should("have.length.gt", 1);
cy.get("clinical-analysis-grid .columns-toggle-wrapper ul li a").click({multiple: true, timeout: TIMEOUT}); // reactivate all the columns
cy.get("clinical-analysis-grid .bootstrap-table .fixed-table-container tr[data-index=0]", {timeout: TIMEOUT}).find("td", {timeout: TIMEOUT}).should("have.length.gt", 1);


});
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/006-opencga-case-interpreter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {TIMEOUT} from "../plugins/constants.js";

const getCaseType = grid => {
checkResults(grid);
return cy.get("opencga-clinical-analysis-grid table tr[data-index=0] td:nth-child(1) p[data-cy='case-type']", {timeout: 60000}).then(type => console.log("TYPE", type)).invoke("text");
return cy.get("clinical-analysis-grid table tr[data-index=0] td:nth-child(1) p[data-cy='case-type']", {timeout: 60000}).then(type => console.log("TYPE", type)).invoke("text");
};


Expand All @@ -35,10 +35,10 @@ context("6 - Case Interpreter", () => {
cy.get("a[data-id=clinicalAnalysisPortal]", {timeout: TIMEOUT}).click({force: true});
cy.get("div.page-title h2", {timeout: TIMEOUT}).should("be.visible").and("contain", "Case Portal");

checkResults("opencga-clinical-analysis-grid");
checkResults("clinical-analysis-grid");

// reading from the first row the case Id, the proband Id, and the Family Id and use them as filters
cy.get("opencga-clinical-analysis-grid table", {timeout: TIMEOUT})
cy.get("clinical-analysis-grid table", {timeout: TIMEOUT})
.find("tr[data-index=0]", {timeout: TIMEOUT})
.then($tr => {
const $caseId = Cypress.$("td:nth-child(1) a[data-cy='case-id']", $tr);
Expand Down

0 comments on commit 0674432

Please sign in to comment.