bigbluebutton-Github/bigbluebutton-tests/playwright/user/status.js
2023-11-14 17:15:26 -03:00

39 lines
1.2 KiB
JavaScript

const { default: test } = require('@playwright/test');
const Page = require('../core/page');
const { setStatus } = require('./util');
const { waitAndClearNotification, waitAndClearDefaultPresentationNotification } = require('../notifications/util');
const e = require('../core/elements');
const { getSettings } = require('../core/settings');
class Status extends Page {
constructor(browser, page) {
super(browser, page);
}
async changeUserStatus() {
const { userStatusEnabled } = getSettings();
await waitAndClearDefaultPresentationNotification(this);
if(!userStatusEnabled) {
this.waitAndClick(e.currentUser);
return this.wasRemoved(e.setStatus);
}
await setStatus(this, e.applaud);
await this.waitForSelector(e.smallToastMsg);
await this.checkElement(e.applauseIcon);
await waitAndClearNotification(this);
await setStatus(this, e.away);
await this.waitForSelector(e.smallToastMsg);
await this.checkElement(e.awayIcon);
}
async mobileTagName() {
await this.waitAndClick(e.userListToggleBtn);
await this.waitForSelector(e.currentUser);
await this.hasElement(e.mobileUser);
}
}
exports.Status = Status;