From 33eb6070f422a4e5c8745c7ecb42a8e3a820b784 Mon Sep 17 00:00:00 2001 From: Suzanne Aitchison Date: Fri, 22 Apr 2022 15:44:25 +0100 Subject: [PATCH] Reference checkboxes by name (#17403) --- .../creatorSettings.spec.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js b/cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js index d3f11ae73..ab67a053d 100644 --- a/cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js +++ b/cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js @@ -70,16 +70,14 @@ describe('Creator Settings Page', () => { // should contain a 'I agree to uphold our Code of Conduct' checkbox field and allow selection upon click cy.findByRole('group', { name: /^finally, please agree to the following:/i, - }).should('be.visible'); - cy.findAllByRole('checkbox').first().check(); - cy.findAllByRole('checkbox').should('be.checked'); - - // should contain a 'I agree to our Terms and Conditions' checkbox field and allow selection upon click - cy.findByRole('group', { - name: /^finally, please agree to the following:/i, - }).should('be.visible'); - cy.findAllByRole('checkbox').eq(1).check(); - cy.findAllByRole('checkbox').should('be.checked'); + }).within(() => { + cy.findByRole('checkbox', { + name: 'I agree to uphold our Code of Conduct.', + }).check(); + cy.findByRole('checkbox', { + name: 'I agree to our Terms and Conditions.', + }).check(); + }); // should redirect the creator to the home page when the form is completely filled out and 'Finish' is clicked cy.findByRole('button', { name: 'Finish' }).click();