This repository has been archived by the owner on Apr 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4405164
commit c738c33
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
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,28 @@ | ||
// A simple test to verify a visible window is opened with a title | ||
var Application = require('spectron').Application | ||
var assert = require('assert') | ||
|
||
var app = new Application({ | ||
path: 'dist/Rambox-linux-x64/Rambox' | ||
}) | ||
|
||
app.start().then(function () { | ||
// Check if the window is visible | ||
return app.browserWindow.isVisible() | ||
}).then(function (isVisible) { | ||
// Verify the window is visible | ||
assert.equal(isVisible, true) | ||
}).then(function () { | ||
// Get the window's title | ||
return app.client.getTitle() | ||
}).then(function (title) { | ||
// Verify the window's title | ||
assert.equal(title, 'Ramboxx') | ||
}).then(function () { | ||
// Stop the application | ||
return app.stop() | ||
}).catch(function (error) { | ||
// Log any failures | ||
console.error('Test failed', error.message) | ||
return app.stop() | ||
}) |