I am new to Cypress and have the following question.
I try to write a test for creating a user account.
After I enter an email, the app will send a Code (a 6-digit number) to the email.
I want to pause the Cypress test until the user reads his e-mail and enters the code.
After the code is entered the test should continue to press the “confirm”-Button.
How can I do this?
I can check if the inputs for the code are not empty, with “.should(‘not.have.value’, ”);”. But how can I wait the test until this condition is true?
it('Create Account', () => {
cy.visit('http://localhost:4200/');
// press some buttons
cy.get('.btn').click();
cy.get('.bottom-box--inner > .flex > .btn').click();
cy.get('.flex > .btn-primary').click();
cy.get('.flex > .btn-primary').click();
cy.get('#ion-input-0').click();
// enter username
cy.get('#ion-input-0').type('username');
cy.get('#ion-input-1').click();
// enter user email
cy.get('#ion-input-1').type('[email protected]');
cy.get('.p-5 > .btn').click();
//now here opens in my app a window where i have to put the 6-digit-code that was sent to my email.
// i want to wait the user to enter this code and then continue the test
// press confirm button
cy.get('app-otp.ng-star-inserted > .ion-no-border > .ios > .p-5 > .btn').click();
});