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

38 lines
1.5 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');
2022-06-08 02:52:22 +08:00
const { UPLOAD_PDF_WAIT_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);
2022-01-20 03:50:59 +08:00
await utilPolling.startPoll(this.modPage, true);
await this.modPage.waitForSelector(e.smallToastMsg);
await util.checkNotificationText(this.modPage, e.pollPublishedToast);
}
async fileUploaderNotification() {
2022-06-08 02:52:22 +08:00
await util.waitAndClearDefaultPresentationNotification(this.modPage);
await utilPresentation.uploadSinglePresentation(this.modPage, e.pdfFileName, UPLOAD_PDF_WAIT_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 util.waitAndClearNotification(this.modPage);
await this.modPage.waitAndClick(e.stopScreenSharing);
await util.checkNotificationText(this.modPage, e.endScreenshareToast);
}
}
exports.PresenterNotifications = PresenterNotifications;