From 9b6dee96ee233f3aa0dc3fe46a30d4e45be4e281 Mon Sep 17 00:00:00 2001 From: SeongHo Park Date: Thu, 1 Aug 2024 10:03:08 +0700 Subject: [PATCH 1/6] add invite checkbox manipulation --- frontend/tests/components/addMemberModal.ts | 5 +++++ frontend/tests/emailWorkflow.test.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/frontend/tests/components/addMemberModal.ts b/frontend/tests/components/addMemberModal.ts index 5abd50704..188d8d12d 100644 --- a/frontend/tests/components/addMemberModal.ts +++ b/frontend/tests/components/addMemberModal.ts @@ -3,6 +3,7 @@ import { BaseComponent } from './baseComponent'; const EMAIL_LABEL = 'Email'; const ROLE_LABEL = 'Role'; +const CHECKBOX_LABEL = 'Invite'; const SUBMIT_BUTTON_LABEL = new RegExp(`(Add Member)|(Add or invite Member)`); export class AddMemberModal extends BaseComponent { @@ -14,6 +15,10 @@ export class AddMemberModal extends BaseComponent { return this.componentLocator.getByLabel(ROLE_LABEL, {exact: true}); } + get checkBox(): Locator { + return this.componentLocator.getByRole('checkbox', {name: CHECKBOX_LABEL}); + } + get submitButton(): Locator { return this.componentLocator.getByRole('button', {name: SUBMIT_BUTTON_LABEL}); } diff --git a/frontend/tests/emailWorkflow.test.ts b/frontend/tests/emailWorkflow.test.ts index 1661db416..bad6a31dd 100644 --- a/frontend/tests/emailWorkflow.test.ts +++ b/frontend/tests/emailWorkflow.test.ts @@ -126,6 +126,7 @@ test('register via new-user invitation email', async ({ page }) => { const addMemberModal = await projectPage.clickAddMember(); await addMemberModal.emailField.fill(newEmail); await addMemberModal.selectEditorRole(); + await addMemberModal.checkBox.check(); await addMemberModal.submitButton.click(); await page.locator(':text("has been sent an invitation email")').waitFor(); From 20b582157ad539847cb37b0ced1745c6ac3e1f4a Mon Sep 17 00:00:00 2001 From: SeongHo Park Date: Thu, 1 Aug 2024 10:20:57 +0700 Subject: [PATCH 2/6] update readme --- frontend/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/README.md b/frontend/README.md index 2e1184ecd..e8650add4 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -32,3 +32,11 @@ pnpm run build You can preview the production build with `pnpm run preview`. > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. + +#### Testing + +To run a end-to-end test in the frontend folder: + +```bash +pnpm test +``` From 7c5736b9706588a77adc0469e4582323fc789056 Mon Sep 17 00:00:00 2001 From: SeongHo Park Date: Fri, 2 Aug 2024 09:08:20 +0700 Subject: [PATCH 3/6] fix typo --- frontend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/README.md b/frontend/README.md index e8650add4..134984373 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -35,7 +35,7 @@ You can preview the production build with `pnpm run preview`. #### Testing -To run a end-to-end test in the frontend folder: +To run an end-to-end test in the frontend folder: ```bash pnpm test From 3904109a280fefceadc8ad1430a9bbb3733abcb5 Mon Sep 17 00:00:00 2001 From: SeongHo Park Date: Fri, 2 Aug 2024 10:02:03 +0700 Subject: [PATCH 4/6] naming standardization --- frontend/tests/components/addMemberModal.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/tests/components/addMemberModal.ts b/frontend/tests/components/addMemberModal.ts index 188d8d12d..a566ca9ac 100644 --- a/frontend/tests/components/addMemberModal.ts +++ b/frontend/tests/components/addMemberModal.ts @@ -3,7 +3,7 @@ import { BaseComponent } from './baseComponent'; const EMAIL_LABEL = 'Email'; const ROLE_LABEL = 'Role'; -const CHECKBOX_LABEL = 'Invite'; +const INVITE_LABEL = 'Invite'; const SUBMIT_BUTTON_LABEL = new RegExp(`(Add Member)|(Add or invite Member)`); export class AddMemberModal extends BaseComponent { @@ -15,8 +15,8 @@ export class AddMemberModal extends BaseComponent { return this.componentLocator.getByLabel(ROLE_LABEL, {exact: true}); } - get checkBox(): Locator { - return this.componentLocator.getByRole('checkbox', {name: CHECKBOX_LABEL}); + get inviteCheckbox(): Locator { + return this.componentLocator.getByRole('checkbox', {name: INVITE_LABEL}); } get submitButton(): Locator { From 9790ccf0ebef32a432d42c92ba7a215476918e91 Mon Sep 17 00:00:00 2001 From: SeongHo Park Date: Fri, 2 Aug 2024 10:08:20 +0700 Subject: [PATCH 5/6] small fix --- frontend/tests/emailWorkflow.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/tests/emailWorkflow.test.ts b/frontend/tests/emailWorkflow.test.ts index bad6a31dd..9cb4c2569 100644 --- a/frontend/tests/emailWorkflow.test.ts +++ b/frontend/tests/emailWorkflow.test.ts @@ -126,7 +126,7 @@ test('register via new-user invitation email', async ({ page }) => { const addMemberModal = await projectPage.clickAddMember(); await addMemberModal.emailField.fill(newEmail); await addMemberModal.selectEditorRole(); - await addMemberModal.checkBox.check(); + await addMemberModal.inviteCheckbox.check(); await addMemberModal.submitButton.click(); await page.locator(':text("has been sent an invitation email")').waitFor(); From f13fce45b61a5b7c8e1c70323d9d9e2478597555 Mon Sep 17 00:00:00 2001 From: SeongHo Park Date: Fri, 2 Aug 2024 11:12:44 +0700 Subject: [PATCH 6/6] remove parantheses for optimization --- frontend/tests/components/addMemberModal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/tests/components/addMemberModal.ts b/frontend/tests/components/addMemberModal.ts index a566ca9ac..2c21026e0 100644 --- a/frontend/tests/components/addMemberModal.ts +++ b/frontend/tests/components/addMemberModal.ts @@ -4,7 +4,7 @@ import { BaseComponent } from './baseComponent'; const EMAIL_LABEL = 'Email'; const ROLE_LABEL = 'Role'; const INVITE_LABEL = 'Invite'; -const SUBMIT_BUTTON_LABEL = new RegExp(`(Add Member)|(Add or invite Member)`); +const SUBMIT_BUTTON_LABEL = new RegExp(`Add Member|Add or invite Member`); export class AddMemberModal extends BaseComponent { get emailField(): Locator {