2021-11-18 04:07:14 +08:00
|
|
|
const Page = require('../core/page');
|
|
|
|
const { setStatus } = require('./util');
|
|
|
|
const e = require('../core/elements');
|
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
|
|
|
}
|
|
|
|
|
|
|
|
async test() {
|
2021-11-18 04:07:14 +08:00
|
|
|
await setStatus(this.page, e.applaud);
|
|
|
|
await this.page.waitForSelector(e.applauseIcon);
|
|
|
|
const applauseIconLocator = this.page.locator(e.applauseIcon);
|
2021-11-03 00:45:52 +08:00
|
|
|
await expect(applauseIconLocator).toBeVisible();
|
|
|
|
|
2021-11-18 04:07:14 +08:00
|
|
|
await setStatus(this.page, e.away);
|
|
|
|
await this.page.waitForSelector(e.awayIcon);
|
|
|
|
const awayIconLocator = this.page.locator(e.awayIcon);
|
2021-11-03 00:45:52 +08:00
|
|
|
await expect(awayIconLocator).toBeVisible();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-03 06:50:20 +08:00
|
|
|
exports.Status = Status;
|