-
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.
* Add checkPageUrl command * Add welcome tests * Copy over commands added for meet-the-team tests * Add welcome badoo tests * Remove first as it is breaking the test * Fix test after moving env vars to .env.local * Fix public user env var * Removed after feedback as it is duplicated
- Loading branch information
Showing
4 changed files
with
138 additions
and
0 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 @@ | ||
const welcomeBadooPageUrl = '/welcome/badoo'; | ||
|
||
describe('Welcome badoo page should display', () => { | ||
before(() => { | ||
cy.cleanUpTestState(); | ||
}); | ||
beforeEach(() => { | ||
cy.visit(welcomeBadooPageUrl); | ||
}); | ||
it('bloom in partnership with badoo logo', () => { | ||
cy.checkImage('Bloom in partnership with Badoo logo', 'bloom_badoo_logo'); | ||
}); | ||
it('woman head purple illustration', () => { | ||
cy.checkImage( | ||
"Illustration of a person's face and shoulders, with big leaves and flowers blooming above them", | ||
'illustration_bloom_head_purple', | ||
); | ||
}); | ||
it('partnership explanation text', () => { | ||
cy.get('p').should( | ||
'contain', | ||
'Together, Badoo and Bloom are providing resources to sexual assault and relationship abuse survivors within the global Badoo community, through a free, online trauma support program.', | ||
); | ||
}); | ||
it('about the program content', () => { | ||
const partnershipBadooUrl = '/partnership/badoo'; | ||
cy.checkImage('person with legs crossed holding heart', 'badoo_welcome_1'); | ||
cy.get('h2').should('contain', 'About the program'); | ||
cy.get('p').should( | ||
'contain', | ||
'Everyone’s healing journey is different. When we experience trauma due to sexual assault and relationship abuse, we may need support. Badoo partnered with Bloom to create a free, curated, online trauma support program for survivors. This program has been developed based on feedback from the global Badoo and Bloom communities.', | ||
); | ||
cy.checkLink(partnershipBadooUrl, 'About the partnership'); | ||
}); | ||
|
||
it('about Bloom content', () => { | ||
cy.checkImage('leaves with a rose bloom', 'leaf_mix_bloom'); | ||
cy.get('h2').should('contain', 'About Bloom'); | ||
cy.get('p').should( | ||
'contain', | ||
'Bloom informs and empowers survivors by offering remote courses that combine the insights of survivors globally on trauma and gender-based violence with therapeutic practices to heal from trauma. Bloom is a programme by Chayn.', | ||
); | ||
}); | ||
|
||
it('about Badoo content', () => { | ||
cy.checkImage('two leaves and a heart', 'illustration_leaf_mix_badoo'); | ||
cy.get('h2').should('contain', 'About Badoo'); | ||
cy.get('p').should( | ||
'contain', | ||
'Badoo is the app that keeps dating straightforward and exciting. Unlike other dating apps, which are high on pressure and superficiality, Badoo lets its community chat instantly and discover real people near them. Meanwhile, Badoo’s many safety features help daters stay in control.', | ||
); | ||
}); | ||
|
||
it('about you content', () => { | ||
cy.checkImage('leaves with fire', 'leaf_mix_fire'); | ||
cy.get('h2').should('contain', 'About you'); | ||
cy.get('p').should( | ||
'contain', | ||
'The programme is available to any Badoo user who reports sexual abuse or assault to Badoo, regardless of your background, race, age, disability, religion or belief, sexuality, gender identity or expression, or life circumstances – we are here for you.', | ||
); | ||
}); | ||
|
||
describe('for a non-logged in user', () => { | ||
const inputAccessCodeTag = 'input[id="accessCode"]'; | ||
const labelAccessCodeTag = 'label[id="accessCode-label"]'; | ||
it('get started panel', () => { | ||
cy.get('h2').should('contain', 'Get started'); | ||
cy.get('p').should( | ||
'contain', | ||
'Enter the access code you received from Badoo to begin your Bloom journey.', | ||
); | ||
cy.get(labelAccessCodeTag).should('exist').should('have.attr', 'for', 'accessCode'); | ||
cy.get(inputAccessCodeTag).should('exist'); | ||
}); | ||
}); | ||
describe('for a public logged in user', () => { | ||
before(() => { | ||
cy.cleanUpTestState(); | ||
cy.logInWithEmailAndPassword( | ||
Cypress.env('CYPRESS_PUBLIC_EMAIL'), | ||
Cypress.env('CYPRESS_PUBLIC_PASSWORD'), | ||
); | ||
}); | ||
it('continue to bloom panel', () => { | ||
const coursesUrl = '/courses'; | ||
cy.get('h2').should('contain', 'Continue to Bloom'); | ||
cy.get('p').should('contain', 'Pick up where you left off.'); | ||
cy.checkLink(coursesUrl, 'Go to courses'); | ||
}); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const welcomePageUrl = '/welcome'; | ||
const invalidPartnerPageUrl = `${welcomePageUrl}/invalid-partner`; | ||
const coursesPageUrl = '/courses'; | ||
|
||
describe('Welcome page should', () => { | ||
before(() => { | ||
cy.cleanUpTestState(); | ||
}); | ||
|
||
describe('Redirect to courses page', () => { | ||
it('for a non-logged in user visiting page without partner', () => { | ||
cy.visit(welcomePageUrl); | ||
cy.checkPageUrl(coursesPageUrl); | ||
}); | ||
describe('for a public logged in user', () => { | ||
before(() => { | ||
cy.cleanUpTestState(); | ||
cy.logInWithEmailAndPassword( | ||
Cypress.env('CYPRESS_PUBLIC_EMAIL'), | ||
Cypress.env('CYPRESS_PUBLIC_PASSWORD'), | ||
); | ||
}); | ||
it('visiting page without partner', () => { | ||
cy.visit(welcomePageUrl); | ||
cy.checkPageUrl(coursesPageUrl); | ||
}); | ||
after(() => { | ||
cy.logout(); | ||
}); | ||
}); | ||
}); | ||
|
||
it('Display not found page for an invalid partner', () => { | ||
cy.visit(invalidPartnerPageUrl, { failOnStatusCode: false }); | ||
cy.get('p').contains('This page could not be found'); | ||
}); | ||
}); |
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