From 9a963bedb5c3c99feb73366f959762aba6c4c4a9 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Fri, 16 Jun 2023 10:23:05 +0530 Subject: [PATCH] test: Fix failing test for icon & phone - for some reason findBYRole("searchbox") stopped working - there are no changes to related DOM recently - There's pending issue related to this https://github.com/testing-library/cypress-testing-library/issues/205#issuecomment-1572230102 --- cypress/integration/control_icon.js | 4 ++-- cypress/integration/control_phone.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/integration/control_icon.js b/cypress/integration/control_icon.js index a965ed0f9e..406e9f1162 100644 --- a/cypress/integration/control_icon.js +++ b/cypress/integration/control_icon.js @@ -42,14 +42,14 @@ context("Control Icon", () => { it("search for icon and clear search input", () => { let search_text = "ed"; - cy.get(".icon-picker").findByRole("searchbox").click().type(search_text); + cy.get(".icon-picker").get(".search-icons > input").click().type(search_text); cy.get(".icon-section .icon-wrapper:not(.hidden)").then((i) => { cy.get(`.icon-section .icon-wrapper[id*='${search_text}']`).then((icons) => { expect(i.length).to.equal(icons.length); }); }); - cy.get(".icon-picker").findByRole("searchbox").clear().blur(); + cy.get(".icon-picker").get(".search-icons > input").clear().blur(); cy.get(".icon-section .icon-wrapper").should("not.have.class", "hidden"); }); }); diff --git a/cypress/integration/control_phone.js b/cypress/integration/control_phone.js index b56343c2d8..b5b29fe758 100644 --- a/cypress/integration/control_phone.js +++ b/cypress/integration/control_phone.js @@ -47,7 +47,7 @@ context("Control Phone", () => { it("case insensitive search for country and clear search", () => { let search_text = "india"; cy.get(".selected-phone").click().first(); - cy.get(".phone-picker").findByRole("searchbox").click().type(search_text); + cy.get(".phone-picker").get(".search-phones").click().type(search_text); cy.get(".phone-section .phone-wrapper:not(.hidden)").then((i) => { cy.get(`.phone-section .phone-wrapper[id*="${search_text.toLowerCase()}"]`).then( (countries) => { @@ -56,7 +56,7 @@ context("Control Phone", () => { ); }); - cy.get(".phone-picker").findByRole("searchbox").clear().blur(); + cy.get(".phone-picker").get(".search-phones").clear(); cy.get(".phone-section .phone-wrapper").should("not.have.class", "hidden"); });