2023-07-17 22:32:52 +08:00
|
|
|
const { default: test } = require('@playwright/test');
|
2021-11-18 04:07:14 +08:00
|
|
|
const Page = require('../core/page');
|
2022-01-20 03:50:59 +08:00
|
|
|
const { setStatus } = require('./util');
|
2022-06-24 02:06:26 +08:00
|
|
|
const { waitAndClearNotification, waitAndClearDefaultPresentationNotification } = require('../notifications/util');
|
2021-11-18 04:07:14 +08:00
|
|
|
const e = require('../core/elements');
|
2023-07-17 22:32:52 +08:00
|
|
|
const { getSettings } = require('../core/settings');
|
2021-11-03 00:45:52 +08:00
|
|
|
|
|
|
|
class Status extends Page {
|
2021-11-16 00:42:29 +08:00
|
|
|
constructor(browser, page) {
|
|
|
|
super(browser, page);
|
2021-11-03 00:45:52 +08:00
|
|
|
}
|
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
async changeUserStatus() {
|
2023-07-17 22:32:52 +08:00
|
|
|
const { userStatusEnabled } = getSettings();
|
|
|
|
|
2022-06-24 02:06:26 +08:00
|
|
|
await waitAndClearDefaultPresentationNotification(this);
|
2023-11-15 04:15:26 +08:00
|
|
|
if(!userStatusEnabled) {
|
2023-11-16 20:00:22 +08:00
|
|
|
await this.waitAndClick(e.currentUser);
|
2023-11-15 04:15:26 +08:00
|
|
|
return this.wasRemoved(e.setStatus);
|
|
|
|
}
|
2021-12-04 05:44:55 +08:00
|
|
|
await setStatus(this, e.applaud);
|
|
|
|
await this.waitForSelector(e.smallToastMsg);
|
|
|
|
await this.checkElement(e.applauseIcon);
|
2021-11-03 00:45:52 +08:00
|
|
|
|
2021-12-10 21:30:29 +08:00
|
|
|
await waitAndClearNotification(this);
|
2021-12-04 05:44:55 +08:00
|
|
|
await setStatus(this, e.away);
|
|
|
|
await this.waitForSelector(e.smallToastMsg);
|
|
|
|
await this.checkElement(e.awayIcon);
|
2021-11-03 00:45:52 +08:00
|
|
|
}
|
2021-12-10 21:30:29 +08:00
|
|
|
|
|
|
|
async mobileTagName() {
|
2022-02-08 03:22:48 +08:00
|
|
|
await this.waitAndClick(e.userListToggleBtn);
|
2022-03-02 04:11:45 +08:00
|
|
|
await this.waitForSelector(e.currentUser);
|
2021-12-10 21:30:29 +08:00
|
|
|
await this.hasElement(e.mobileUser);
|
|
|
|
}
|
2021-11-03 00:45:52 +08:00
|
|
|
}
|
|
|
|
|
2021-11-03 06:50:20 +08:00
|
|
|
exports.Status = Status;
|