Snippets Collections
test('should verify typed', async () => {
  const browser = await puppeteer.launch({
    headless: false,
    slowMo: 10,
    args: ['--window-size=1920,1080']
  })
  const page = await browser.newPage()
  await page.goto(url)
  await page.type('.input-text', 'Hello World!')

  const finalText = await page.$eval('input.input-text', el => el.textContent)
  expect(finalText).toBe(finalText)
})
star

Sat May 15 2021 10:50:38 GMT+0000 (Coordinated Universal Time)

#jest #nodejs #testing #puppeteer

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension