Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

calvinbayer
Copy link
Contributor

@calvinbayer calvinbayer commented Mar 8, 2021

Motivation/Description of the PR

  • My application gets deployed to the web and also packaged into an Electron container. Therefore, I'd like to test it in both the web and the container. Unfortunately, that is not yet possible with CodeceptJs and I dislike having to maintain two different setups. Playwright allows to launch electron containers the same way you can launch browsers (playwright.chromium.launch(...) vs. playwright._electron.launch(...)). I'd love to see this additional "browser" being added to the CodeceptJs Playwright helper and would be willing to do that if you are in favor of the idea.
  • Resolves How can I attach to electron window? #825

Applicable helpers:

  • WebDriver
  • Puppeteer
  • Nightmare
  • REST
  • FileHelper
  • Appium
  • Protractor
  • TestCafe
  • Playwright

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • puppeteerCoverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • wdio

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@calvinbayer calvinbayer changed the title Feat/add electron browser to playwright [RFC] Feat/add electron browser to playwright Mar 10, 2021
Copy link
Contributor

@DavertMik DavertMik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, this PR is awesome!
But it needs to be documented so everyone knew how to test Electron apps!

Could you add a section about Electron testing to a guide here https://github.com/codeceptjs/CodeceptJS/blob/3.x/docs/playwright.md

And list electron as an option here:
https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/helper/Playwright.js#L61

Thanks!

const popupStore = new Popup();
const consoleLogStore = new Console();
const availableBrowsers = ['chromium', 'webkit', 'firefox'];
const availableBrowsers = ['chromium', 'webkit', 'firefox', '_electron'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const availableBrowsers = ['chromium', 'webkit', 'firefox', '_electron'];
const availableBrowsers = ['chromium', 'webkit', 'firefox', 'electron'];

Maybe let's just call it electron? Why not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,
sorry I had a few busy weeks and it took me a while to finish this PR. Please have a look again, I have renamed the browser from _electron to electron and added some documentation as well as some other needed changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cbayer97
This was a very hard week (month) for me so I just got here to look at updated PR. Everything looks good! 👍

@calvinbayer calvinbayer changed the title [RFC] Feat/add electron browser to playwright Feat/add electron browser to playwright Mar 27, 2021
@calvinbayer calvinbayer force-pushed the feat/add-electron-browser-to-playwright branch from e703ae0 to 2c65fe2 Compare March 28, 2021 08:51
@calvinbayer calvinbayer requested a review from DavertMik March 30, 2021 15:03
@DavertMik DavertMik merged commit cfd9ed8 into codeceptjs:3.x Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I attach to electron window?
2 participants