Skip to content

Commit

Permalink
VACMS-14955: Adds entity browser cucumber assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsasser committed Jan 4, 2024
1 parent 00fa680 commit c8b945e
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Given } from "@badeball/cypress-cucumber-preprocessor";

Given(`I select one item from the {string} Entity Browser modal`, (text) => {
cy.contains(text).click({ force: true });
cy.get(".entity-browser-modal iframe").should("exist");
cy.wait(3000);

cy.get(".entity-browser-modal iframe")
.iframe()
.within(() => {
cy.get("tr")
.should("exist")
.parent()
.find("[type='checkbox']")
.first()
.check({ force: true });
cy.get("#edit-submit").click({ force: true });
});
cy.get(".entity-browser-modal iframe").should("not.exist");
});

Given(
`I select {int} items from the {string} Entity Browser modal`,
(numItems, text) => {
cy.contains(text).click({ force: true });
cy.get(".entity-browser-modal iframe").should("exist");
cy.wait(3000);
cy.get(".entity-browser-modal iframe")
.iframe()
.within(() => {
for (let i = 0; i < numItems; i++) {
cy.get("input[type='checkbox']")
.eq(i)
.should("exist")
.check({ force: true });
}
cy.get("#edit-submit").click({ force: true });
});
cy.get(".entity-browser-modal iframe").should("not.exist");
}
);

0 comments on commit c8b945e

Please sign in to comment.