mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-23 06:19:49 -05:00
Improve the test
This commit is contained in:
parent
d08a71ab49
commit
b69550f5b9
@ -223,12 +223,14 @@ async function login(username, password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function click(page, selector, elementIndex = 0) {
|
async function click(page, selector, elementIndex = 0) {
|
||||||
|
await page.waitForSelector(selector);
|
||||||
return await page.evaluate((s, i) => {
|
return await page.evaluate((s, i) => {
|
||||||
return document.querySelectorAll(s)[i].click();
|
return document.querySelectorAll(s)[i].click();
|
||||||
}, selector, elementIndex);
|
}, selector, elementIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function input(page, selector, text) {
|
async function input(page, selector, text) {
|
||||||
|
await page.waitForSelector(selector);
|
||||||
const element = await page.$(selector);
|
const element = await page.$(selector);
|
||||||
await element.click({ clickCount: 3 });
|
await element.click({ clickCount: 3 });
|
||||||
await page.keyboard.press("Backspace");
|
await page.keyboard.press("Backspace");
|
||||||
|
Loading…
Reference in New Issue
Block a user