From 2ceed99797ff59f8f0ba72b7e8c0f678f7240305 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 17:21:07 +0100 Subject: [PATCH 1/9] test rm cy.wait(x) --- .github/workflows/cypress-release-test.yml | 2 +- cypress/integration/activities.cy.tsx | 3 +-- cypress/integration/create-user-existing.cy.tsx | 3 --- cypress/integration/create-user-incorrect-email.cy.tsx | 3 --- cypress/integration/create-user-weak-password.cy.tsx | 3 --- cypress/integration/create-user.cy.tsx | 3 --- cypress/integration/create-user.de.cy.tsx | 3 --- cypress/integration/create-user.es.cy.tsx | 3 --- cypress/integration/create-user.fr.cy.tsx | 3 --- cypress/integration/create-user.hi.cy.tsx | 3 --- cypress/integration/navigation.cy.tsx | 2 -- cypress/integration/register-partner-with-code.cy.tsx | 6 +----- cypress/integration/register-partner-without-code.cy.tsx | 5 +---- cypress/integration/reset-password.cy.tsx | 1 - cypress/integration/user-account-settings.cy.tsx | 5 ----- cypress/support/commands.js | 7 ------- 16 files changed, 4 insertions(+), 51 deletions(-) diff --git a/.github/workflows/cypress-release-test.yml b/.github/workflows/cypress-release-test.yml index 6b987801..b5680ecd 100644 --- a/.github/workflows/cypress-release-test.yml +++ b/.github/workflows/cypress-release-test.yml @@ -2,7 +2,7 @@ name: Cypress release tests on: push: - branches: [develop, dependabot/**] + branches: [develop, remove-test-delays, dependabot/**] jobs: # vercel will redeploy the develop/staging app on creating a PR to main diff --git a/cypress/integration/activities.cy.tsx b/cypress/integration/activities.cy.tsx index f41a0dd2..5fbbb05d 100644 --- a/cypress/integration/activities.cy.tsx +++ b/cypress/integration/activities.cy.tsx @@ -8,8 +8,7 @@ describe('A logged in user should be able to navigate to activities and do an ex cy.get(`[qa-id=secondary-nav-activities-button]`, { timeout: 10000 }) .should('exist') .click() - .click(); //navigate to activities - double clicking just in case - cy.wait(2000); // wait to ensure the page has rendered and the auth checks have resolved + .click(); //navigate to activities - double clicking just in case // wait to ensure the page has rendered and the auth checks have resolved // Default timeout is 4 seconds so extended to 8 to avoid racy tests cy.get('h3', { timeout: 8000 }).contains('Thought diaries').should('exist').click(); //check click first exercise exists and open it diff --git a/cypress/integration/create-user-existing.cy.tsx b/cypress/integration/create-user-existing.cy.tsx index ae46359c..be6be5f7 100644 --- a/cypress/integration/create-user-existing.cy.tsx +++ b/cypress/integration/create-user-existing.cy.tsx @@ -7,18 +7,15 @@ describe('Create User', () => { it('Should not be able to create user with existing email', () => { // Start from the home page cy.visit('/'); - cy.wait(2000); // TODO put the correct home page check below when it is published // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); cy.get('#name', { timeout: 10000 }).type('Cypress test'); cy.get('#email', { timeout: 10000 }).type(username); cy.get('#password', { timeout: 10000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.wait(3000); cy.get('p', { timeout: 10000 }).should( 'contain', 'This email is already registered with Bloom', diff --git a/cypress/integration/create-user-incorrect-email.cy.tsx b/cypress/integration/create-user-incorrect-email.cy.tsx index 37e2a8b1..db032c48 100644 --- a/cypress/integration/create-user-incorrect-email.cy.tsx +++ b/cypress/integration/create-user-incorrect-email.cy.tsx @@ -7,18 +7,15 @@ describe('Create User', () => { it('Should not be able to create user with incorrect email', () => { // Start from the home page cy.visit('/'); - cy.wait(2000); // TODO put the correct home page check below when it is published // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); cy.get('#name', { timeout: 10000 }).type('Cypress test'); cy.get('#email', { timeout: 10000 }).type(username); cy.get('#password', { timeout: 10000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.wait(3000); cy.get('p', { timeout: 10000 }).should('contain', 'There was an error setting up your account'); }); }); diff --git a/cypress/integration/create-user-weak-password.cy.tsx b/cypress/integration/create-user-weak-password.cy.tsx index c384ec33..7a7dc420 100644 --- a/cypress/integration/create-user-weak-password.cy.tsx +++ b/cypress/integration/create-user-weak-password.cy.tsx @@ -7,18 +7,15 @@ describe('Create User', () => { it('Should not be able to create user with a weak password', () => { // Start from the home page cy.visit('/'); - cy.wait(2000); // TODO put the correct home page check below when it is published // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); cy.get('#name', { timeout: 10000 }).type('Cypress test'); cy.get('#email', { timeout: 10000 }).type(username); cy.get('#password', { timeout: 10000 }).type('123'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.wait(3000); cy.get('p', { timeout: 10000 }).should( 'contain', "Your password needs to be a little longer, so it's more secure.", diff --git a/cypress/integration/create-user.cy.tsx b/cypress/integration/create-user.cy.tsx index 5e1fd03e..4ec3c3a1 100644 --- a/cypress/integration/create-user.cy.tsx +++ b/cypress/integration/create-user.cy.tsx @@ -9,18 +9,15 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visit('/'); - cy.wait(2000); // TODO put the correct home page check below when it is published // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); cy.get('#name', { timeout: 10000 }).type('Cypress test'); cy.get('#email', { timeout: 10000 }).type(username); cy.get('#password', { timeout: 10000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.wait(3000); cy.get('h2', { timeout: 10000 }).should('contain', 'Help us understand'); }); after(() => { diff --git a/cypress/integration/create-user.de.cy.tsx b/cypress/integration/create-user.de.cy.tsx index a7bf11a0..abb56411 100644 --- a/cypress/integration/create-user.de.cy.tsx +++ b/cypress/integration/create-user.de.cy.tsx @@ -7,18 +7,15 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visitGermanPage('/'); - cy.wait(2000); cy.get('h1', { timeout: 8000 }) .contains('Begleite uns während deines Heilungsprozesses') .should('exist'); cy.get('a[href="/de/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 8000 }).should('contain', 'Konto anlegen'); cy.get('#name', { timeout: 8000 }).type('Cypress test'); cy.get('#email', { timeout: 8000 }).type(username); cy.get('#password', { timeout: 8000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Konto anlegen').click(); - cy.wait(3000); cy.get('h2', { timeout: 8000 }).should('contain', 'Hilf uns, zu verstehen'); }); diff --git a/cypress/integration/create-user.es.cy.tsx b/cypress/integration/create-user.es.cy.tsx index a14996a9..d6b5be6d 100644 --- a/cypress/integration/create-user.es.cy.tsx +++ b/cypress/integration/create-user.es.cy.tsx @@ -7,16 +7,13 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visitSpanishPage('/'); - cy.wait(2000); cy.get('h1', { timeout: 8000 }).contains('Acompáñanos en tu viaje de sanación').should('exist'); cy.get('a[href="/es/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 8000 }).should('contain', 'Crea una cuenta'); cy.get('#name', { timeout: 8000 }).type('Cypress test'); cy.get('#email', { timeout: 8000 }).type(username); cy.get('#password', { timeout: 8000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Crea una cuenta').click(); - cy.wait(3000); cy.get('h2', { timeout: 8000 }).should('contain', 'Ayúdanos a entender'); }); diff --git a/cypress/integration/create-user.fr.cy.tsx b/cypress/integration/create-user.fr.cy.tsx index 5e1863d8..3326f833 100644 --- a/cypress/integration/create-user.fr.cy.tsx +++ b/cypress/integration/create-user.fr.cy.tsx @@ -7,18 +7,15 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visitFrenchPage('/'); - cy.wait(2000); cy.get('h1', { timeout: 8000 }) .contains('Rejoins-nous sur ton chemin de guérison') .should('exist'); cy.get('a[href="/fr/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 8000 }).should('contain', 'Créer un compte'); cy.get('#name', { timeout: 8000 }).type('Cypress test'); cy.get('#email', { timeout: 8000 }).type(username); cy.get('#password', { timeout: 8000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Créer un compte').click(); - cy.wait(3000); cy.get('h2', { timeout: 8000 }).should('contain', 'Aidez-nous à compendre'); }); diff --git a/cypress/integration/create-user.hi.cy.tsx b/cypress/integration/create-user.hi.cy.tsx index bca2db73..f7a75e99 100644 --- a/cypress/integration/create-user.hi.cy.tsx +++ b/cypress/integration/create-user.hi.cy.tsx @@ -7,16 +7,13 @@ describe('Create User', () => { it('User should be able to create account in hindi', () => { // Start from the home page cy.visitHindiPage('/'); - cy.wait(2000); cy.get('a[href="/hi/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.wait(2000); cy.get('h2', { timeout: 8000 }).should('contain', 'Account banaiye'); cy.get('#name', { timeout: 8000 }).type('Cypress test'); cy.get('#email', { timeout: 8000 }).type(username); cy.get('#password', { timeout: 8000 }).type('testpassword'); cy.get('button[type="submit"]').contains('Account Banao').click(); - cy.wait(3000); }); after(() => { diff --git a/cypress/integration/navigation.cy.tsx b/cypress/integration/navigation.cy.tsx index b21a928c..af0ed1ad 100644 --- a/cypress/integration/navigation.cy.tsx +++ b/cypress/integration/navigation.cy.tsx @@ -51,7 +51,6 @@ describe('Navigation', () => { Cypress.env('bumble_partner_admin_email'), Cypress.env('bumble_partner_admin_password'), ); - cy.wait(2000); cy.createAccessCode({ featureLiveChat: true, @@ -97,7 +96,6 @@ describe('Navigation', () => { Cypress.env('badoo_partner_admin_email'), Cypress.env('badoo_partner_admin_password'), ); - cy.wait(2000); cy.createAccessCode({ featureLiveChat: true, diff --git a/cypress/integration/register-partner-with-code.cy.tsx b/cypress/integration/register-partner-with-code.cy.tsx index 731a7da9..66339eee 100644 --- a/cypress/integration/register-partner-with-code.cy.tsx +++ b/cypress/integration/register-partner-with-code.cy.tsx @@ -10,7 +10,6 @@ describe('Register with access code', () => { Cypress.env('badoo_partner_admin_email'), Cypress.env('badoo_partner_admin_password'), ); - cy.wait(2000); cy.createAccessCode({ featureLiveChat: true, @@ -27,7 +26,6 @@ describe('Register with access code', () => { it('Access code input should be on form', () => { // Start from the home page cy.visit(welcomeCodeLink); - cy.wait(5000); // The new page should contain an h2 with "Reset your password" cy.get('p', { timeout: 8000 }).contains( 'Enter the access code you received from Badoo to begin your Bloom journey.', @@ -35,14 +33,12 @@ describe('Register with access code', () => { cy.get('#accessCode') .invoke('val') .then((val) => expect(val).equals(welcomeCode)); - cy.get('button[type="submit"]').contains('Get started').click(); - cy.wait(2000); // waiting for dom to rerender + cy.get('button[type="submit"]').contains('Get started').click(); // waiting for dom to rerender cy.get('h2', { timeout: 8000 }).should('contain', 'Create account'); cy.get('#name').type('Cypress test'); cy.get('#email').type(username); cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.wait(4000); // Waiting for dom to rerender cy.get('h2', { timeout: 8000 }).should('contain', 'Help us understand'); }); after(() => { diff --git a/cypress/integration/register-partner-without-code.cy.tsx b/cypress/integration/register-partner-without-code.cy.tsx index f802002c..e9a1816a 100644 --- a/cypress/integration/register-partner-without-code.cy.tsx +++ b/cypress/integration/register-partner-without-code.cy.tsx @@ -8,21 +8,18 @@ describe('Register without access code', () => { it('Access code input should be on form', () => { // Start from the home page cy.visit('/welcome/bumble'); - cy.wait(5000); cy.get('p', { timeout: 8000 }) .contains('Enter the access code you received from Bumble to begin your Bloom journey.') .should('not.exist'); cy.get('p').contains( 'Create an account with Bloom to get started with our courses, or first find out more about Bloom below.', ); - cy.get('a', { timeout: 8000 }).contains('Get started').click(); - cy.wait(2000); // waiting for dom to rerender + cy.get('a', { timeout: 8000 }).contains('Get started').click(); // waiting for dom to rerender cy.get('h2', { timeout: 8000 }).should('contain', 'Create account'); cy.get('#name').type('Cypress test'); cy.get('#email').type(username); cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.wait(4000); // Waiting for dom to rerender cy.get('h2', { timeout: 8000 }).should('contain', 'Help us understand'); }); after(() => { diff --git a/cypress/integration/reset-password.cy.tsx b/cypress/integration/reset-password.cy.tsx index b20ea9d5..b38f3fac 100644 --- a/cypress/integration/reset-password.cy.tsx +++ b/cypress/integration/reset-password.cy.tsx @@ -25,7 +25,6 @@ describe('Reset password', () => { it('should see resend-link button after typing known email', () => { cy.visit(Cypress.env('reset_password_path')); - cy.wait(1000); // Waiting for dom to rerender as the email input was detaching cy.get('[qa-id=passwordResetEmailInput]', { timeout: 8000 }).type( `${Cypress.env('reset_pwd_confirm_email')}`, ); diff --git a/cypress/integration/user-account-settings.cy.tsx b/cypress/integration/user-account-settings.cy.tsx index 9abbf7af..ea5e0afe 100644 --- a/cypress/integration/user-account-settings.cy.tsx +++ b/cypress/integration/user-account-settings.cy.tsx @@ -11,14 +11,12 @@ describe('User account settings page', () => { cy.visit('/account/settings'); cy.get('#email').should('have.value', publicEmail); cy.get('#name').should('have.value', publicName); - cy.wait(3000); }); it('Should display error if tried to update email to a username that already exits', () => { cy.visit('/account/settings'); cy.get('#email').should('have.value', publicEmail); cy.get('#name').should('have.value', publicName); - cy.wait(3000); }); it('Should have marketing and service email checkbox fields and submit button', () => { @@ -26,7 +24,6 @@ describe('User account settings page', () => { cy.get('input[name="contactPermission"]').check(); cy.get('input[name="serviceEmailsPermission"]').check(); cy.get('button[type="submit"]').contains('Save email preferences').click(); - cy.wait(3000); }); it('Should have email reminder frequency form and load user data', () => { @@ -34,11 +31,9 @@ describe('User account settings page', () => { cy.get('input[name="email-reminders-settings"]').eq(3).should('be.checked'); cy.get('input[name="email-reminders-settings"]').eq(1).check(); cy.get('button[type="submit"]').contains('Save email reminders').click(); - cy.wait(3000); cy.get('input[name="email-reminders-settings"]').eq(1).should('be.checked'); cy.get('input[name="email-reminders-settings"]').eq(3).check(); cy.get('button[type="submit"]').contains('Save email reminders').click(); - cy.wait(3000); }); after(() => { diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 1c849e8a..1649684a 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -31,7 +31,6 @@ const http = require('http'); Cypress.Commands.add('uiLogin', (email, password) => { cy.visit('/auth/login'); - cy.wait(4000); cy.get('input[type="email"]', { timeout: 10000 }).click().type(email); cy.get('#password').type(password); cy.get('button[type="submit"]').contains('Login').click(); @@ -40,10 +39,7 @@ Cypress.Commands.add('uiLogin', (email, password) => { Cypress.Commands.add('uiLogout', (e) => { cy.get('#user-menu-button').click({ force: true }); - cy.wait(1000); - cy.get('#logout-button').click({ force: true }); - cy.wait(1000); }); // TODO maybe delete this helper - keeping for now but could potentially not be useful @@ -113,7 +109,6 @@ Cypress.Commands.add('deleteAllCypressUsers', () => { }, }); }); - cy.wait(2000); }); Cypress.Commands.add('deleteCypressAccessCodes', () => { @@ -126,7 +121,6 @@ Cypress.Commands.add('deleteCypressAccessCodes', () => { }, }); }); - cy.wait(2000); }); Cypress.Commands.add('cleanUpTestState', () => { @@ -140,7 +134,6 @@ Cypress.Commands.add('cleanUpTestState', () => { cy.clearAllCookies(); cy.clearAllLocalStorage(); cy.clearAllSessionStorage(); - cy.wait(1000); }); Cypress.Commands.add('visitGermanPage', (url) => { From 640efeb4d0efbb72b9df8c6f8881e2daafc9582a Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 17:22:14 +0100 Subject: [PATCH 2/9] fail dependapot pr review if severe --- .github/workflows/dependabot-pr-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-pr-review.yml b/.github/workflows/dependabot-pr-review.yml index 0345750a..60ad48fc 100644 --- a/.github/workflows/dependabot-pr-review.yml +++ b/.github/workflows/dependabot-pr-review.yml @@ -19,4 +19,4 @@ jobs: uses: actions/dependency-review-action@v4 with: # fails when moderate vulnerabilities are deteched - fail-on-severity: moderate + fail-on-severity: severe From ce65b30d5420d0596056f922f09db82b3b374253 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 17:31:04 +0100 Subject: [PATCH 3/9] rm timeouts --- cypress/integration/404.cy.tsx | 4 +-- cypress/integration/activities.cy.tsx | 7 ++--- cypress/integration/auth-redirect.cy.tsx | 2 +- cypress/integration/cookie-consent.cy.tsx | 4 +-- .../integration/create-user-existing.cy.tsx | 17 +++++------- .../create-user-incorrect-email.cy.tsx | 14 +++++----- .../create-user-weak-password.cy.tsx | 14 +++++----- cypress/integration/create-user.cy.tsx | 14 +++++----- cypress/integration/create-user.de.cy.tsx | 16 +++++------- cypress/integration/create-user.es.cy.tsx | 14 +++++----- cypress/integration/create-user.fr.cy.tsx | 16 +++++------- cypress/integration/create-user.hi.cy.tsx | 10 +++---- cypress/integration/delete-user.cy.tsx | 8 +++--- .../integration/grounding-exercises.cy.tsx | 2 +- .../integration/initial-exploration.cy.tsx | 12 ++++----- cypress/integration/navigation.cy.tsx | 10 +++---- cypress/integration/notes.cy.tsx | 4 +-- cypress/integration/partner-admin.cy.tsx | 2 +- .../register-partner-with-code.cy.tsx | 6 ++--- .../register-partner-without-code.cy.tsx | 8 +++--- cypress/integration/reset-password.cy.tsx | 17 +++++------- cypress/integration/therapy-usage.cy.tsx | 10 +++---- cypress/integration/user-chat.cy.tsx | 2 +- .../user-course-session-behaviour.cy.tsx | 16 +++--------- cypress/integration/user-update-email.cy.tsx | 26 +++++++++---------- 25 files changed, 114 insertions(+), 141 deletions(-) diff --git a/cypress/integration/404.cy.tsx b/cypress/integration/404.cy.tsx index c86bcb1e..72436b1e 100644 --- a/cypress/integration/404.cy.tsx +++ b/cypress/integration/404.cy.tsx @@ -7,11 +7,11 @@ describe.skip('Custom 404 page should display if wrong url is typed in', () => { it('Should show custom 404 page', () => { cy.visit('/invalid-url', { failOnStatusCode: false }); - cy.get('p', { timeout: 10000 }).contains('This page could not be found'); + cy.get('p').contains('This page could not be found'); }); it('Should show custom 404 page at incorrect courses ', () => { cy.visit('/courses/invalid-course', { failOnStatusCode: false }); - cy.get('p', { timeout: 10000 }).contains('This page could not be found'); + cy.get('p').contains('This page could not be found'); }); }); diff --git a/cypress/integration/activities.cy.tsx b/cypress/integration/activities.cy.tsx index 5fbbb05d..659bedf0 100644 --- a/cypress/integration/activities.cy.tsx +++ b/cypress/integration/activities.cy.tsx @@ -5,12 +5,9 @@ describe('A logged in user should be able to navigate to activities and do an ex }); it('Should go to the activities page and click on an exercise', () => { - cy.get(`[qa-id=secondary-nav-activities-button]`, { timeout: 10000 }) - .should('exist') - .click() - .click(); //navigate to activities - double clicking just in case // wait to ensure the page has rendered and the auth checks have resolved + cy.get(`[qa-id=secondary-nav-activities-button]`).should('exist').click().click(); //navigate to activities - double clicking just in case // wait to ensure the page has rendered and the auth checks have resolved // Default timeout is 4 seconds so extended to 8 to avoid racy tests - cy.get('h3', { timeout: 8000 }).contains('Thought diaries').should('exist').click(); //check click first exercise exists and open it + cy.get('h3').contains('Thought diaries').should('exist').click(); //check click first exercise exists and open it cy.get('.MuiCollapse-root.MuiCollapse-entered') //check the audio file exists in accordian .should('exist') diff --git a/cypress/integration/auth-redirect.cy.tsx b/cypress/integration/auth-redirect.cy.tsx index 5672fc7d..bf78ea84 100644 --- a/cypress/integration/auth-redirect.cy.tsx +++ b/cypress/integration/auth-redirect.cy.tsx @@ -7,7 +7,7 @@ describe('Auth redirect', () => { '/courses/image-based-abuse-and-rebuilding-ourselves/the-social-context-of-image-based-abuse-and-victim-blaming', ); - cy.get('h2', { timeout: 8000 }).should('contain', 'Welcome back'); + cy.get('h2').should('contain', 'Welcome back'); cy.url().should( 'include', 'return_url=%2Fcourses%2Fimage-based-abuse-and-rebuilding-ourselves%2Fthe-social-context-of-image-based-abuse-and-victim-blaming', diff --git a/cypress/integration/cookie-consent.cy.tsx b/cypress/integration/cookie-consent.cy.tsx index 6fb9ad9e..adf7a5be 100644 --- a/cypress/integration/cookie-consent.cy.tsx +++ b/cypress/integration/cookie-consent.cy.tsx @@ -6,7 +6,7 @@ describe('Cookie consent', () => { cy.get('[qa-id="cookieConsentAcceptButton"]').click(); // Cookie should be set cy.wait; - cy.getCookie('analyticsConsent', { timeout: 8000 }).should('have.property', 'value', 'true'); + cy.getCookie('analyticsConsent').should('have.property', 'value', 'true'); // Banner should have disappeared cy.get('[qa-id="cookieConsentAcceptButton"]').should('not.exist'); @@ -17,7 +17,7 @@ describe('Cookie consent', () => { // Click on cookie consent cy.get('[qa-id="cookieConsentDeclineButton"]').click(); // Cookie should be set - cy.getCookie('analyticsConsent', { timeout: 8000 }).should('have.property', 'value', 'false'); + cy.getCookie('analyticsConsent').should('have.property', 'value', 'false'); // Banner should have disappeared cy.get('[qa-id="cookieConsentAcceptButton"]').should('not.exist'); }); diff --git a/cypress/integration/create-user-existing.cy.tsx b/cypress/integration/create-user-existing.cy.tsx index be6be5f7..c8fb18e1 100644 --- a/cypress/integration/create-user-existing.cy.tsx +++ b/cypress/integration/create-user-existing.cy.tsx @@ -8,17 +8,14 @@ describe('Create User', () => { // Start from the home page cy.visit('/'); // TODO put the correct home page check below when it is published - // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); + // cy.get('h2',).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions - cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); - cy.get('#name', { timeout: 10000 }).type('Cypress test'); - cy.get('#email', { timeout: 10000 }).type(username); - cy.get('#password', { timeout: 10000 }).type('testpassword'); + cy.get('a[href="/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Create account'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.get('p', { timeout: 10000 }).should( - 'contain', - 'This email is already registered with Bloom', - ); + cy.get('p').should('contain', 'This email is already registered with Bloom'); }); }); diff --git a/cypress/integration/create-user-incorrect-email.cy.tsx b/cypress/integration/create-user-incorrect-email.cy.tsx index db032c48..f80fa060 100644 --- a/cypress/integration/create-user-incorrect-email.cy.tsx +++ b/cypress/integration/create-user-incorrect-email.cy.tsx @@ -8,14 +8,14 @@ describe('Create User', () => { // Start from the home page cy.visit('/'); // TODO put the correct home page check below when it is published - // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); + // cy.get('h2',).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions - cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); - cy.get('#name', { timeout: 10000 }).type('Cypress test'); - cy.get('#email', { timeout: 10000 }).type(username); - cy.get('#password', { timeout: 10000 }).type('testpassword'); + cy.get('a[href="/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Create account'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.get('p', { timeout: 10000 }).should('contain', 'There was an error setting up your account'); + cy.get('p').should('contain', 'There was an error setting up your account'); }); }); diff --git a/cypress/integration/create-user-weak-password.cy.tsx b/cypress/integration/create-user-weak-password.cy.tsx index 7a7dc420..b8a79b19 100644 --- a/cypress/integration/create-user-weak-password.cy.tsx +++ b/cypress/integration/create-user-weak-password.cy.tsx @@ -8,15 +8,15 @@ describe('Create User', () => { // Start from the home page cy.visit('/'); // TODO put the correct home page check below when it is published - // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); + // cy.get('h2',).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions - cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); - cy.get('#name', { timeout: 10000 }).type('Cypress test'); - cy.get('#email', { timeout: 10000 }).type(username); - cy.get('#password', { timeout: 10000 }).type('123'); + cy.get('a[href="/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Create account'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('123'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.get('p', { timeout: 10000 }).should( + cy.get('p').should( 'contain', "Your password needs to be a little longer, so it's more secure.", ); diff --git a/cypress/integration/create-user.cy.tsx b/cypress/integration/create-user.cy.tsx index 4ec3c3a1..f7d90ca7 100644 --- a/cypress/integration/create-user.cy.tsx +++ b/cypress/integration/create-user.cy.tsx @@ -10,15 +10,15 @@ describe('Create User', () => { // Start from the home page cy.visit('/'); // TODO put the correct home page check below when it is published - // cy.get('h2', { timeout: 8000 }).contains('Get started').should('exist'); + // cy.get('h2',).contains('Get started').should('exist'); // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions - cy.get('a[href="/auth/register"]', { timeout: 10000 }).first().click({ force: true }); - cy.get('h2', { timeout: 10000 }).should('contain', 'Create account'); - cy.get('#name', { timeout: 10000 }).type('Cypress test'); - cy.get('#email', { timeout: 10000 }).type(username); - cy.get('#password', { timeout: 10000 }).type('testpassword'); + cy.get('a[href="/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Create account'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.get('h2', { timeout: 10000 }).should('contain', 'Help us understand'); + cy.get('h2').should('contain', 'Help us understand'); }); after(() => { cy.logout(); diff --git a/cypress/integration/create-user.de.cy.tsx b/cypress/integration/create-user.de.cy.tsx index abb56411..39068f03 100644 --- a/cypress/integration/create-user.de.cy.tsx +++ b/cypress/integration/create-user.de.cy.tsx @@ -7,16 +7,14 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visitGermanPage('/'); - cy.get('h1', { timeout: 8000 }) - .contains('Begleite uns während deines Heilungsprozesses') - .should('exist'); - cy.get('a[href="/de/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.get('h2', { timeout: 8000 }).should('contain', 'Konto anlegen'); - cy.get('#name', { timeout: 8000 }).type('Cypress test'); - cy.get('#email', { timeout: 8000 }).type(username); - cy.get('#password', { timeout: 8000 }).type('testpassword'); + cy.get('h1').contains('Begleite uns während deines Heilungsprozesses').should('exist'); + cy.get('a[href="/de/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Konto anlegen'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Konto anlegen').click(); - cy.get('h2', { timeout: 8000 }).should('contain', 'Hilf uns, zu verstehen'); + cy.get('h2').should('contain', 'Hilf uns, zu verstehen'); }); after(() => { diff --git a/cypress/integration/create-user.es.cy.tsx b/cypress/integration/create-user.es.cy.tsx index d6b5be6d..c6038b98 100644 --- a/cypress/integration/create-user.es.cy.tsx +++ b/cypress/integration/create-user.es.cy.tsx @@ -7,14 +7,14 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visitSpanishPage('/'); - cy.get('h1', { timeout: 8000 }).contains('Acompáñanos en tu viaje de sanación').should('exist'); - cy.get('a[href="/es/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.get('h2', { timeout: 8000 }).should('contain', 'Crea una cuenta'); - cy.get('#name', { timeout: 8000 }).type('Cypress test'); - cy.get('#email', { timeout: 8000 }).type(username); - cy.get('#password', { timeout: 8000 }).type('testpassword'); + cy.get('h1').contains('Acompáñanos en tu viaje de sanación').should('exist'); + cy.get('a[href="/es/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Crea una cuenta'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Crea una cuenta').click(); - cy.get('h2', { timeout: 8000 }).should('contain', 'Ayúdanos a entender'); + cy.get('h2').should('contain', 'Ayúdanos a entender'); }); after(() => { diff --git a/cypress/integration/create-user.fr.cy.tsx b/cypress/integration/create-user.fr.cy.tsx index 3326f833..c43ca691 100644 --- a/cypress/integration/create-user.fr.cy.tsx +++ b/cypress/integration/create-user.fr.cy.tsx @@ -7,16 +7,14 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visitFrenchPage('/'); - cy.get('h1', { timeout: 8000 }) - .contains('Rejoins-nous sur ton chemin de guérison') - .should('exist'); - cy.get('a[href="/fr/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.get('h2', { timeout: 8000 }).should('contain', 'Créer un compte'); - cy.get('#name', { timeout: 8000 }).type('Cypress test'); - cy.get('#email', { timeout: 8000 }).type(username); - cy.get('#password', { timeout: 8000 }).type('testpassword'); + cy.get('h1').contains('Rejoins-nous sur ton chemin de guérison').should('exist'); + cy.get('a[href="/fr/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Créer un compte'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Créer un compte').click(); - cy.get('h2', { timeout: 8000 }).should('contain', 'Aidez-nous à compendre'); + cy.get('h2').should('contain', 'Aidez-nous à compendre'); }); after(() => { diff --git a/cypress/integration/create-user.hi.cy.tsx b/cypress/integration/create-user.hi.cy.tsx index f7a75e99..4b1d4343 100644 --- a/cypress/integration/create-user.hi.cy.tsx +++ b/cypress/integration/create-user.hi.cy.tsx @@ -8,11 +8,11 @@ describe('Create User', () => { // Start from the home page cy.visitHindiPage('/'); - cy.get('a[href="/hi/auth/register"]', { timeout: 5000 }).first().click({ force: true }); - cy.get('h2', { timeout: 8000 }).should('contain', 'Account banaiye'); - cy.get('#name', { timeout: 8000 }).type('Cypress test'); - cy.get('#email', { timeout: 8000 }).type(username); - cy.get('#password', { timeout: 8000 }).type('testpassword'); + cy.get('a[href="/hi/auth/register"]').first().click({ force: true }); + cy.get('h2').should('contain', 'Account banaiye'); + cy.get('#name').type('Cypress test'); + cy.get('#email').type(username); + cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Account Banao').click(); }); diff --git a/cypress/integration/delete-user.cy.tsx b/cypress/integration/delete-user.cy.tsx index 3bad0155..c68cef89 100644 --- a/cypress/integration/delete-user.cy.tsx +++ b/cypress/integration/delete-user.cy.tsx @@ -8,10 +8,8 @@ describe('Delete User', () => { }); it(`should be able to delete user from accounts settings page`, () => { cy.visit('/account/settings'); - cy.get('#delete-account-button', { timeout: 10000 }) - .should('contain.text', 'Delete Account') - .click(); - cy.get('#confirm-dialog-submit', { timeout: 10000 }).click(); - cy.url({ timeout: 10000 }).should('include', '/'); + cy.get('#delete-account-button').should('contain.text', 'Delete Account').click(); + cy.get('#confirm-dialog-submit').click(); + cy.url().should('include', '/'); }); }); diff --git a/cypress/integration/grounding-exercises.cy.tsx b/cypress/integration/grounding-exercises.cy.tsx index 99038115..df1124a2 100644 --- a/cypress/integration/grounding-exercises.cy.tsx +++ b/cypress/integration/grounding-exercises.cy.tsx @@ -7,7 +7,7 @@ describe('A logged in user should be able to navigate to grounding and do an exe it('Should go to the grounding page and click on an exercise', () => { cy.get(`[qa-id=secondary-nav-grounding-button]`).should('exist').click(); //navigate to grounding // Extending timeout to ensure tests don't fail because of lazy loading - cy.get('h3', { timeout: 8000 }).contains('Visual breathing').should('exist').click(); //check visual breathing exercise exists and open it + cy.get('h3').contains('Visual breathing').should('exist').click(); //check visual breathing exercise exists and open it cy.get('audio') //check the audio file exists in accordian .should('exist') diff --git a/cypress/integration/initial-exploration.cy.tsx b/cypress/integration/initial-exploration.cy.tsx index 62aa7267..77faf273 100644 --- a/cypress/integration/initial-exploration.cy.tsx +++ b/cypress/integration/initial-exploration.cy.tsx @@ -1,16 +1,16 @@ describe('Initial exploration', () => { it('should be able to explore all pages', () => { cy.visit('/'); - cy.get('h1', { timeout: 8000 }).contains('Join us on your healing journey'); + cy.get('h1').contains('Join us on your healing journey'); cy.get(`[qa-id=secondary-nav-chat-button]`).click(); - cy.get('a', { timeout: 8000 }).contains('Get started'); + cy.get('a').contains('Get started'); cy.get(`[qa-id=secondary-nav-grounding-button]`).click(); - cy.get('a', { timeout: 8000 }).contains('Get started'); + cy.get('a').contains('Get started'); cy.get(`[qa-id=secondary-nav-activities-button]`).click(); - cy.get('a', { timeout: 8000 }).contains('Get started'); + cy.get('a').contains('Get started'); cy.get(`[qa-id=secondary-nav-notes-button]`).click(); - cy.get('a', { timeout: 8000 }).contains('Get started'); + cy.get('a').contains('Get started'); cy.get(`[qa-id=secondary-nav-courses-button]`).click(); - cy.get('a', { timeout: 8000 }).contains('Get started'); + cy.get('a').contains('Get started'); }); }); diff --git a/cypress/integration/navigation.cy.tsx b/cypress/integration/navigation.cy.tsx index af0ed1ad..96d7094f 100644 --- a/cypress/integration/navigation.cy.tsx +++ b/cypress/integration/navigation.cy.tsx @@ -6,7 +6,7 @@ describe('Navigation', () => { describe('A non-logged in user', () => { it('on the home page, the nav bar should have the correct links ', () => { cy.visit('/'); - cy.get(`[qa-id=home-logo-link]`, { timeout: 8000 }).should('exist'); + cy.get(`[qa-id=home-logo-link]`).should('exist'); cy.get(`[qa-id=user-menu-button]`).should('not.exist'); cy.get(`[qa-id=language-menu-button]`).should('exist'); cy.get(`[qa-id=meet-team-menu-button]`).should('exist'); @@ -25,7 +25,7 @@ describe('Navigation', () => { }); it('on the home page, the nav bar should have the correct links ', () => { cy.visit('/'); - cy.get(`[qa-id=home-logo-link]`, { timeout: 8000 }).should('exist'); + cy.get(`[qa-id=home-logo-link]`).should('exist'); cy.get(`[qa-id=user-menu-button]`).should('exist'); cy.get(`[qa-id=language-menu-button]`).should('exist'); cy.get(`[qa-id=meet-team-menu-button]`).should('exist'); @@ -70,7 +70,7 @@ describe('Navigation', () => { }); it('on the home page, the nav bar should have the correct links ', () => { cy.visit('/'); - cy.get(`[qa-id=home-logo-link]`, { timeout: 8000 }).should('exist'); + cy.get(`[qa-id=home-logo-link]`).should('exist'); cy.get(`[qa-id=user-menu-button]`).should('exist'); cy.get(`[qa-id=language-menu-button]`).should('exist'); cy.get(`[qa-id=meet-team-menu-button]`).should('exist'); @@ -115,7 +115,7 @@ describe('Navigation', () => { }); it('on the home page, the nav bar should have the correct links ', () => { cy.visit('/'); - cy.get(`[qa-id=home-logo-link]`, { timeout: 8000 }).should('exist'); + cy.get(`[qa-id=home-logo-link]`).should('exist'); cy.get(`[qa-id=user-menu-button]`).should('exist'); cy.get(`[qa-id=language-menu-button]`).should('exist'); cy.get(`[qa-id=meet-team-menu-button]`).should('exist'); @@ -142,7 +142,7 @@ describe('Navigation', () => { }); it('on the home page, the nav bar should have the correct links ', () => { cy.visit('/'); - cy.get(`[qa-id=home-logo-link]`, { timeout: 8000 }).should('exist'); + cy.get(`[qa-id=home-logo-link]`).should('exist'); cy.get(`[qa-id=user-menu-button]`).should('exist'); cy.get(`[qa-id=language-menu-button]`).should('exist'); cy.get(`[qa-id=meet-team-menu-button]`).should('exist'); diff --git a/cypress/integration/notes.cy.tsx b/cypress/integration/notes.cy.tsx index 0b73b3f5..dcc3729f 100644 --- a/cypress/integration/notes.cy.tsx +++ b/cypress/integration/notes.cy.tsx @@ -6,7 +6,7 @@ describe('A logged in user should be able to subscribe to notes from bloom', () it('Should go to the notes page and try to subscribe using an incorrect number', () => { cy.visit('/'); - cy.get(`[qa-id=secondary-nav-notes-button]`, { timeout: 8000 }).should('exist').click(); //navigate to notes + cy.get(`[qa-id=secondary-nav-notes-button]`).should('exist').click(); //navigate to notes cy.get('h2').contains('Subscribe to Notes from Bloom').should('exist'); //check subscribe to notes form exists @@ -14,7 +14,7 @@ describe('A logged in user should be able to subscribe to notes from bloom', () cy.get('button[type="submit"]').contains('Subscribe').click(); //submit form - cy.get('p', { timeout: 3000 }).should('contain', 'Your phone number appears to be invalid'); //check the form submission fails + cy.get('p').should('contain', 'Your phone number appears to be invalid'); //check the form submission fails }); after(() => { diff --git a/cypress/integration/partner-admin.cy.tsx b/cypress/integration/partner-admin.cy.tsx index ef94bc08..256a16cf 100644 --- a/cypress/integration/partner-admin.cy.tsx +++ b/cypress/integration/partner-admin.cy.tsx @@ -8,7 +8,7 @@ describe('A partner admin should be directed to admin ', () => { Cypress.env('bumble_partner_admin_email'), Cypress.env('bumble_partner_admin_password'), ); - cy.get('[qa-id=partner-admin-menu-button]', { timeout: 10000 }).should('exist'); + cy.get('[qa-id=partner-admin-menu-button]').should('exist'); cy.get('h2').contains('Create access code').should('exist'); // We should be redirected to the create access code page }); diff --git a/cypress/integration/register-partner-with-code.cy.tsx b/cypress/integration/register-partner-with-code.cy.tsx index 66339eee..0dd817fb 100644 --- a/cypress/integration/register-partner-with-code.cy.tsx +++ b/cypress/integration/register-partner-with-code.cy.tsx @@ -27,19 +27,19 @@ describe('Register with access code', () => { // Start from the home page cy.visit(welcomeCodeLink); // The new page should contain an h2 with "Reset your password" - cy.get('p', { timeout: 8000 }).contains( + cy.get('p').contains( 'Enter the access code you received from Badoo to begin your Bloom journey.', ); cy.get('#accessCode') .invoke('val') .then((val) => expect(val).equals(welcomeCode)); cy.get('button[type="submit"]').contains('Get started').click(); // waiting for dom to rerender - cy.get('h2', { timeout: 8000 }).should('contain', 'Create account'); + cy.get('h2').should('contain', 'Create account'); cy.get('#name').type('Cypress test'); cy.get('#email').type(username); cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.get('h2', { timeout: 8000 }).should('contain', 'Help us understand'); + cy.get('h2').should('contain', 'Help us understand'); }); after(() => { cy.logout(); diff --git a/cypress/integration/register-partner-without-code.cy.tsx b/cypress/integration/register-partner-without-code.cy.tsx index e9a1816a..9b9a9a53 100644 --- a/cypress/integration/register-partner-without-code.cy.tsx +++ b/cypress/integration/register-partner-without-code.cy.tsx @@ -8,19 +8,19 @@ describe('Register without access code', () => { it('Access code input should be on form', () => { // Start from the home page cy.visit('/welcome/bumble'); - cy.get('p', { timeout: 8000 }) + cy.get('p') .contains('Enter the access code you received from Bumble to begin your Bloom journey.') .should('not.exist'); cy.get('p').contains( 'Create an account with Bloom to get started with our courses, or first find out more about Bloom below.', ); - cy.get('a', { timeout: 8000 }).contains('Get started').click(); // waiting for dom to rerender - cy.get('h2', { timeout: 8000 }).should('contain', 'Create account'); + cy.get('a').contains('Get started').click(); // waiting for dom to rerender + cy.get('h2').should('contain', 'Create account'); cy.get('#name').type('Cypress test'); cy.get('#email').type(username); cy.get('#password').type('testpassword'); cy.get('button[type="submit"]').contains('Create account').click(); - cy.get('h2', { timeout: 8000 }).should('contain', 'Help us understand'); + cy.get('h2').should('contain', 'Help us understand'); }); after(() => { cy.logout(); diff --git a/cypress/integration/reset-password.cy.tsx b/cypress/integration/reset-password.cy.tsx index b38f3fac..a58eb84a 100644 --- a/cypress/integration/reset-password.cy.tsx +++ b/cypress/integration/reset-password.cy.tsx @@ -9,7 +9,7 @@ describe('Reset password', () => { cy.visit('/'); // Find a link with an href attribute containing "login" and click it - cy.get('a[href*="login"]', { timeout: 8000 }).click(); + cy.get('a[href*="login"]').click(); // The new url should include "login" cy.url().should('include', Cypress.env('login_path')); @@ -20,20 +20,15 @@ describe('Reset password', () => { cy.url().should('include', Cypress.env('reset_password_path')); // The new page should contain an h2 with "Reset your password" - cy.get('h2', { timeout: 8000 }).contains('Reset your password'); + cy.get('h2').contains('Reset your password'); }); it('should see resend-link button after typing known email', () => { cy.visit(Cypress.env('reset_password_path')); - cy.get('[qa-id=passwordResetEmailInput]', { timeout: 8000 }).type( - `${Cypress.env('reset_pwd_confirm_email')}`, - ); + cy.get('[qa-id=passwordResetEmailInput]').type(`${Cypress.env('reset_pwd_confirm_email')}`); cy.get('[qa-id=passwordResetEmailButton]').click(); - cy.get('p', { timeout: 8000 }).should( - 'contain', - 'Check your emails for a reset link from Bloom.', - ); + cy.get('p').should('contain', 'Check your emails for a reset link from Bloom.'); cy.get('button[type="submit"]').contains('Resend email'); }); @@ -48,8 +43,8 @@ describe('Reset password', () => { // Reset password cy.visit(Cypress.env('reset_password_path')); - cy.get('[qa-id=passwordResetEmailInput]', { timeout: 8000 }).focus().type(`${email}{enter}`); - cy.get('p', { timeout: 8000 }) + cy.get('[qa-id=passwordResetEmailInput]').focus().type(`${email}{enter}`); + cy.get('p') // check that front-end confirms an email has been sent .should('contain', 'Check your emails for a reset link from Bloom.') .then(async () => { diff --git a/cypress/integration/therapy-usage.cy.tsx b/cypress/integration/therapy-usage.cy.tsx index 7931ff24..52453948 100644 --- a/cypress/integration/therapy-usage.cy.tsx +++ b/cypress/integration/therapy-usage.cy.tsx @@ -17,7 +17,7 @@ describe('Therapy Usage', () => { it('Navigate to the admin page and create the access code', () => { cy.visit('/'); - cy.get(`[qa-id=partner-admin-menu-button]`, { timeout: 8000 }).should('exist').click(); //Find admin button and click + cy.get(`[qa-id=partner-admin-menu-button]`).should('exist').click(); //Find admin button and click cy.uiCreateAccessCode().then((res) => { accessCode = res; }); @@ -36,17 +36,15 @@ describe('Therapy Usage', () => { it('Log in as new bumble user and apply code', () => { cy.visit('/welcome/bumble'); - cy.get('button#user-menu-button', { timeout: 10000 }).should('exist').click(); //check user menu exists and access it + cy.get('button#user-menu-button').should('exist').click(); //check user menu exists and access it cy.get('a').contains('Apply a code').should('exist').click(); //go to the apply code page cy.get('input#accessCode').should('exist').click().type(accessCode); // populate the access code field cy.get('button[type="submit"]').contains('Apply code').click(); // submit form to add access code - cy.get('p', { timeout: 10000 }) - .contains('A Bumble code was applied to your account!') - .should('exist'); //check form submitted successfully + cy.get('p').contains('A Bumble code was applied to your account!').should('exist'); //check form submitted successfully }); it('Check therapy is available and start to book a session', () => { cy.visit('/welcome/bumble'); - cy.get(`[qa-id=secondary-nav-therapy-button]`, { timeout: 10000 }).should('exist').click(); //Find therapy button and click + cy.get(`[qa-id=secondary-nav-therapy-button]`).should('exist').click(); //Find therapy button and click cy.get('#therapy-sessions-remaining').should('have.text', '6'); //check number of therapy sessions is 6 cy.get('button').contains('Begin booking').should('exist').click(); //begin booking cy.get('iframe[title="Booking widget"]').should('exist'); //check it worked diff --git a/cypress/integration/user-chat.cy.tsx b/cypress/integration/user-chat.cy.tsx index 3d270868..d75e1dcf 100644 --- a/cypress/integration/user-chat.cy.tsx +++ b/cypress/integration/user-chat.cy.tsx @@ -6,7 +6,7 @@ describe('A logged in public user can start a chat', () => { it('Navigate to the chat page and begin a chat', () => { cy.visit('/'); //intitial home page visit - cy.get(`[qa-id=secondary-nav-chat-button]`, { timeout: 8000 }).should('exist').click(); //go to chat page + cy.get(`[qa-id=secondary-nav-chat-button]`).should('exist').click(); //go to chat page cy.get('button[type="button"]').contains('Start a chat').click(); //click button to start chatting diff --git a/cypress/integration/user-course-session-behaviour.cy.tsx b/cypress/integration/user-course-session-behaviour.cy.tsx index b602ee2e..c349b185 100644 --- a/cypress/integration/user-course-session-behaviour.cy.tsx +++ b/cypress/integration/user-course-session-behaviour.cy.tsx @@ -15,27 +15,19 @@ describe.only('A logged in user should be able to navigate to a course session a it('Should go to courses page and select a course & session', () => { cy.logInWithEmailAndPassword(newUserEmail, password); //log in to test user - cy.get(`[qa-id=secondary-nav-courses-button]`, { timeout: 8000 }).should('exist').click(); //navigate to courses + cy.get(`[qa-id=secondary-nav-courses-button]`).should('exist').click(); //navigate to courses - cy.get('a[href*="healing-from-sexual-trauma"]', { - timeout: 8000, - }) - .first() - .click(); //click on a course when link load + cy.get('a[href*="healing-from-sexual-trauma"]').first().click(); //click on a course when link load // cy.getIframeBody().find('button').click(); Attempting to watch the session video. iframe isnt working at the moment - cy.get('a[href*="what-is-sexual-trauma"]', { - timeout: 8000, - }) - .first() - .click(); //click on a session when link loads + cy.get('a[href*="what-is-sexual-trauma"]').first().click(); //click on a session when link loads }); it('Should read activity & bonus content and complete session', () => { cy.visit('/courses/healing-from-sexual-trauma/what-is-sexual-trauma'); - cy.get('h3', { timeout: 10000 }).contains('Activity').click(); //open activities + cy.get('h3').contains('Activity').click(); //open activities cy.get('h3').contains('Bonus content').click(); //open bonus content diff --git a/cypress/integration/user-update-email.cy.tsx b/cypress/integration/user-update-email.cy.tsx index 207ffb01..076f5da0 100644 --- a/cypress/integration/user-update-email.cy.tsx +++ b/cypress/integration/user-update-email.cy.tsx @@ -10,19 +10,19 @@ describe('User account settings page', () => { it('Should successfully update name', () => { cy.visit('/account/settings'); - cy.get('#name', { timeout: 10000 }).clear().type('Updated name'); - cy.get('#profile-settings-submit', { timeout: 10000 }).click(); - cy.get(`[data-testid='CheckCircleOutlinedIcon']`, { timeout: 10000 }).should('be.visible'); + cy.get('#name').clear().type('Updated name'); + cy.get('#profile-settings-submit').click(); + cy.get(`[data-testid='CheckCircleOutlinedIcon']`).should('be.visible'); }); it('Should display error if attempting to update email to existing email in use', () => { cy.visit('/account/settings'); - cy.get('#email', { timeout: 10000 }) + cy.get('#email') .clear() .type(Cypress.env('public_email') as string); - cy.get('#profile-settings-submit', { timeout: 10000 }).click(); - cy.get('#confirm-dialog-submit', { timeout: 10000 }).click(); - cy.get('p', { timeout: 10000 }) + cy.get('#profile-settings-submit').click(); + cy.get('#confirm-dialog-submit').click(); + cy.get('p') .contains('This email is already in use by another account, please try again') .should('be.visible'); }); @@ -30,15 +30,15 @@ describe('User account settings page', () => { it('Should successfully update email', () => { const newEmail = `cypresstestemail+${Date.now()}@chayn.co`; cy.visit('/account/settings'); - cy.get('#email', { timeout: 10000 }).clear().type(newEmail); - cy.get('#profile-settings-submit', { timeout: 10000 }).click(); - cy.get('#confirm-dialog-submit', { timeout: 10000 }).click(); - cy.url({ timeout: 10000 }).should('include', '/auth/login'); + cy.get('#email').clear().type(newEmail); + cy.get('#profile-settings-submit').click(); + cy.get('#confirm-dialog-submit').click(); + cy.url().should('include', '/auth/login'); cy.get('#email').type(newEmail); cy.get('#password').type(password); - cy.get('#login-submit', { timeout: 10000 }).click(); + cy.get('#login-submit').click(); - cy.get('#email', { timeout: 10000 }).should('have.value', newEmail); + cy.get('#email').should('have.value', newEmail); }); after(() => { cy.logout(); From 8a702d9e2daf555ada3183925ef959608e08ec15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:27:57 +0100 Subject: [PATCH 4/9] build(deps): bump newrelic/deployment-marker-action from 2.2.0 to 2.5.0 (#962) Bumps [newrelic/deployment-marker-action](https://github.com/newrelic/deployment-marker-action) from 2.2.0 to 2.5.0. - [Release notes](https://github.com/newrelic/deployment-marker-action/releases) - [Changelog](https://github.com/newrelic/deployment-marker-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/newrelic/deployment-marker-action/compare/v2.2.0...v2.5.0) --- updated-dependencies: - dependency-name: newrelic/deployment-marker-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/newrelic-release-tracking.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/newrelic-release-tracking.yml b/.github/workflows/newrelic-release-tracking.yml index eb259f28..d1d27944 100644 --- a/.github/workflows/newrelic-release-tracking.yml +++ b/.github/workflows/newrelic-release-tracking.yml @@ -14,7 +14,7 @@ jobs: run: echo "COMMIT_REF=${{ github.ref_name }}" >> $GITHUB_ENV # This step creates a new Change Tracking Marker for the APM entity - name: New Relic Application Deployment Marker - uses: newrelic/deployment-marker-action@v2.2.0 + uses: newrelic/deployment-marker-action@v2.5.0 with: apiKey: ${{ secrets.NEW_RELIC_API_KEY }} region: 'EU' @@ -23,7 +23,7 @@ jobs: user: '${{ github.actor }}' # This step creates a new Change Tracking Marker for the Browser entity - name: New Relic Browser Deployment Marker - uses: newrelic/deployment-marker-action@v2.2.0 + uses: newrelic/deployment-marker-action@v2.5.0 with: apiKey: ${{ secrets.NEW_RELIC_API_KEY }} region: 'EU' From b634696cf1cfe03e57f3ce0ea90dd7d6d3a7d967 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 17:46:37 +0100 Subject: [PATCH 5/9] add delays to 2 tests --- .github/workflows/dependabot-pr-review.yml | 2 +- cypress/integration/register-partner-with-code.cy.tsx | 1 + cypress/integration/reset-password.cy.tsx | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-pr-review.yml b/.github/workflows/dependabot-pr-review.yml index 60ad48fc..6c564e3f 100644 --- a/.github/workflows/dependabot-pr-review.yml +++ b/.github/workflows/dependabot-pr-review.yml @@ -19,4 +19,4 @@ jobs: uses: actions/dependency-review-action@v4 with: # fails when moderate vulnerabilities are deteched - fail-on-severity: severe + fail-on-severity: high diff --git a/cypress/integration/register-partner-with-code.cy.tsx b/cypress/integration/register-partner-with-code.cy.tsx index 0dd817fb..0e152d6a 100644 --- a/cypress/integration/register-partner-with-code.cy.tsx +++ b/cypress/integration/register-partner-with-code.cy.tsx @@ -26,6 +26,7 @@ describe('Register with access code', () => { it('Access code input should be on form', () => { // Start from the home page cy.visit(welcomeCodeLink); + cy.wait(2000); // The new page should contain an h2 with "Reset your password" cy.get('p').contains( 'Enter the access code you received from Badoo to begin your Bloom journey.', diff --git a/cypress/integration/reset-password.cy.tsx b/cypress/integration/reset-password.cy.tsx index a58eb84a..fc2986b9 100644 --- a/cypress/integration/reset-password.cy.tsx +++ b/cypress/integration/reset-password.cy.tsx @@ -27,6 +27,7 @@ describe('Reset password', () => { cy.visit(Cypress.env('reset_password_path')); cy.get('[qa-id=passwordResetEmailInput]').type(`${Cypress.env('reset_pwd_confirm_email')}`); cy.get('[qa-id=passwordResetEmailButton]').click(); + cy.wait(2000); cy.get('p').should('contain', 'Check your emails for a reset link from Bloom.'); cy.get('button[type="submit"]').contains('Resend email'); From 9fa51608f820210220375780151e2b45785077e2 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 18:04:46 +0100 Subject: [PATCH 6/9] fix --- cypress/integration/create-user-existing.cy.tsx | 3 --- cypress/integration/create-user-incorrect-email.cy.tsx | 3 --- cypress/integration/create-user-weak-password.cy.tsx | 3 --- cypress/integration/create-user.cy.tsx | 3 --- cypress/integration/reset-password.cy.tsx | 2 +- 5 files changed, 1 insertion(+), 13 deletions(-) diff --git a/cypress/integration/create-user-existing.cy.tsx b/cypress/integration/create-user-existing.cy.tsx index c8fb18e1..a4d4ecd4 100644 --- a/cypress/integration/create-user-existing.cy.tsx +++ b/cypress/integration/create-user-existing.cy.tsx @@ -7,9 +7,6 @@ describe('Create User', () => { it('Should not be able to create user with existing email', () => { // Start from the home page cy.visit('/'); - // TODO put the correct home page check below when it is published - // cy.get('h2',).contains('Get started').should('exist'); - // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]').first().click({ force: true }); cy.get('h2').should('contain', 'Create account'); cy.get('#name').type('Cypress test'); diff --git a/cypress/integration/create-user-incorrect-email.cy.tsx b/cypress/integration/create-user-incorrect-email.cy.tsx index f80fa060..b7a0cf6d 100644 --- a/cypress/integration/create-user-incorrect-email.cy.tsx +++ b/cypress/integration/create-user-incorrect-email.cy.tsx @@ -7,9 +7,6 @@ describe('Create User', () => { it('Should not be able to create user with incorrect email', () => { // Start from the home page cy.visit('/'); - // TODO put the correct home page check below when it is published - // cy.get('h2',).contains('Get started').should('exist'); - // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]').first().click({ force: true }); cy.get('h2').should('contain', 'Create account'); cy.get('#name').type('Cypress test'); diff --git a/cypress/integration/create-user-weak-password.cy.tsx b/cypress/integration/create-user-weak-password.cy.tsx index b8a79b19..aae7b5fe 100644 --- a/cypress/integration/create-user-weak-password.cy.tsx +++ b/cypress/integration/create-user-weak-password.cy.tsx @@ -7,9 +7,6 @@ describe('Create User', () => { it('Should not be able to create user with a weak password', () => { // Start from the home page cy.visit('/'); - // TODO put the correct home page check below when it is published - // cy.get('h2',).contains('Get started').should('exist'); - // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]').first().click({ force: true }); cy.get('h2').should('contain', 'Create account'); cy.get('#name').type('Cypress test'); diff --git a/cypress/integration/create-user.cy.tsx b/cypress/integration/create-user.cy.tsx index f7d90ca7..e117e10b 100644 --- a/cypress/integration/create-user.cy.tsx +++ b/cypress/integration/create-user.cy.tsx @@ -9,9 +9,6 @@ describe('Create User', () => { it('User should be able to create user', () => { // Start from the home page cy.visit('/'); - // TODO put the correct home page check below when it is published - // cy.get('h2',).contains('Get started').should('exist'); - // TODO - workout why #primary-get-started-button works locallly and headless but not in github actions cy.get('a[href="/auth/register"]').first().click({ force: true }); cy.get('h2').should('contain', 'Create account'); cy.get('#name').type('Cypress test'); diff --git a/cypress/integration/reset-password.cy.tsx b/cypress/integration/reset-password.cy.tsx index fc2986b9..530df079 100644 --- a/cypress/integration/reset-password.cy.tsx +++ b/cypress/integration/reset-password.cy.tsx @@ -27,7 +27,7 @@ describe('Reset password', () => { cy.visit(Cypress.env('reset_password_path')); cy.get('[qa-id=passwordResetEmailInput]').type(`${Cypress.env('reset_pwd_confirm_email')}`); cy.get('[qa-id=passwordResetEmailButton]').click(); - cy.wait(2000); + cy.wait(3000); cy.get('p').should('contain', 'Check your emails for a reset link from Bloom.'); cy.get('button[type="submit"]').contains('Resend email'); From c99b896af65876ae24745341cf09887d863a6f45 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 18:11:37 +0100 Subject: [PATCH 7/9] add delay to user account setting --- cypress/integration/user-account-settings.cy.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/integration/user-account-settings.cy.tsx b/cypress/integration/user-account-settings.cy.tsx index ea5e0afe..23e334db 100644 --- a/cypress/integration/user-account-settings.cy.tsx +++ b/cypress/integration/user-account-settings.cy.tsx @@ -31,6 +31,7 @@ describe('User account settings page', () => { cy.get('input[name="email-reminders-settings"]').eq(3).should('be.checked'); cy.get('input[name="email-reminders-settings"]').eq(1).check(); cy.get('button[type="submit"]').contains('Save email reminders').click(); + cy.wait(2000); cy.get('input[name="email-reminders-settings"]').eq(1).should('be.checked'); cy.get('input[name="email-reminders-settings"]').eq(3).check(); cy.get('button[type="submit"]').contains('Save email reminders').click(); From 195b488d03fbe27e91f88bf8873f2eb31a2cc356 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 18:20:01 +0100 Subject: [PATCH 8/9] wait after update user setting --- cypress/integration/user-account-settings.cy.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/integration/user-account-settings.cy.tsx b/cypress/integration/user-account-settings.cy.tsx index 23e334db..aee5b04d 100644 --- a/cypress/integration/user-account-settings.cy.tsx +++ b/cypress/integration/user-account-settings.cy.tsx @@ -24,6 +24,7 @@ describe('User account settings page', () => { cy.get('input[name="contactPermission"]').check(); cy.get('input[name="serviceEmailsPermission"]').check(); cy.get('button[type="submit"]').contains('Save email preferences').click(); + cy.wait(2000); }); it('Should have email reminder frequency form and load user data', () => { From 1e8f5a7c493b2762590ece83cd60e12b0a30ef39 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 8 Jul 2024 18:47:33 +0100 Subject: [PATCH 9/9] fix email reminder --- cypress/integration/user-account-settings.cy.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/cypress/integration/user-account-settings.cy.tsx b/cypress/integration/user-account-settings.cy.tsx index aee5b04d..03420312 100644 --- a/cypress/integration/user-account-settings.cy.tsx +++ b/cypress/integration/user-account-settings.cy.tsx @@ -24,15 +24,12 @@ describe('User account settings page', () => { cy.get('input[name="contactPermission"]').check(); cy.get('input[name="serviceEmailsPermission"]').check(); cy.get('button[type="submit"]').contains('Save email preferences').click(); - cy.wait(2000); }); it('Should have email reminder frequency form and load user data', () => { cy.visit('/account/settings'); - cy.get('input[name="email-reminders-settings"]').eq(3).should('be.checked'); cy.get('input[name="email-reminders-settings"]').eq(1).check(); cy.get('button[type="submit"]').contains('Save email reminders').click(); - cy.wait(2000); cy.get('input[name="email-reminders-settings"]').eq(1).should('be.checked'); cy.get('input[name="email-reminders-settings"]').eq(3).check(); cy.get('button[type="submit"]').contains('Save email reminders').click();