test(e2e): add test for grid example (#545)

This commit is contained in:
CodinCat
2019-12-18 23:19:31 +09:00
committed by Evan You
parent 5cf7523787
commit abfea8eb45
2 changed files with 120 additions and 0 deletions

View File

@@ -70,6 +70,12 @@ export function setupPuppeteer() {
return await page.$eval(selector, node => node === document.activeElement)
}
async function setValue(selector: string, value: string) {
const el = (await page.$(selector))!
await el.evaluate((node: HTMLInputElement) => (node.value = ''))
await el.type(value)
}
async function enterValue(selector: string, value: string) {
const el = (await page.$(selector))!
await el.evaluate((node: HTMLInputElement) => (node.value = ''))
@@ -96,6 +102,7 @@ export function setupPuppeteer() {
isVisible,
isChecked,
isFocused,
setValue,
enterValue,
clearValue
}