Created
January 18, 2023 21:54
WordPress Plugin E2E Testing with Playwright - Global Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { chromium } from '@playwright/test' | |
async function globalSetup( config ) { | |
const { baseURL } = config.projects[0].use | |
const browser = await chromium.launch() | |
const page = await browser.newPage() | |
try { | |
await page.goto( baseURL ) | |
await browser.close() | |
} catch ( error ) { | |
await browser.close() | |
throw error | |
} | |
} | |
export default globalSetup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment