few-cpu-19533
02/12/2023, 3:47 PMconst selectors = require('../selectors');
describe('This is a first test', () => {
const getIframeBody= () => {
return cy
.get(selectors.loginIFrame)
.its('0.contentDocument.body').should('not.be.empty')
.then(cy.wrap)
};
it('should login user', () => {
cy.clearCookies();
cy.visit('/');
cy.get('#onetrust-accept-btn-handler').click();
cy.wait(5000);
getIframeBody().find(selectors.loginInputUser).type(Cypress.env('usernameForm'));
//
getIframeBody().find(selectors.loginInputPassword).type(Cypress.env('passwordForm'));
getIframeBody().find(selectors.loginInputSubmit).click();
cy.wait(5000);
});
});
I already read serveral github discussions and stackoverflow articles, handling similar topics, but unfortunately i did not find a solution yet.