2022-08-03 07:37:16 +08:00
|
|
|
const { expect } = require('@playwright/test');
|
|
|
|
const Page = require('../core/page');
|
|
|
|
const util = require('./util');
|
2022-08-18 11:34:32 +08:00
|
|
|
const { waitAndClearNotification, waitAndClearDefaultPresentationNotification } = require('../notifications/util');
|
2022-08-03 07:37:16 +08:00
|
|
|
const e = require('../core/elements');
|
|
|
|
const { connectMicrophone } = require('../audio/util');
|
|
|
|
const { sleep } = require('../core/helpers');
|
|
|
|
const { ELEMENT_WAIT_EXTRA_LONG_TIME } = require('../core/constants');
|
|
|
|
|
|
|
|
class RecordingNotifications extends Page {
|
|
|
|
constructor(browser, page) {
|
|
|
|
super(browser, page);
|
|
|
|
}
|
|
|
|
|
|
|
|
async notificationNoAudio() {
|
|
|
|
// when you don't join audio at all, there's notification about no active mic
|
2022-08-18 11:34:32 +08:00
|
|
|
await waitAndClearDefaultPresentationNotification(this);
|
2022-08-03 07:37:16 +08:00
|
|
|
await this.waitAndClick(e.recordingIndicator, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
|
|
|
await this.waitForSelector(e.smallToastMsg);
|
|
|
|
await util.checkNotificationText(this, e.noActiveMicrophoneToast);
|
|
|
|
}
|
|
|
|
|
|
|
|
async notificationListenOnly() {
|
|
|
|
// when you join listen only, there's notification about no active mic
|
2022-08-18 11:34:32 +08:00
|
|
|
await waitAndClearDefaultPresentationNotification(this);
|
|
|
|
await this.waitAndClick(e.joinAudio, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
2022-08-03 07:37:16 +08:00
|
|
|
await this.waitAndClick(e.listenOnlyButton, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
|
|
|
await waitAndClearNotification(this);
|
|
|
|
await this.waitAndClick(e.recordingIndicator);
|
|
|
|
await this.waitForSelector(e.smallToastMsg);
|
|
|
|
await util.checkNotificationText(this, e.noActiveMicrophoneToast);
|
|
|
|
}
|
|
|
|
|
|
|
|
async noNotificationInAudio() {
|
|
|
|
// when you join audio with mic, there's no notification about no active mic
|
2022-08-18 11:34:32 +08:00
|
|
|
await waitAndClearDefaultPresentationNotification(this);
|
|
|
|
await this.waitAndClick(e.joinAudio, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
2022-08-03 07:37:16 +08:00
|
|
|
await this.waitForSelector(e.audioModal, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
|
|
|
await connectMicrophone(this);
|
|
|
|
await waitAndClearNotification(this);
|
|
|
|
await this.waitAndClick(e.recordingIndicator);
|
2022-08-18 11:34:32 +08:00
|
|
|
await this.wasRemoved(e.smallToastMsg, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
2022-08-03 07:37:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async modalStartRecording() {
|
|
|
|
await this.waitAndClick(e.recordingIndicator, ELEMENT_WAIT_EXTRA_LONG_TIME);
|
|
|
|
await this.waitForSelector(e.noButton);
|
|
|
|
await this.waitForSelector(e.yesButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.RecordingNotifications = RecordingNotifications;
|