diff --git a/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts.cy.js b/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts.cy.js index a355d25cf03..13f109a50ad 100644 --- a/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts.cy.js +++ b/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts.cy.js @@ -17,10 +17,7 @@ describe('Testing a teacher account', () => { it('Is able to create new accounts for class', () => { navigateToClass(classname); - cy.getDataCy('student_username_cell').should(($div) => { - const text = $div.text(); - expect(text).include(students[0]); - }) + cy.getDataCy(`student_${students[0]}`).should('include.text', students[0]) }) it('Is able to download login credentials', () => { diff --git a/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts_second_teachers.cy.js b/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts_second_teachers.cy.js index ded0dd12ca4..7654db3eb57 100644 --- a/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts_second_teachers.cy.js +++ b/tests/cypress/e2e/for-teacher_page/class_page/create_accounts_page/create_accounts_second_teachers.cy.js @@ -17,10 +17,7 @@ before(() => { describe('Testing second teacher accounts', () => { it('Is able to create new accounts for class', () => { navigateToClass(classname); - cy.getDataCy('student_username_cell').should(($div) => { - const text = $div.text(); - expect(text).include(students[0]); - }) + cy.getDataCy(`student_${students[0]}`).should('include.text', students[0]) }) it('Is able to download login credentials', () => {