Skip to content

Commit

Permalink
Migrate batch test code into legacy test monolith
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Nov 7, 2023
1 parent fa97671 commit 6e1b3c3
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions webapp/cypress/e2e/legacy.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,34 @@ function createSample(sample_id, name = null, date = null) {

function verifySample(sample_id, name = null, date = null) {
if (date) {
cy.findByText(sample_id)
cy.get("[data-testid=sample-table]")
.contains(sample_id)
.parents("tr")
.within(() => {
cy.findByText(date.split("T")[0]);
cy.contains(date.slice(0, 8));
if (name) {
cy.findByText(name);
cy.contains(name);
}
});
} else {
cy.findByText(sample_id)
cy.get("[data-testid=sample-table]")
.contains(sample_id)
.parents("tr")
.within(() => {
cy.findByText(TODAY.split("T")[0]);
cy.contains(TODAY.split("T")[0]);
if (name) {
cy.findByText(name);
cy.contains(name);
}
});
}
}

function deleteSample(sample_id) {
// wait a bit to allow things to settle
cy.wait(100).then(() => {
cy.findByText(sample_id)
function deleteSample(sample_id, delay = 100) {
cy.wait(delay).then(() => {
cy.log("search for and delete: " + sample_id);
var matchingIds = [];
cy.get("[data-testid=sample-table]")
.contains(sample_id)
.parents("tr")
.within(() => {
cy.get("button.close").click();
Expand Down

0 comments on commit 6e1b3c3

Please sign in to comment.