diff --git a/tests/System/integration/administrator/components/com_config/Application.cy.js b/tests/System/integration/administrator/components/com_config/Application.cy.js index 004420961815d..4a9be2772a950 100644 --- a/tests/System/integration/administrator/components/com_config/Application.cy.js +++ b/tests/System/integration/administrator/components/com_config/Application.cy.js @@ -24,7 +24,7 @@ describe('Test in backend that the application configuration', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'The email was sent to'); - cy.wrap(mails).should('have.lengthOf', 1); + expect(mails.length).to.equal(1); cy.wrap(mails[0].body).should('have.string', 'This is a test mail sent using'); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); cy.wrap(mails[0].receivers).should('have.property', Cypress.env('email')); diff --git a/tests/System/integration/api/com_contact/Contacts.cy.js b/tests/System/integration/api/com_contact/Contacts.cy.js index 632e7bd0e6af1..0e428f617debe 100644 --- a/tests/System/integration/api/com_contact/Contacts.cy.js +++ b/tests/System/integration/api/com_contact/Contacts.cy.js @@ -57,7 +57,7 @@ describe('Test that contacts API endpoint', () => { .should('equal', 200)); cy.task('getMails').then((mails) => { - cy.wrap(mails).should('have.lengthOf', 1); + expect(mails.length).to.equal(1); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); cy.wrap(mails[0].receivers).should('have.property', Cypress.env('email')); cy.wrap(mails[0].headers.subject).should('equal', `${Cypress.env('sitename')}: automated test subject`); diff --git a/tests/System/integration/site/components/com_privacy/Request.cy.js b/tests/System/integration/site/components/com_privacy/Request.cy.js index 6064fbee328ef..f4122ab668c11 100644 --- a/tests/System/integration/site/components/com_privacy/Request.cy.js +++ b/tests/System/integration/site/components/com_privacy/Request.cy.js @@ -12,7 +12,7 @@ describe('Test in frontend that the privacy request view', () => { cy.task('getMails').then((mails) => { cy.get('.alert-message').should('contain.text', 'Your information request has been created. Before it can be processed, you must verify this request. An email has been sent to your address with additional instructions to complete this verification.'); - cy.wrap(mails).should('have.lengthOf', 2); + expect(mails.length).to.equal(2); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); cy.wrap(mails[0].body).should('have.string', `A new information request has been submitted by ${Cypress.env('email')}.`); cy.wrap(mails[1].body).should('have.string', 'Someone has created a request to export all personal information related to this email address at '); @@ -29,7 +29,7 @@ describe('Test in frontend that the privacy request view', () => { cy.task('getMails').then((mails) => { cy.get('.alert-message').should('contain.text', 'Your information request has been created. Before it can be processed, you must verify this request. An email has been sent to your address with additional instructions to complete this verification.'); - cy.wrap(mails).should('have.lengthOf', 2); + expect(mails.length).to.equal(2); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); cy.wrap(mails[0].body).should('have.string', `A new information request has been submitted by ${Cypress.env('email')}.`); cy.wrap(mails[1].body).should('have.string', 'Someone has created a request to export all personal information related to this email address at '); @@ -44,7 +44,7 @@ describe('Test in frontend that the privacy request view', () => { cy.task('getMails').then((mails) => { cy.get('.alert-message').should('contain.text', 'Your information request has been created. Before it can be processed, you must verify this request. An email has been sent to your address with additional instructions to complete this verification.'); - cy.wrap(mails).should('have.lengthOf', 2); + expect(mails.length).to.equal(2); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); cy.wrap(mails[0].body).should('have.string', `A new information request has been submitted by ${Cypress.env('email')}.`); cy.wrap(mails[1].body).should('have.string', 'Someone has created a request to remove all personal information related to this email address at '); @@ -61,7 +61,7 @@ describe('Test in frontend that the privacy request view', () => { cy.task('getMails').then((mails) => { cy.get('.alert-message').should('contain.text', 'Your information request has been created. Before it can be processed, you must verify this request. An email has been sent to your address with additional instructions to complete this verification.'); - cy.wrap(mails).should('have.lengthOf', 2); + expect(mails.length).to.equal(2); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); cy.wrap(mails[0].body).should('have.string', `A new information request has been submitted by ${Cypress.env('email')}.`); cy.wrap(mails[1].body).should('have.string', 'Someone has created a request to remove all personal information related to this email address at '); @@ -75,6 +75,7 @@ describe('Test in frontend that the privacy request view', () => { cy.get('.controls > .btn').click(); cy.task('getMails').then((mails) => { + expect(mails.length).to.equal(2); const str = mails[1].body; const firstSplit = str.split('URL: ')[1]; @@ -93,6 +94,7 @@ describe('Test in frontend that the privacy request view', () => { cy.get('.controls > .btn').click(); cy.task('getMails').then((mails) => { + expect(mails.length).to.equal(2); const str = mails[1].body; const firstSplitURL = str.split('paste your token into the form.\n')[1]; diff --git a/tests/System/integration/site/components/com_users/Remind.cy.js b/tests/System/integration/site/components/com_users/Remind.cy.js index cfff552d39d77..102463660b064 100644 --- a/tests/System/integration/site/components/com_users/Remind.cy.js +++ b/tests/System/integration/site/components/com_users/Remind.cy.js @@ -15,7 +15,7 @@ describe('Test in frontend that the users remind view', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a reminder.'); - cy.wrap(mails).should('have.lengthOf', 1); + expect(mails.length).to.equal(1); cy.wrap(mails[0].body).should('have.string', 'A username reminder has been requested'); cy.wrap(mails[0].body).should('have.string', '/test-reminder'); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); @@ -34,7 +34,7 @@ describe('Test in frontend that the users remind view', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a reminder.'); - cy.wrap(mails).should('have.lengthOf', 1); + expect(mails.length).to.equal(1); cy.wrap(mails[0].body).should('have.string', 'A username reminder has been requested'); cy.wrap(mails[0].body).should('have.string', '/component/users/login'); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); @@ -51,7 +51,7 @@ describe('Test in frontend that the users remind view', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a reminder.'); - cy.wrap(mails).should('have.lengthOf', 0); + expect(mails.length).to.equal(0); }); }); }); diff --git a/tests/System/integration/site/components/com_users/Reset.cy.js b/tests/System/integration/site/components/com_users/Reset.cy.js index c70f3d50178f0..df93ce7e5f952 100644 --- a/tests/System/integration/site/components/com_users/Reset.cy.js +++ b/tests/System/integration/site/components/com_users/Reset.cy.js @@ -11,7 +11,7 @@ describe('Test in frontend that the users reset view', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a link to reset the password for your account.'); - cy.wrap(mails).should('have.lengthOf', 1); + expect(mails.length).to.equal(1); cy.wrap(mails[0].body).should('have.string', 'To reset your password, you will need to submit this verification code'); cy.wrap(mails[0].body).should('have.string', '/component/users/reset'); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); @@ -34,7 +34,7 @@ describe('Test in frontend that the users reset view', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a link to reset the password for your account.'); - cy.wrap(mails).should('have.lengthOf', 1); + expect(mails.length).to.equal(1); cy.wrap(mails[0].body).should('have.string', 'To reset your password, you will need to submit this verification code'); cy.wrap(mails[0].body).should('have.string', '/test-reset'); cy.wrap(mails[0].sender).should('equal', Cypress.env('email')); @@ -51,7 +51,7 @@ describe('Test in frontend that the users reset view', () => { cy.task('getMails').then((mails) => { cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a link to reset the password for your account.'); - cy.wrap(mails).should('have.lengthOf', 0); + expect(mails.length).to.equal(0); }); });