bigbluebutton-Github/bigbluebutton-tests/playwright/notifications/presenterNotifications.js

40 lines
1.6 KiB
JavaScript
Raw Normal View History

2022-01-20 03:50:59 +08:00
const { MultiUsers } = require("../user/multiusers");
const util = require('./util');
const e = require('../core/elements');
const utilPolling = require('../polling/util');
const utilScreenShare = require('../screenshare/util');
const utilPresentation = require('../presentation/util');
2023-03-14 03:34:31 +08:00
const { ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
2022-01-20 03:50:59 +08:00
class PresenterNotifications extends MultiUsers {
constructor(browser, context) {
super(browser, context);
}
async publishPollResults() {
2022-06-08 02:52:22 +08:00
await util.waitAndClearDefaultPresentationNotification(this.modPage);
2024-02-28 22:34:23 +08:00
await utilPolling.startPoll(this.modPage);
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasElementEnabled(e.publishPollingLabel);
await this.modPage.waitAndClick(e.publishPollingLabel);
2022-01-20 03:50:59 +08:00
await this.modPage.waitForSelector(e.smallToastMsg);
await util.checkNotificationText(this.modPage, e.pollPublishedToast);
}
async fileUploaderNotification() {
2023-03-14 03:34:31 +08:00
await utilPresentation.uploadSinglePresentation(this.modPage, e.uploadPresentationFileName, ELEMENT_WAIT_LONGER_TIME);
2022-01-20 21:03:18 +08:00
await util.checkNotificationText(this.userPage, e.presentationUploadedToast);
2022-01-20 03:50:59 +08:00
}
async screenshareToast() {
2022-06-08 02:52:22 +08:00
await util.waitAndClearDefaultPresentationNotification(this.modPage);
2022-01-20 03:50:59 +08:00
await utilScreenShare.startScreenshare(this.modPage);
await util.checkNotificationText(this.modPage, e.startScreenshareToast);
await this.modPage.closeAllToastNotifications();
2022-01-20 03:50:59 +08:00
await this.modPage.waitAndClick(e.stopScreenSharing);
await util.checkNotificationText(this.modPage, e.endScreenshareToast);
}
}
exports.PresenterNotifications = PresenterNotifications;