-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: forge cannot make a build without signing. Also playwright fir…
…st working test
- Loading branch information
1 parent
464e014
commit c9d0d8a
Showing
5 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { _electron as electron, ElectronApplication, test, Page } from "@playwright/test"; | ||
import { findLatestBuild, parseElectronApp, clickMenuItemById } from "electron-playwright-helpers"; | ||
|
||
let electronApp: ElectronApplication; | ||
let page: Page; | ||
|
||
test.beforeAll(async () => { | ||
const latestBuild = findLatestBuild(); | ||
const appInfo = parseElectronApp(latestBuild); | ||
|
||
electronApp = await electron.launch({ | ||
args: [appInfo.main], | ||
executablePath: appInfo.executable, | ||
}); | ||
|
||
electronApp.on("window", async initialPage => { | ||
const filename = initialPage.url()?.split("/").pop(); | ||
console.log(`Window opened: ${filename}`); | ||
|
||
initialPage.on("pageerror", error => { | ||
console.error(error); | ||
}); | ||
|
||
initialPage.on("console", msg => { | ||
console.log(msg.text()); | ||
}); | ||
}); | ||
}); | ||
|
||
test("renders landing page", async () => { | ||
page = await electronApp.firstWindow(); | ||
await page.screenshot({ path: "landing.png" }); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await electronApp.close(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1358,7 +1358,7 @@ | |
xterm-addon-fit "^0.5.0" | ||
xterm-addon-search "^0.8.0" | ||
|
||
"@electron/asar@^3.2.1": | ||
"@electron/asar@^3.2.1", "@electron/asar@^3.2.4": | ||
version "3.2.4" | ||
resolved "https://registry.yarnpkg.com/@electron/asar/-/asar-3.2.4.tgz#7e8635a3c4f6d8b3f8ae6efaf5ecb9fbf3bd9864" | ||
integrity sha512-lykfY3TJRRWFeTxccEKdf1I6BLl2Plw81H0bbp4Fc5iEc67foDCa5pjJQULVgo0wF+Dli75f3xVcdb/67FFZ/g== | ||
|
@@ -5070,6 +5070,13 @@ electron-packager@^17.1.1: | |
semver "^7.1.3" | ||
yargs-parser "^21.1.1" | ||
|
||
electron-playwright-helpers@^1.6.0: | ||
version "1.6.0" | ||
resolved "https://registry.yarnpkg.com/electron-playwright-helpers/-/electron-playwright-helpers-1.6.0.tgz#74d17d3e1a4f738afc51e93c0912d2e1e16d496a" | ||
integrity sha512-0csyp77xRAi8m5g1ApcYdTMJ8n0+Geyb4huyMAsIYTInk4wsuUTHmIy2gMfgF3I130ogfpX6ZfEGeffS93FaUA== | ||
dependencies: | ||
"@electron/asar" "^3.2.4" | ||
|
||
[email protected]: | ||
version "24.5.0" | ||
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-24.5.0.tgz#492a4d7caa232e88ee3c18f5c3b4dc637e5e1b3a" | ||
|