From c738c331ef6f7ac452ab4e243129491499b310cf Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Wed, 22 Jun 2016 14:38:21 -0300 Subject: [PATCH] Basic test --- electron/test.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 electron/test.js diff --git a/electron/test.js b/electron/test.js new file mode 100644 index 00000000..cc87e00c --- /dev/null +++ b/electron/test.js @@ -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() +})