From 9e11c3667e027f805fca37b5dffe9d8a52303a14 Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Mon, 26 Feb 2024 12:10:32 +0000 Subject: testing: E2E tests for public and restricted events --- cypress/support/commands.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'cypress/support') 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 { - createGroup(groupData: { - eventGroupName: string; - eventGroupDescription: string; - eventGroupURL: string; - hostName: string; - creatorEmail: string; - }): Chainable; + createGroup( + groupData: { + eventGroupName: string; + eventGroupDescription: string; + eventGroupURL: string; + hostName: string; + creatorEmail: string; + }, + isPublic: boolean, + ): Chainable; } } -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(); -- cgit v1.2.3