test: Prevent user from posting public chat (#21257)

* prevent user from posting public chat

* changed location initUserPage2
This commit is contained in:
Gabriel Luiz Porfirio 2024-09-27 20:11:43 -03:00 committed by GitHub
parent 8654f34c26
commit 5c8079e8dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 1 deletions

View File

@ -344,6 +344,23 @@ class Chat extends MultiUsers {
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;

View File

@ -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);
});
});

View File

@ -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"]';