Skip to content

Commit

Permalink
tests: add test 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Jul 24, 2024
1 parent f7126b2 commit abc1f9c
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions tests/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,58 @@ test( 'launch ntfy-desktop', async () =>

await app.close()
} )

/*
Test > full loadup and screenshot
*/

test( 'full load', async () =>
{

/*
Initialize
*/

const app = await electron.launch( {
args: [
'index.js',
'--quit'
],
env: {
...process.env,
NODE_ENV: 'development'
}
} )

const timestamp = Date.now().toString()

const appPath = await app.evaluate( async ( { app } ) =>
{
return app.getAppPath()
} )

console.log( appPath )

const window = await app.firstWindow()
console.log( await window.title() )
window.on( 'console', console.log )

/*
wait for #root div before taking screenshot
*/

await window.waitForSelector( '#root', { state: 'visible' } )

/*
path: `e2e/screenshots/test-${timestamp}.png`,
*/

const ss1 = await window.screenshot( { path: './test-results/1.png' } )

/*
Since the close button minimizes to tray, activate the menu and select quit
*/

await eph.clickMenuItemById( app, 'quit' )
await app.close()
} )

0 comments on commit abc1f9c

Please sign in to comment.