From a64d75f7767550931a42ee8a713c16899c7250ed Mon Sep 17 00:00:00 2001 From: John Duffell Date: Tue, 2 Jul 2024 22:44:30 +0100 Subject: [PATCH 1/2] remove doNotSetUsername for test users as we no longer set them by default --- cypress/lib/signInOkta.ts | 1 - cypress/support/commands.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/cypress/lib/signInOkta.ts b/cypress/lib/signInOkta.ts index c45227857..163dd9579 100644 --- a/cypress/lib/signInOkta.ts +++ b/cypress/lib/signInOkta.ts @@ -16,7 +16,6 @@ export const signInOkta = () => { cy.visit('/'); cy.createTestUser({ isUserEmailValidated: true, - doNotSetUsername: true, })?.then(({ emailAddress, finalPassword }) => { cy.get('input[name=email]').type(emailAddress); cy.get('input[name=password]').type(finalPassword); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index a613adc21..45ed4da17 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -97,7 +97,6 @@ type IDAPITestUserOptions = { password?: string; deleteAfterMinute?: boolean; isGuestUser?: boolean; - doNotSetUsername?: boolean; }; type IDAPITestUserResponse = [ { @@ -129,7 +128,6 @@ export const createTestUser = ({ isUserEmailValidated = false, deleteAfterMinute = true, isGuestUser = false, - doNotSetUsername = false, }: IDAPITestUserOptions) => { // Generate a random email address if none is provided. const finalEmail = primaryEmailAddress || randomMailosaurEmail(); @@ -152,7 +150,6 @@ export const createTestUser = ({ password: finalPassword, deleteAfterMinute, isGuestUser, - doNotSetUsername, } as IDAPITestUserOptions, }) .then((res) => { From e9ead9b68cb1f59dbe087c9e993fcca20f8d7fd0 Mon Sep 17 00:00:00 2001 From: John Duffell Date: Wed, 3 Jul 2024 21:28:39 +0100 Subject: [PATCH 2/2] return generated test user email address rather than template one --- cypress/support/commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 45ed4da17..56d1c063f 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -154,7 +154,7 @@ export const createTestUser = ({ }) .then((res) => { return cy.wrap({ - emailAddress: finalEmail, + emailAddress: res.body.emailAddress as string, cookies: res.body.values as IDAPITestUserResponse, finalPassword, });