Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first step to get electron browser running, but tests not working yet #2818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trusktr
Copy link

@trusktr trusktr commented Oct 1, 2024

TODO:

  • enable launching playwrite._electron experimental Electron launcher.
  • the window pops open, but it appears the tests are hung, maybe the context/page handling needs to be adjusted, the API is slightly different than other browsers and there seems to be only a single context and page, not multiple like other browsers, or maybe I missed it.

Copy link

changeset-bot bot commented Oct 1, 2024

⚠️ No Changeset found

Latest commit: 4db1939

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -24,7 +24,7 @@ git remote add upstream [email protected]:modernweb-dev/web.git
Now that you have cloned the repository, ensure you have node 18+ installed, then run the following command to set up the development environment.

```sh
npm install
npm clean-install
Copy link
Author

Choose a reason for hiding this comment

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

I committed package-lock.json, and running npm clean-install will ensure that the setup is reproducible for the next person (npm install will update dependencies which always has a risk of breaking something).

if (this.browser) {
if (!('isConnected' in this.browser) || this.browser.isConnected()) {
await this.browser.close();
}
Copy link
Author

Choose a reason for hiding this comment

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

The ElectronApplication instance does not have a isConnected method.

createPage = ({ context }) => context.newPage(),
createBrowserContext = ({ browser }) => {
if ('browserWindow' in browser) {
return browser.context();
Copy link
Author

Choose a reason for hiding this comment

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

There is no newContext() method on the ElectronApplication instance. There seems to be a single context for the whole ElectronApplication only, so maybe this is why the tests are not working?

},
createPage = ({ context, browser }) => {
if ('browserWindow' in browser) {
return browser.firstWindow();
Copy link
Author

Choose a reason for hiding this comment

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

The firstWindows is a playwright Page. Maybe for Electron we need to open and close windows, instead of making contexts?

// testFailure: true,
// locationChanged: true,
// });
// });
Copy link
Author

Choose a reason for hiding this comment

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

  • TODO re-enable other tests before mering

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.

1 participant