CodeceptJS
CodeceptJS copied to clipboard
Playwright: Added possibility of creating of a context with a page
Motivation/Description of the PR
- I would like to be able to open page after restart of browser. I use this patch for a long time in my project and it works for me well.
- Resolves #3248
Applicable helpers:
- [ ] WebDriver
- [ ] Puppeteer
- [ ] Nightmare
- [ ] REST
- [ ] FileHelper
- [ ] Appium
- [ ] Protractor
- [ ] TestCafe
- [x] Playwright
Applicable plugins:
- [ ] allure
- [ ] autoDelay
- [ ] autoLogin
- [ ] customLocator
- [ ] pauseOnFail
- [ ] coverage
- [ ] retryFailedStep
- [ ] screenshotOnFail
- [ ] selenoid
- [ ] stepByStepReport
- [ ] stepTimeout
- [ ] wdio
- [ ] subtitles
Type of change
- [ ] :fire: Breaking changes
- [ ] :rocket: New functionality
- [x] :bug: Bug fix
- [ ] :clipboard: Documentation changes/updates
- [ ] :hotsprings: Hot fix
- [ ] :hammer: Markdown files fix - not related to source code
- [ ] :nail_care: Polish code
Checklist:
- [x] Tests have been added
- [x] Documentation has been added (Run
npm run docs) - [x] Lint checking (Run
npm run lint) - [x] Local tests are passed (Run
npm test)
Thanks, seems useful Could you add also usage documentation into https://github.com/codeceptjs/CodeceptJS/blob/3.x/docs/playwright.md
It would be also nice to have a more detailed example where you actually use _startBrowser and _startContextPage
This will help others to start using these custom methods
Added an example into Playwright's docs, it's my use case for _createContextPage
@mirao what do you think of adding restartBrowser into the Playwright helper?
Looks like it should belong there
@DavertMik Yes, I can add the method restartBrowser() into the Playwright's helper. Or should I name it _restartBrowser()? I'm not sure about name convention.
restartBrowser()
So user could call it natively from their tests, please update documentation accordingly to show simplified approach
@DavertMik Done
Thank you! Finally we have it!