I am new to automation testing and currently learning Cypress.io
I am using the Emirates website as an example and written the following code to select accept when the privacy screen pop-up window appears, but my code seems to be timing out and failing:
Can you please tell me what I am doing wrong, and explain why did behaviour occurs in cypress and how to resolve it.
Appreciate the support.
/// <reference types="cypress" />
import Homepage from './pageObjects/Homepage.cy.js';
describe('Basic Tests', () => {
const homepage = new Homepage();
beforeEach(() => {
cy.log('Opening Emirates URL');
homepage.visit();
homepage.verifyTitle(homepage.EXPECTED_TITLE);
cy.wait(3000);
});
it('Privacy Pop-up', () => {
cy.get('button[@id="onetrust-accept-btn-handler"]')
.click()
cy.wait(5000)
});
Cypress automation test tool to interact with pop-up windows
New contributor
Asad Masood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.