Closed
Description
Current behavior
cy.get(<parent_locator>).contains(<child_locator>, <text>)
was finding elements, but with Cypress v12.0.1 is not finding anything:
The changelog was not mentioning anything about cy.contains updates.
Desired behavior
should work like before changes
Test code to reproduce
describe("cy.contains bug Cypress v12.0.1", () => {
beforeEach(() => {
cy.visit("https://example.cypress.io");
});
it("passes", () => {
cy.get(".container").eq(2).contains("p", "Commands ");
});
it("passes", () => {
cy.get(".container").contains("Commands ");
});
it("fails", () => {
cy.get(".container").contains("p", "Commands ");
});
});
Cypress Version
12.0.1
Node version
v16.18.0
Operating System
macOS 13.0.1
Debug Logs
No response
Other
No response