diff --git a/bigbluebutton-tests/playwright/chat/chat.js b/bigbluebutton-tests/playwright/chat/chat.js index b378547eaa..16536daf17 100644 --- a/bigbluebutton-tests/playwright/chat/chat.js +++ b/bigbluebutton-tests/playwright/chat/chat.js @@ -343,7 +343,24 @@ class Chat extends MultiUsers { await this.userPage.waitAndClick(e.logout); await this.modPage.hasElementDisabled(e.chatBox); await this.modPage.hasElementDisabled(e.sendButton); - } + } + + async preventUserFromUsingPublicChat(context) { + await openPublicChat(this.modPage); + await openPublicChat(this.userPage); + await this.modPage.waitAndClick(e.userListItem); + await this.modPage.waitAndClick(e.togglePublicChat); + await this.initUserPage2(true, context) + await this.userPage.hasElementDisabled(e.chatBox); + await this.userPage.hasElementDisabled(e.sendButton); + await this.userPage2.hasElement(e.chatBox); + await this.userPage2.hasElement(e.sendButton); + await this.userPage2.type(e.chatBox, 'test'); + await this.userPage2.waitAndClick(e.sendButton); + await this.modPage.hasText(e.chatUserMessageText, 'test'); + await this.userPage.hasText(e.chatUserMessageText, 'test'); + await this.userPage2.hasText(e.chatUserMessageText, 'test'); + } } exports.Chat = Chat; diff --git a/bigbluebutton-tests/playwright/chat/chat.spec.js b/bigbluebutton-tests/playwright/chat/chat.spec.js index 3c8dd53f86..bf61c5dfcb 100644 --- a/bigbluebutton-tests/playwright/chat/chat.spec.js +++ b/bigbluebutton-tests/playwright/chat/chat.spec.js @@ -91,4 +91,8 @@ test.describe('Chat', () => { test('Private chat disabled when user leaves meeting @ci', async () => { await chat.chatDisabledUserLeaves(); }); + + test('Prevent specific user from sending public chat messages @ci', async ({ context }) => { + await chat.preventUserFromUsingPublicChat(context); + }); }); diff --git a/bigbluebutton-tests/playwright/core/elements.js b/bigbluebutton-tests/playwright/core/elements.js index 979eddc430..c122475a22 100644 --- a/bigbluebutton-tests/playwright/core/elements.js +++ b/bigbluebutton-tests/playwright/core/elements.js @@ -395,6 +395,7 @@ exports.userBannedMessage2 = 'div[id="app"] >> div >> div:nth-child(2)'; exports.meetingEndedModalTitle = 'h1[data-test="meetingEndedModalTitle"]'; exports.unmuteUser = 'li[data-test="unmuteUser"]'; exports.ejectCamera = 'li[data-test="ejectCamera"]'; +exports.togglePublicChat = 'li[data-test="togglePublicChat"]'; // Lock Viewers exports.lockViewersButton = 'li[data-test="lockViewersButton"]';