electron-playwright-helpers
electron-playwright-helpers copied to clipboard
[question] launching playwright in UI mode
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"
* ============================================================
*/