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 () => {