Hello everyone, I have problems with the cookie pop-op for a long time, sometimes it is visible sometimes not. I tried to solve it with a if condition, but if the cookie pop up is not visible it fails. How can i solve this?
it("Cookie Pop-up - click when visible", () => {
cy.get('.bg-green' , {timeout: 10000})
.then(($btn) => {
if ($btn.is(':visible')) {
cy.get('.bg-green').click();
}
})
});