From 4b557d1bd1e416e7c56b4164ccde6699e92b1a90 Mon Sep 17 00:00:00 2001 From: Luis E <35935591+luisecm@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:33:52 -0600 Subject: [PATCH] update(test): fixes for deactivate create group button (#190) --- playwright/PageObjects/ChatsElements/CreateGroupModal.ts | 5 ++++- playwright/specs/03-friends-two-instances.spec.ts | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/playwright/PageObjects/ChatsElements/CreateGroupModal.ts b/playwright/PageObjects/ChatsElements/CreateGroupModal.ts index c4fe89d..5b397e9 100644 --- a/playwright/PageObjects/ChatsElements/CreateGroupModal.ts +++ b/playwright/PageObjects/ChatsElements/CreateGroupModal.ts @@ -64,9 +64,12 @@ export class CreateGroupModal extends MainPage { async createGroupChat(name: string, users: string[]) { await this.createGroupModal.waitFor({ state: "attached" }); + await this.createGroupInputGroupName.clear(); await this.createGroupInputGroupName.fill(name); await this.selectUser(users); - await this.createGroupButton.click(); + if (users.length > 0 && name.length > 0) { + await this.createGroupButton.click(); + } } async exitCreateGroup(): Promise { diff --git a/playwright/specs/03-friends-two-instances.spec.ts b/playwright/specs/03-friends-two-instances.spec.ts index 983b247..14d2058 100644 --- a/playwright/specs/03-friends-two-instances.spec.ts +++ b/playwright/specs/03-friends-two-instances.spec.ts @@ -2186,11 +2186,8 @@ test.describe("Two instances tests - Friends and Chats", () => { }); await test.step("Validate that group without members cannot be created", async () => { - await createGroupThird.createGroupChat("", []); - await expect(createGroupThird.errorUsersCreateGroupModal).toBeVisible(); - await expect(createGroupThird.errorUsersCreateGroupModal).toHaveText( - "No members selected", - ); + await createGroupThird.createGroupChat("test", []); + await expect(createGroupThird.createGroupButton).toBeDisabled(); }); await test.step("Validate that group without name cannot be created", async () => {