Skip to content

Instantly share code, notes, and snippets.

@angiejones
Last active September 11, 2020 21:33
Embed
What would you like to do?
Playwright - simple test to verify page title
const { chromium } = require('playwright')
const assert = require('assert')
describe('Automation Bookstore', function () {
let browser, page
before(async () => {
browser = await chromium.launch()
})
after(async () => {
await browser.close()
})
beforeEach(async () => {
page = await browser.newPage()
await page.goto('https://automationbookstore.dev/')
})
afterEach(async () => {
await page.close()
})
it('should have title', async () => {
assert.equal(await page.innerText('#page-title'), 'Automation Bookstore')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment