diff options
| author | Raphael Kabo <raphaelkabo@hey.com> | 2024-02-26 12:10:32 +0000 | 
|---|---|---|
| committer | Raphael Kabo <raphaelkabo@hey.com> | 2024-02-26 12:10:32 +0000 | 
| commit | 9e11c3667e027f805fca37b5dffe9d8a52303a14 (patch) | |
| tree | 58a2369cde40717bb6b34273566f3e31ab8c9932 /cypress/support | |
| parent | c93fd6e2d455ea4208f9e5ca6bfbd1c0e9fd1ad9 (diff) | |
testing: E2E tests for public and restricted events
Diffstat (limited to 'cypress/support')
| -rw-r--r-- | cypress/support/commands.ts | 23 | 
1 files changed, 15 insertions, 8 deletions
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 7535103..eadcd20 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -38,17 +38,20 @@  declare namespace Cypress {      interface Chainable<Subject> { -        createGroup(groupData: { -            eventGroupName: string; -            eventGroupDescription: string; -            eventGroupURL: string; -            hostName: string; -            creatorEmail: string; -        }): Chainable<Subject>; +        createGroup( +            groupData: { +                eventGroupName: string; +                eventGroupDescription: string; +                eventGroupURL: string; +                hostName: string; +                creatorEmail: string; +            }, +            isPublic: boolean, +        ): Chainable<Subject>;      }  } -Cypress.Commands.add("createGroup", (groupData) => { +Cypress.Commands.add("createGroup", (groupData, isPublic) => {      cy.visit("/new");      cy.get("#showNewEventGroupFormButton").click(); @@ -59,6 +62,10 @@ Cypress.Commands.add("createGroup", (groupData) => {      cy.get("#eventGroupHostName").type(groupData.hostName);      cy.get("#eventGroupCreatorEmail").type(groupData.creatorEmail); +    if (isPublic) { +        cy.get("#publicGroupCheckbox").check(); +    } +      // Submit the form      cy.get("#newEventGroupForm").submit();  | 
