Created
October 29, 2021 14:31
-
-
Save el3um4s/d16111e7d2112963f38dba7ca76c3577 to your computer and use it in GitHub Desktop.
MEDIUM - Ho to Test Electron Apps - 14
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
let context: BrowserContext; | |
test.beforeAll(async () => { | |
electronApp = await electron.launch({ args: ["."] }); | |
context = electronApp.context(); | |
await context.tracing.start({ screenshots: true, snapshots: true }); | |
firstWindow = await electronApp.firstWindow(); | |
await firstWindow.screenshot({ path: "tests/screenshot/firstWindow.png" }); | |
expect(await firstWindow.screenshot()).toMatchSnapshot("firstWindow.png"); | |
}); | |
// ... | |
test.afterAll(async () => { | |
await context.tracing.stop({ path: "tests/tracing/trace.zip" }); | |
await electronApp.close(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment