-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed app component specs. Closes #602.
- Loading branch information
Showing
5 changed files
with
205 additions
and
9 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,41 @@ | ||
const Application = require('spectron').Application; | ||
const assert = require('assert'); | ||
const path = require('path'); | ||
|
||
console.log(__dirname); | ||
let electronPath = path.join(__dirname, '../../node_modules', '.bin', 'electron'); | ||
const appPath = path.join(__dirname, '../main'); | ||
if (process.platform === 'win32') { | ||
electronPath += '.cmd'; | ||
} | ||
const app = new Application({ | ||
path: electronPath, | ||
args: [appPath], | ||
env: { | ||
ELECTRON_ENABLE_LOGGING: true, | ||
ELECTRON_ENABLE_STACK_DUMPING: true, | ||
NODE_ENV: 'development' | ||
}, | ||
startTimeout: 20000, | ||
}); | ||
|
||
app.start().then(() => { | ||
// Check if the window is visible | ||
return app.browserWindow.isVisible(); | ||
}).then((isVisible) => { | ||
// Verify the window is visible | ||
assert.equal(isVisible, true); | ||
}).then(() => { | ||
// Get the window's title | ||
return app.client.getTitle(); | ||
}).then((title) => { | ||
// Verify the window's title | ||
assert.equal(title, 'Altair'); | ||
}).then(() => { | ||
// Stop the application | ||
return app.stop(); | ||
}).catch((error) => { | ||
// Log any failures | ||
console.error('Test failed', error.message); | ||
return app.stop(); | ||
}) |
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
Oops, something went wrong.