You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
652 B

import {failUnless, gtState, safeNavigate, launch, sleep, cleanup} from './gtlib'
jest.setTimeout((2).minutes())
const state = gtState()
beforeEach(() => launch(state), (30).seconds())
test('it should display my name in the hero box', async () => {
await sleep((1).second())
const page = await safeNavigate(state, 'https://garrettmills.dev')
const heroBox =
failUnless(await page.$('.hero-box'), 'Unable to find .hero-box')
const name = await heroBox.evaluate(x => x.innerHTML.trim().toLowerCase())
failUnless(name.includes('garrett mills'), 'Unable to find name in .hero-box HTML')
})
afterAll(() => cleanup(state))