Skip to content

Commit

Permalink
try to resolving cypress issue
Browse files Browse the repository at this point in the history
  • Loading branch information
modamaan committed Jan 10, 2025
1 parent d4bb397 commit 525fafe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,20 @@ Cypress.Commands.add("clickAndTypeDate", (selector, date) => {
cy.get("body").click(0, 0);
});

// Cypress.Commands.add(
// "verifyAndClickElement",
// (element: string, reference: string) => {
// cy.get(element).scrollIntoView();
// cy.get(element).contains(reference).should("be.visible").click();
// },
// );

Cypress.Commands.add(
"verifyAndClickElement",
(element: string, reference: string) => {
cy.get(element).scrollIntoView();
cy.get(element).contains(reference).should("be.visible").click();
cy.get(element).scrollIntoView().as("container");
cy.get("@container").contains(reference).as("target");
cy.get("@target").should("be.visible").click();
},
);

Expand Down

0 comments on commit 525fafe

Please sign in to comment.