Merge pull request #16465 from gabriellpr/rm-user

test: Remove user
This commit is contained in:
Anton Georgiev 2023-01-23 14:50:33 -05:00 committed by GitHub
commit 58187c6226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 77 additions and 3 deletions

View File

@ -524,12 +524,14 @@ class UserListItem extends PureComponent {
checkboxMessageId="app.userlist.menu.removeConfirmation.desc"
confirmParam={user.userId}
onConfirm={removeUser}
confirmButtonDataTest="removeUserConfirmation"
/>,
));
this.handleClose();
},
icon: 'circle_close',
dataTest: 'removeUser'
},
{
allowed: allowedToEjectCameras

View File

@ -335,6 +335,11 @@ exports.takePresenter = 'li[data-test="takePresenter"]';
exports.muteAll = 'li[data-test="muteAll"]';
exports.muteAllExceptPresenter = 'li[data-test="muteAllExceptPresenter"]';
exports.error403removedLabel = 'You have been removed from the meeting';
exports.removeUser = 'li[data-test="removeUser"]';
exports.removeUserConfirmationBtn = 'button[data-test="removeUserConfirmation"]';
exports.confirmationCheckbox = 'input[id="confirmationCheckbox"]';
exports.userBannedMessage = 'div[id="app"] >> div >> div:nth-child(2)';
exports.meetingEndedModalTitle = 'h1[data-test="meetingEndedModalTitle"]';
// Lock Viewers
exports.lockViewersButton = 'li[data-test="lockViewersButton"]';

View File

@ -314,7 +314,6 @@ class Page {
await expect(locator).toHaveValue(value);
}
async backgroundColorTest(selector, color) {
await expect(await this.page.$eval(selector, e => getComputedStyle(e).backgroundColor)).toBe(color);
}

View File

@ -40,12 +40,11 @@ class MultiUsers {
fullName,
meetingId: (useModMeetingId) ? this.modPage.meetingId : undefined,
};
const page = await context.newPage();
this.modPage2 = new Page(this.browser, page);
await this.modPage2.init(true, shouldCloseAudioModal, options);
}
async initUserPage(shouldCloseAudioModal = true, context = this.context, { fullName = 'Attendee', useModMeetingId = true, ...restOptions } = {}) {
const options = {
...restOptions,
@ -287,6 +286,61 @@ class MultiUsers {
await this.modPage.hasText(e.liveCaptions, e.message);
await this.modPage2.hasText(e.liveCaptions, e.message);
}
async removeUser() {
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.removeUser);
await this.modPage.waitAndClick(e.removeUserConfirmationBtn);
await this.modPage.wasRemoved(e.userListItem);
//Will be modified when the issue is fixed and accept just one of both screens
//https://github.com/bigbluebutton/bigbluebutton/issues/16463
try {
await this.modPage2.hasElement(e.errorScreenMessage);
} catch (err) {
await this.modPage2.hasElement(e.meetingEndedModalTitle);
}
}
async removeUserAndPreventRejoining(context) {
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.removeUser);
await this.modPage.waitAndClick(e.confirmationCheckbox);
await this.modPage.waitAndClick(e.removeUserConfirmationBtn);
await this.modPage.wasRemoved(e.userListItem);
//Will be modified when the issue is fixed and accept just one of both screens
//https://github.com/bigbluebutton/bigbluebutton/issues/16463
try {
await this.modPage2.hasElement(e.errorScreenMessage);
} catch (err) {
await this.modPage2.hasElement(e.meetingEndedModalTitle);
}
await this.initModPage2(false, context, {meetingId: this.modPage.meetingId, customParameter: 'userID=Moderator2'})
await this.modPage2.hasText(e.userBannedMessage, /banned/);
}
async writeClosedCaptions() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage2.waitForSelector(e.whiteboard);
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.writeClosedCaptions);
await this.modPage.waitAndClick(e.startWritingClosedCaptions);
await this.modPage.waitAndClick(e.startViewingClosedCaptionsBtn);
await this.modPage2.waitAndClick(e.startViewingClosedCaptionsBtn);
await this.modPage.waitAndClick(e.startViewingClosedCaptions);
await this.modPage2.waitAndClick(e.startViewingClosedCaptions);
const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type(e.message);
await this.modPage.hasText(e.liveCaptions, e.message);
await this.modPage2.hasText(e.liveCaptions, e.message);
}
}
exports.MultiUsers = MultiUsers;

View File

@ -71,6 +71,20 @@ test.describe.parallel('User', () => {
await multiusers.initModPage2();
await multiusers.giveAndRemoveWhiteboardAccess();
});
test('Remove user', async ({ browser, context, page }) => {
const multiusers = new MultiUsers(browser, context);
await multiusers.initModPage(page, true);
await multiusers.initModPage2(true);
await multiusers.removeUser();
});
test('Remove user and prevent rejoining', async ({ browser, context, page }) => {
const multiusers = new MultiUsers(browser, context);
await multiusers.initModPage(page, true);
await multiusers.initModPage2(true, context, { customParameter: 'userID=Moderator2'});
await multiusers.removeUserAndPreventRejoining(context);
});
});
test.describe.parallel('Manage', () => {