Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@angiejones
Last active September 11, 2020 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angiejones/9fb37df888b933962866a64dd1e07a10 to your computer and use it in GitHub Desktop.
Save angiejones/9fb37df888b933962866a64dd1e07a10 to your computer and use it in GitHub Desktop.
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