https://cypress.io logo
Error Is Being Covered By Another Element
# e2e-testing
l
Error Is Being Covered By Another Element
Hi Team! What would a solution be to this error?
{force: true}
did not work for me
This is the whole code snippet:
Copy code
checkInputFieldForErrors(attribute) {
    //EXISTS, VISISBLE, AND ARIA-DESCRIBEDBY
    cy.get("[data-cy='" + attribute + "']")
      .should("be.visible")
      .should("to.exist")
      .should("have.attr", "aria-describedby");

    //EXISTS AND CAN BE TYPED INTO
    cy.get("[data-cy='" + attribute + "'] input")
      .should("to.exist") //Can be typed into
      .should("have.value", "")
      .scrollIntoView()
      .type("value!dsfXX")
      .should("have.value", "value!dsfXX")

      //Test can delete in the box
      // .type() with special character sequences
      .type("{leftarrow}{rightarrow}{uparrow}{downarrow}")
      .type("{del}{selectall}{backspace}")
      .should("have.value", "")
      // .type() with key modifiers
      .type("{alt}{option}") //these are equivalent
      .type("{ctrl}{control}") //these are equivalent
      .type("{meta}{command}{cmd}") //these are equivalent
      .type("{shift}")

      //Retype to ensure it has the correct value
      .type("value!dsfXX")
      .should("have.value", "value!dsfXX")
      .scrollIntoView();

    //HAS LABEL
    cy.get("[data-cy='" + attribute + "'] label")
      .scrollIntoView()
      .should("be.visible")
      .should("to.exist");

    //Test can delete in the box
    // .type() with special character sequences
    cy.get("[data-cy='" + attribute + "'] input")
      .type("{leftarrow}{rightarrow}{uparrow}{downarrow}")
      .type("{del}{selectall}{backspace}")
      .should("have.value", "");
  }
**Solution:**`.click({ scrollBehavior: false })` for each
cy.get
This only worked for 1/5 tests ahhhh
2 Views