diff --git a/tests/cypress/e2e/for-teacher_page/class_page/add_student_invite_by_username.cy.js b/tests/cypress/e2e/for-teacher_page/class_page/add_student_invite_by_username.cy.js index 3d8ea014244..9eef51dac24 100644 --- a/tests/cypress/e2e/for-teacher_page/class_page/add_student_invite_by_username.cy.js +++ b/tests/cypress/e2e/for-teacher_page/class_page/add_student_invite_by_username.cy.js @@ -1,6 +1,7 @@ import {loginForTeacher, logout, login} from '../../tools/login/login.js' it('Is able to add student by name', () => { + cy.intercept('/invite-student').as('invite') loginForTeacher(); let student = 'student5' @@ -27,8 +28,8 @@ it('Is able to add student by name', () => { cy.getDataCy('invite_student').click(); cy.getDataCy('modal_prompt_input').type(student); cy.getDataCy('modal_ok_button').click(); - - cy.wait(500); + cy.wait('@invite') + login(student, "123456"); cy.getDataCy('user_dropdown').click();