2021-02-17 04:57:10 +08:00
|
|
|
const { ELEMENT_WAIT_TIME } = require('../core/constants');
|
2018-11-23 20:55:16 +08:00
|
|
|
const e = require('./elements');
|
|
|
|
|
|
|
|
async function setStatus(test, status) {
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(e.firstUser, ELEMENT_WAIT_TIME);
|
|
|
|
await test.click(e.firstUser, true);
|
|
|
|
await test.waitForSelector(e.setStatus, ELEMENT_WAIT_TIME);
|
2018-11-23 20:55:16 +08:00
|
|
|
await test.click(e.setStatus, true);
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(status, ELEMENT_WAIT_TIME);
|
2018-11-23 20:55:16 +08:00
|
|
|
await test.click(status, true);
|
|
|
|
}
|
|
|
|
|
2021-02-17 04:57:10 +08:00
|
|
|
|
|
|
|
async function countTestElements(element) {
|
|
|
|
return document.querySelectorAll(element).length !== 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.countTestElements = countTestElements;
|
2018-11-23 20:55:16 +08:00
|
|
|
exports.setStatus = setStatus;
|