-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move welcome e2e tests to tests folder * Tidy up existing test * Add header section test * Add account actions section test * Simplify image src value * Add Apply code tests * Remove non used var * Add about-you page tests * Add disable service emails tests * fix: stop pre-commit add all command * upgrade: cypress * fix: hydration issue in meet the team page * move: cypress tests into correct folder * fix: racey cypress tests * fix: timeouts in cypress tests and removing async * fix: async issues in reset password cypress test * feat: fix checkPageUrl * Fix: racey user account page tests * fix: don't clean up users after test run only before * fix: urls now that the NEXT_PUBLIC_API_URL no longer has a trailing slash * fix: return user in cy.logInWithEMailAndPassword * fix: signInWithEmailAndPassword cypress command * fix: before.cy.tsx to chain events properly * fix: checkPageUrl * fix: checkUrl should check pathname not full url * fix: remove after.tsx * fix: meet-the-team cypress test * Home e2e test (#1098) * Move meet-the-team page to new cypress test location * Add join us section test * Add our free services section test * Add why bloom section test * Add our bloom team section test * Add our themes section test * Add testimonial section test * Add create access code badoo tests (#1102) * Admin e2e test (#1101) * Add ids to form fields * Add admin dashboard tests * build(deps): bump react-cookie-consent from 8.0.1 to 9.0.0 Bumps [react-cookie-consent](https://github.com/Mastermindzh/react-cookie-consent) from 8.0.1 to 9.0.0. - [Release notes](https://github.com/Mastermindzh/react-cookie-consent/releases) - [Changelog](https://github.com/Mastermindzh/react-cookie-consent/blob/master/CHANGELOG.md) - [Commits](Mastermindzh/react-cookie-consent@8.0.1...9.0.0) --- updated-dependencies: - dependency-name: react-cookie-consent dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Fix removed only after merge --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Ellie Re'em <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3275c75
commit ab50621
Showing
4 changed files
with
189 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
describe('User about you page should display', () => { | ||
const publicEmail = Cypress.env('CYPRESS_PUBLIC_EMAIL') as string; | ||
|
||
before(() => { | ||
cy.cleanUpTestState(); | ||
cy.logInWithEmailAndPassword(publicEmail, Cypress.env('CYPRESS_PUBLIC_PASSWORD')); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit('/account/about-you'); | ||
}); | ||
|
||
it('header section', () => { | ||
cy.checkImage('Welcome to Bloom', 'welcome_to_bloom'); | ||
cy.checkImage( | ||
`Illustration of a person's face and shoulders, with big leaves and flowers blooming above them`, | ||
'illustration_bloom_head_yellow', | ||
); | ||
}); | ||
|
||
it('Help us understand section', () => { | ||
cy.get('h2').should('contain', 'Help us understand'); | ||
cy.get('p').should( | ||
'contain', | ||
'These questions help us understand who is using Bloom and what kinds of support they need from us.', | ||
); | ||
cy.checkLink('/courses', 'Skip to courses'); | ||
}); | ||
|
||
it('About you panel', () => { | ||
cy.get('h2').should('contain', 'About you'); | ||
|
||
cy.get('label.Mui-required').contains( | ||
'Please select one or more options that reflect your gender identity', | ||
); | ||
cy.get('input[id="gender"]') | ||
.should('exist') | ||
.should('have.prop', 'role', 'combobox') | ||
.should('have.prop', 'required', true); | ||
cy.get('p').should( | ||
'contain', | ||
`We are asking this to better understand how our users identify, with a view to designing even more inclusive and gender-affirming resources. You can select 'Prefer not to answer'.`, | ||
); | ||
|
||
cy.get('legend.Mui-required').contains('Would you describe yourself as neurodivergent?'); | ||
const neurodivergentOptions = ['Yes', 'No', 'Not sure']; | ||
cy.get('input[name="neurodivergent-radio-buttons-group"]').each(($option, index) => { | ||
cy.wrap($option) | ||
.should('have.value', neurodivergentOptions[index]) | ||
.should('have.prop', 'type', 'radio') | ||
.parents('label') | ||
.contains(neurodivergentOptions[index]); | ||
}); | ||
cy.get('p').should( | ||
'contain', | ||
`We design our services to be inclusive, so it’s helpful for us to hear feedback from people who are neurodivergent`, | ||
); | ||
|
||
cy.get('label').contains( | ||
'How would you describe your race, ethnicity and nationality? E.g., White Hispanic Mexican, or Tamil Indian.', | ||
); | ||
cy.get('input[id="raceEthnNatn"]').should('exist').should('have.prop', 'type', 'text'); | ||
cy.get('p').should( | ||
'contain', | ||
`We know that people's experiences of race and ethnicity vary widely based on where they live, so write what you feel best describes you personally.`, | ||
); | ||
|
||
cy.get('label.Mui-required').contains('What country do you live in right now?'); | ||
cy.get('input[id="country"]') | ||
.should('exist') | ||
.should('have.prop', 'role', 'combobox') | ||
.should('have.prop', 'required', true); | ||
cy.get('p').should( | ||
'contain', | ||
`This will help us understand where survivors are accessing our services from.`, | ||
); | ||
|
||
cy.get('legend').contains('What is your age group?'); | ||
const ageOptions = ['Under 18', '18-25', '25-35', '35-45', '45-55', '55+', 'Prefer not to say']; | ||
cy.get('input[name="age-radio-buttons-group"]').each(($option, index) => { | ||
cy.wrap($option) | ||
.should('have.value', ageOptions[index]) | ||
.should('have.prop', 'type', 'radio') | ||
.parents('label') | ||
.contains(ageOptions[index]); | ||
}); | ||
|
||
cy.get('button').contains('Submit').should('have.prop', 'type', 'submit'); | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
describe('User apply a code page should display', () => { | ||
const publicEmail = Cypress.env('CYPRESS_PUBLIC_EMAIL') as string; | ||
|
||
before(() => { | ||
cy.cleanUpTestState(); | ||
cy.logInWithEmailAndPassword(publicEmail, Cypress.env('CYPRESS_PUBLIC_PASSWORD')); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit('/account/apply-a-code'); | ||
}); | ||
|
||
it('header section', () => { | ||
cy.get('h1').should('contain', 'Apply a code'); | ||
cy.get('p').should( | ||
'contain', | ||
'Bloom works with partners to support healing for survivors of abuse around the world.', | ||
); | ||
cy.checkImage('Illustration of a person sitting, holding a tea', 'illustration_person4_peach'); | ||
}); | ||
|
||
it('description', () => { | ||
cy.get('p').should( | ||
'contain', | ||
`If you've received an access code from one of our partners, you can add it here to receive support specific to their programme.`, | ||
); | ||
cy.get('p').should('contain', 'You can add codes from more than one partner.'); | ||
}); | ||
|
||
it('our partners panel', () => { | ||
cy.get('h3').should('contain', 'Our partners'); | ||
cy.get('p').should('contain', 'Read more about our partnerships by clicking on their logo.'); | ||
cy.checkImage('Bumble logo', 'bumble_logo'); | ||
cy.checkImage('Badoo logo', 'badoo_logo'); | ||
cy.checkImage('Fruitz logo', 'fruitz_logo'); | ||
}); | ||
|
||
it('apply a code panel', () => { | ||
cy.get('h2').should('contain', 'Apply a code'); | ||
cy.get('p').should('contain', 'Enter the access code you received from a Bloom partner.'); | ||
cy.get('label.Mui-required').contains('Access code'); | ||
cy.get('input[id="accessCode"]').should('exist'); | ||
cy.get('button').contains('Apply code'); | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
cypress/integration/tests/user-disable-service-emails.cy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
describe('User disable service emails page should display', () => { | ||
const publicEmail = Cypress.env('CYPRESS_PUBLIC_EMAIL') as string; | ||
|
||
before(() => { | ||
cy.cleanUpTestState(); | ||
cy.logInWithEmailAndPassword(publicEmail, Cypress.env('CYPRESS_PUBLIC_PASSWORD')); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit('/account/disable-service-emails'); | ||
}); | ||
|
||
it('header section', () => { | ||
cy.get('h1').contains('Bloom emails turned off'); | ||
cy.checkImage('Account.disableServiceEmails.imageAlt', 'illustration_leaf_mix_bee'); | ||
cy.get('p').should( | ||
'contain', | ||
`You will no longer receive emails related to Bloom. If you'd like to change this later, please get in touch with the`, | ||
); | ||
cy.checkLink('/account/disable-service-emails#', 'Bloom team'); | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
}); | ||
}); |