Performs E2E testing using puppeteer

PHOTO EMBED

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

Saved by @shubham75089 #jest #nodejs #testing #puppeteer

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)
})
content_copyCOPY