diff --git a/packages/e2e/cypress/integration/common/index.tsx b/packages/e2e/cypress/integration/common/index.tsx index 854b1e720ad..3a3b5c6a9f3 100644 --- a/packages/e2e/cypress/integration/common/index.tsx +++ b/packages/e2e/cypress/integration/common/index.tsx @@ -15,8 +15,8 @@ And('I type a valid password {string}', (password: string) => { cy.findByLabelText(/password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); +When('I click the {string} button', (name: string) => { + cy.findByRole('button', { name: new RegExp(name, 'i') }).click(); }); Then('I see {string}', (message: string) => { diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/reset-password.feature b/packages/e2e/cypress/integration/ui/components/authenticator/reset-password.feature index b841a309c80..1ac4a708960 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/reset-password.feature +++ b/packages/e2e/cypress/integration/ui/components/authenticator/reset-password.feature @@ -9,14 +9,14 @@ Feature: Reset Password @next @react Scenario: Reset Password with valid username - When I click on the "Reset password" button + When I click the "Reset password" button And I type a valid username "VALID_USERNAME" And I click the "Send code" button Then I will be redirected to the confirm forgot password page @next @react Scenario: Reset Password with invalid username - When I click on the "Reset password" button + When I click the "Reset password" button And I type an invalid username "INVALID_USERNAME" And I click the "Send code" button Then I see "Username/client id combination not found." diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/reset-password/reset-password.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/reset-password/reset-password.steps.ts index 0cb5aed886b..40b4145812a 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/reset-password/reset-password.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/reset-password/reset-password.steps.ts @@ -1,13 +1,9 @@ -import { And, Given, Then, When } from 'cypress-cucumber-preprocessor/steps'; +import { And, Given, Then } from 'cypress-cucumber-preprocessor/steps'; Given("I'm running the example {string}", (url: string) => { cy.visit(url); }); -When('I click on the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - And('I type a valid username {string}', (username: string) => { cy.findByRole('textbox', { name: /username/i }).type(Cypress.env(username)); }); @@ -16,10 +12,6 @@ And('I type an invalid username {string}', (username: string) => { cy.findByRole('textbox', { name: /username/i }).type(Cypress.env(username)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I will be redirected to the confirm forgot password page', () => { cy.findByRole('textbox', { label: 'New password' }).should('exist'); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-force-new-password/sign-in-force-new-password.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-force-new-password/sign-in-force-new-password.steps.ts index aab9feefc5c..3291ea1fc60 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-force-new-password/sign-in-force-new-password.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-force-new-password/sign-in-force-new-password.steps.ts @@ -13,10 +13,6 @@ And('I type in the password {string}', (password: string) => { cy.findByLabelText(/password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I should see the Force Change Password screen', () => { cy.findByRole('document').contains(new RegExp('Change Password', 'i')); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-sms-mfa/sign-in-sms-mfa.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-sms-mfa/sign-in-sms-mfa.steps.ts index 18603217f0d..60932ba7588 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-sms-mfa/sign-in-sms-mfa.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-sms-mfa/sign-in-sms-mfa.steps.ts @@ -21,10 +21,6 @@ And('I type a valid password {string}', (password: string) => { cy.get('[data-amplify-password]').type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I will be redirected to the confirm sms mfa page', () => { cy.get('[data-amplify-authenticator-confirmsignin]').should('be.visible'); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-totp-mfa/sign-in-totp-mfa.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-totp-mfa/sign-in-totp-mfa.steps.ts index 559f060c2d6..e2178979503 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-totp-mfa/sign-in-totp-mfa.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-totp-mfa/sign-in-totp-mfa.steps.ts @@ -20,10 +20,6 @@ And('I type a valid password {string}', (password: string) => { cy.get('[data-amplify-password]').type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I will be redirected to the confirm totp mfa page', () => { cy.get('body').contains('TOTP'); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-email/sign-in-with-email.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-email/sign-in-with-email.steps.ts index 8d8d9fdc188..7fd4121f5ed 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-email/sign-in-with-email.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-email/sign-in-with-email.steps.ts @@ -12,10 +12,6 @@ And('I type the valid password {string}', (password: string) => { cy.findByLabelText(/password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I see {string}', (message: string) => { cy.findByRole('document').contains(new RegExp(message, 'i')); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-phone/sign-in-with-phone.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-phone/sign-in-with-phone.steps.ts index c45f33ce677..0858dbbea62 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-phone/sign-in-with-phone.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-phone/sign-in-with-phone.steps.ts @@ -14,10 +14,6 @@ And('I type the valid password {string}', (password: string) => { cy.findByLabelText(/password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I see {string}', (message: string) => { cy.findByRole('document').contains(new RegExp(message, 'i')); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-username/sign-in-with-username.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-username/sign-in-with-username.steps.ts index 332adf9ce85..f9f8b9fd4a2 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-username/sign-in-with-username.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-in-with-username/sign-in-with-username.steps.ts @@ -12,10 +12,6 @@ And('I type the valid password {string}', (password: string) => { cy.findByLabelText(/password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I see {string}', (message: string) => { cy.findByRole('document').contains(new RegExp(message, 'i')); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email.feature b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email.feature index 6bd07abe955..33f434d784b 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email.feature +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email.feature @@ -13,7 +13,7 @@ Feature: Sign Up with Email And I don't see "Username" as an input field And I don't see "Phone Number" as an input field -@next @react @vue @angular +@next @react @vue @angular @skip Scenario: Sign up with valid email & password When I type the email "VALID_EMAIL" And I type the password "VALID_PASSWORD" diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email/sign-up-with-email.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email/sign-up-with-email.steps.ts index 2c65ede9629..9feac56268f 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email/sign-up-with-email.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-email/sign-up-with-email.steps.ts @@ -30,10 +30,6 @@ And('I confirm the password {string}', (password: string) => { cy.findByLabelText(/confirm password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I see {string}', (message: string) => { cy.findByRole('document').contains(message); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-phone/sign-up-with-phone.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-phone/sign-up-with-phone.steps.ts index a77b2b3da57..8650bfeb272 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-phone/sign-up-with-phone.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up-with-phone/sign-up-with-phone.steps.ts @@ -28,10 +28,6 @@ And('I confirm the password {string}', (password: string) => { cy.findByLabelText(/confirm password/i).type(Cypress.env(password)); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I see {string}', (message: string) => { cy.findByRole('document').contains(message); }); diff --git a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up/sign-up.steps.ts b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up/sign-up.steps.ts index ad0400cbd3f..2151f4c425d 100644 --- a/packages/e2e/cypress/integration/ui/components/authenticator/sign-up/sign-up.steps.ts +++ b/packages/e2e/cypress/integration/ui/components/authenticator/sign-up/sign-up.steps.ts @@ -4,11 +4,11 @@ const now = Date.now(); const randomNumber = window.crypto.getRandomValues(new Uint32Array(1))[0]; const password = `test-${randomNumber}`; -Given("I'm running the example {string}", url => { +Given("I'm running the example {string}", (url) => { cy.visit(url); }); -And('I click {string}', text => { +And('I click {string}', (text) => { cy.findByText(text).click(); }); @@ -24,18 +24,14 @@ And('I type a new confirm password', () => { cy.findByLabelText(/^confirm password$/i).type(`${password}`); }); -And('I type the email {string}', email => { +And('I type the email {string}', (email) => { cy.findByLabelText('Email').type(email); }); -And('I type the phone number {string}', phone => { +And('I type the phone number {string}', (phone) => { cy.findByLabelText('Phone Number').type(phone); }); -And('I click the {string} button', (name: string) => { - cy.findByRole('button', { name }).click(); -}); - Then('I see {string}', (message: string) => { cy.get('body').contains(message); });