CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Launch persistent context using a temporary directory

Open kenz-lu opened this issue 3 years ago • 3 comments

What are you trying to achieve?

Launch persistent context in Playwright using a temporary directory by passing an empty string to userDataDir. (Playwright documentation: https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context-option-user-data-dir)

What do you get instead?

Playwright browser does not launch using persistent context

Details

  • CodeceptJS version: v3.3.4
  • NodeJS Version: v19.0.1
  • Operating System: MacOS
  • Playwright: v1.23.2
  • Configuration file:
Playwright: {
      chromium: {
        userDataDir: '',
      },
}

kenz-lu avatar Dec 22 '22 04:12 kenz-lu

I believe this is the cause? https://github.com/codeceptjs/CodeceptJS/blob/c79a0c6b85ceceddeff8417c696511f016ef4555/lib/helper/Playwright.js#L729-L733

kenz-lu avatar Dec 22 '22 04:12 kenz-lu

Sounds like if (typeof this.userDataDir !== 'undefined') should solve the issue?

khanguy00 avatar Dec 22 '22 04:12 khanguy00

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Dec 09 '23 02:12 github-actions[bot]