spaceagetv / electron-playwright-helpers Goto Github PK
View Code? Open in Web Editor NEWHelper functions for running Electron end-to-end tests using Playwright.
License: MIT License
Helper functions for running Electron end-to-end tests using Playwright.
License: MIT License
I am getting errors when using the helpers in combination with EPH.
ipcMainInvokeHandler
does not seem to be working anymore for me. (See: https://github.com/MatthijsBurgh/vue-cli-plugin-electron-builder/actions/runs/5118894543/jobs/9203457814?pr=65#step:8:185)
Could you please trigger dependabot to create a PR to update electron in this project. To check whether the tests in this project keep succeeding or fail.
I noticed that after upgrading to 1.3.1, I am getting the following error when installing the package:
# This file contains the result of Yarn building a package (electron-playwright-helpers@npm:1.3.1)
# Script name: postinstall
cd: no such file or directory: example-project
I looked it up and it seems to be due to a recent change, the following line was added:
"postinstall": "cd example-project && npm install",
But in the distributed npm package, example-project
is not included. I think the postinstall
script needs to be adjusted, as it will run when installing the distributed npm package as well.
I have two issues running my playwright setup and I could use some help.
The first issue is that when I run playwright
in UI mode. The playwright UI is launched as well as the latest production build, however, time-travelling the assertions made in the tests and the overall "electron screen" displayed in UI mode, is always blank (see screenshot) - this happens in all three OSes, so I must have configured something wrong. Unfortunatly, I was not able to see what would happen if I ran the UI mode in the example project, as when I try to do npm run e2e
on the example project I get an error with "no-specs found".
The second issue is a simple question. I am using electron-vite
with react
and react-router
and my application navigates just fine, however, the assertion below fails even tho the screen clearly navigated to the new page after click the createFirstQuestionBtn
(also visible in the screenshot). What would be the right way to assert "URL" navigations in a electron app?
await expect(createFirstQuestionBtn).toBeVisible()
await expect(createFirstQuestionBtn).toBeEnabled()
createFirstQuestionBtn.click()
await page.waitForURL('**#/questions/create') // THIS FAILS
/**
* page.waitForURL: Navigation failed because page was closed!
* =========================== logs =============================
* waiting for navigation to "**#/questions/create" until "load"
* navigated to "file:///home/fb/Documents/github/quizmood-app/dist/linux-
* unpacked/resources/app.asar/out/renderer/index.html#/questions/create"
* ============================================================
*/
We at @webalys-hq are supporting an electron app + Next Js + Electron builder, I am the responsible of add test to desktop app.
I really like your library and I think we can work together in order to offer support for electron builder. I've tried the helpers library but it does not work with out code, so I think we can leave this issue open to start the conversation about it.
As stated in the documentation, it is currently only possible to click on menu items that are part of the application menu.
As a user of this library, I would like to also click on menu items in other menus.
The findMenuItem
method already detects all menu items. So perhaps it's not too difficult to also create the ability to interact with those items?
Great library!
Windows paths don't start with a /
. So the following check is invalid for windows:
electron-playwright-helpers/src/find_parse_builds.ts
Lines 27 to 29 in 03203fd
i'm using findLatestBuild to get app info of theia-electron however an error is thrown because out directory is not found. Any idea ?
I get the following error using the provided example:
electron.launch: Failed to launch: Error: spawn /out/MyApp-linux-x64/myapp
I checked out the actual file and it is /out/MyApp-linux-x64/MyApp
, so it seems to be a matter of casing.
Any thoughts?
The "findLatesBuild" function does currently only account for projects with a build folder named "out". It would be nice to have a parameter to change this directory (e.g. "build")
I noticed that electronApp.close()
immediately exits the process. Is there a way we can gracefully exit the process like selecting a MenuItem
from the context menu for the app icon in the system tray?
Hi,
I'm wondering if it's possible to wait for an IPC message sent from renderer to main?
We have a message that's part of our application lifecycle to know when we've loaded our required assets:
https://github.com/vcync/modV/blob/5f667ffa8d7884a587c34f00088936920d0ef74c/src/application/index.js#L86
https://github.com/vcync/modV/blob/f6674e2b5d05a2568b52623275b22a388b53e4ee/src/background/window-prefs.js#L101
So it would be great to start the tests once we've received that message.
Thanks.
Error: electron-playwright-helpers tried to access electron, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: electron
yarn install failed with above error
Error when used with yarn berry pnp workspace.
It seems like an error that occurs because electron is written in devdependencies, not dependencies.
https://yarnpkg.com/configuration/manifest#devDependencies
Looking at , it seems normal that devDependencies are not installed to the package user.
If the id
that newproject
refers to in the examples is the same one found in the Electron Examples it doesn't seem to work for us.
It throws with Error: Menu item with id 0 not found
The Readme includes a JavaScript example line:
let electronApp: ElectronApplication
I've never seen that kind of syntax for a variable declaration and when I use it my linter shows an error so I'm assuming that's a typo.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.