Automated Testing with Puppeteer

automated testing with Puppeteer

Jest Puppeteer Testing

import 'expect-puppeteer'
describe('Google', () => {
beforeAll(async () => {
await page.goto('https://testingbot.com')
})
it('should display "testingbot" text on page', async () => {
await expect(page).toMatch('testingbot')
})
})

WebdriverIO and Puppeteer

import { format } from 'util'
import { remote } from 'webdriverio'
(async () => {
const browser = await remote({
capabilities: {
'wdio:devtoolsOptions': {
browserWSEndpoint: format(
`wss://cloud.testingbot.com?key=%s&secret=%s&browserName=chrome&browserVersion=latest`,
`key`,
`secret`
)
}
}
})
await browser.url('https://testingbot.com') const title = await browser.getTitle()
console.log(title)
await browser.deleteSession()
})()

Record with Puppeteer

Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store