v0.10.0
Bug Fixes
- deprecate integrations (d9c5c06)
Features
New authenticate
hook (c7afd0c)
Works the same as the previous puppeteer:before-go-to
hook but this will only be called a single time before any routes are scanned. It will automatically collect any set cookies and local storage items during the hook.
// unlighthouse.config.ts
export default {
hooks: {
async authenticate (page) {
// login to the page
await page.goto('https://example.com/login')
const emailInput = await page.$('input[type="email"]')
await emailInput.type('[email protected]')
const passwordInput = await page.$('input[type="password"]')
await passwordInput.type('password')
await Promise.all([
page.$eval('.login-form', form => form.submit()),
page.waitForNavigation(),
])
},
},
}