From 92bec76738c5a61dd4b7638ddb1285b6be745b0d Mon Sep 17 00:00:00 2001 From: Alberto Arias Date: Wed, 28 Aug 2024 13:55:27 +0200 Subject: [PATCH] Add create access code badoo tests (#1102) --- .../tests/create-access-code.badoo.cy.tsx | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cypress/integration/tests/create-access-code.badoo.cy.tsx diff --git a/cypress/integration/tests/create-access-code.badoo.cy.tsx b/cypress/integration/tests/create-access-code.badoo.cy.tsx new file mode 100644 index 00000000..00a2608d --- /dev/null +++ b/cypress/integration/tests/create-access-code.badoo.cy.tsx @@ -0,0 +1,40 @@ +describe('Create access code page should display', () => { + const badooEmail = Cypress.env('CYPRESS_BADOO_PARTNER_ADMIN_EMAIL') as string; + const badooPassword = Cypress.env('CYPRESS_BADOO_PARTNER_ADMIN_PASSWORD'); + + before(() => { + cy.cleanUpTestState(); + cy.logInWithEmailAndPassword(badooEmail, badooPassword); + }); + + beforeEach(() => { + cy.visit('/partner-admin/create-access-code'); + }); + + it('header section', () => { + cy.get('h2').should('contain', 'Create access codes'); + cy.checkImage('Badoo logo', 'badoo_logo'); + }); + + it('Create access codes panel', () => { + cy.get('h2').should('contain', 'Create access codes'); + cy.get('p').should( + 'contain', + 'Use this form to create an access code every time you want to give someone access to Bloom.', + ); + + cy.get('legend').contains('Select support type offered to this user'); + cy.get('input') + .should('exist') + .should('have.prop', 'type', 'radio') + .should('have.value', 'therapy') + .parents('label') + .contains('Courses, 1:1 chat and six therapy sessions'); + + cy.get('button').contains('Create access codes').should('have.prop', 'type', 'submit'); + }); + + after(() => { + cy.logout(); + }); +});