QA Wolf logo

QA Wolf


Launch a Playwright Context. If persistentContext is not true, also launch a Browser.

// launch a chrome browser and context
const { browser, context } = await launch();
// create a page in the context to use in our test
const page = await context.newPage();
// slow down each action down by 2 seconds
const { context } = await launch({ slowMo: 2000 });
// launch a webkit (safari) browser and context
const { context } = await launch({ browser: "webkit" });
// emulate an iphone to test a responsive site
// full list of devices:
const { context } = await launch({ ...devices["iPhone 8"] });
// emulate a camera and screen for testing recording
const { context } = await launch({
args: [
// accept permission prompts
const { context } = await launch({
permissions: ["clipboard-read", "clipboard-write", "geolocation"],


You can use any option available on launch or newContext, including these commonly used ones:

[options] (Object)

  • [args] (Array<string>): Arguments to pass to the browser launch. Useful for testing the camera. Default: []
  • [browser] ("chrome" | "chromium" | "firefox" | "webkit"): Type of browser to launch. Default: "chrome"
  • [devtools] (boolean): Open devtools. Default: false
  • [permissions] (Array<string>): Accept permission prompts. Default: []
  • [persistentContext] (boolean): Launch a persistent context. This will not return a browser.
  • [userDataDir] (string): The persistent context userDataDir.
  • [slowMo] (number): Slow down each action by a number of milliseconds. Default: 0

Returns: Promise<{ browser?, context }>