Skip to content

[Question/Usage] How to configure electron and browser support using projects #21701

@JonMarbach

Description

@JonMarbach

Apologies if this really belongs in the discussion section, but I've looked at the electron example, and I've looked at the projects feature, but it's not clear how to put it all together to achieve what I want to do... Maybe I should describe (a slightly simplified version of) what I'm trying to do first.

I'm developing an electron app and that will be the primary way that we run tests once they are established. The app launches a webserver at a known port, and contains a login page and a main page. In development mode however, we launch the webserver manually and we use Chrome for development of the frontend. Since we use Angular, that version of the frontend is at a different URL (via ngserve.)

So, it looks like the projects feature (have an electron project and a dev project, with different baseUrls; the electron project can have a dependency on yet another project named "electron-launch" which will launch the webserver.) A few questions come up:

  1. We don't want both projects to run by default - is there a way to mark a project as dont-run-by-default?
  2. How do we "abstract away" whether the page object is an electron page or a browser page for the same suite of tests. I've read a lot of the docs but it's not "clicking" for me (but I feel like it's possible.)
  3. Can someone "sketch this out" for me? I'm a little lost with the different abstraction layers (fixtures sound like part of the answer but like I said, it's not gelling for me how to put this all together.)

Or do I have it all wrong and projects are the wrong way to do this!?

Thanks in advance! Playwright is amazing!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions