mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -06:00
Merge pull request #164 from KiranNiranjan/Build-issues-fix
ELECTRON-101 - Electron build issues
This commit is contained in:
commit
6aa90663bc
@ -15,7 +15,8 @@
|
||||
"prebuild": "npm run rebuild && npm run browserify-preload",
|
||||
"browserify-preload": "browserify -o js/preload/_preloadMain.js -x electron --insert-global-vars=__filename,__dirname js/preload/preloadMain.js",
|
||||
"rebuild": "electron-rebuild -f",
|
||||
"test": "npm run lint && jest --verbose --testPathPattern test --runInBand",
|
||||
"test": "npm run lint && jest --verbose --testPathPattern test && npm run rebuild && npm run spectron-test",
|
||||
"spectron-test": "jest --config tests/spectron/jest_spectron.json --runInBand && npm run rebuild",
|
||||
"lint": "eslint --ext .js js/",
|
||||
"rename-exe": "cd dist/win-unpacked && ren Symphony.exe Symphony-Electron.exe"
|
||||
},
|
||||
|
@ -3,10 +3,10 @@ const childProcess = require('child_process');
|
||||
|
||||
let activityDetection;
|
||||
|
||||
describe('Tests for Activity Detection', function() {
|
||||
describe('Tests for Activity Detection', function () {
|
||||
|
||||
var originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||
|
||||
beforeAll(function (done) {
|
||||
childProcess.exec(`npm rebuild --target=${process.version} --build-from-source`, function (err) {
|
||||
@ -21,16 +21,11 @@ describe('Tests for Activity Detection', function() {
|
||||
});
|
||||
|
||||
afterAll(function (done) {
|
||||
childProcess.exec('npm run rebuild', function (err, stdout) {
|
||||
if (err){
|
||||
throw(err);
|
||||
}
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
done();
|
||||
});
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return null', function() {
|
||||
it('should return null', function () {
|
||||
|
||||
activityDetection.setActivityWindow(0, electron.ipcRenderer);
|
||||
const noData = activityDetection.activityDetection();
|
||||
|
@ -1,5 +1,5 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const {isMac} = require('../js/utils/misc.js');
|
||||
const Application = require('./spectronSetup');
|
||||
const {isMac} = require('../../js/utils/misc.js');
|
||||
const childProcess = require('child_process');
|
||||
|
||||
let app = new Application({});
|
||||
@ -46,16 +46,12 @@ describe('Tests for Always on top', () => {
|
||||
if (app && app.isRunning()) {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
app.stop().then(() => {
|
||||
childProcess.exec('npm run rebuild', function (err, stdout) {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
done();
|
||||
});
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
done();
|
||||
}).catch((err) => {
|
||||
childProcess.exec('npm run rebuild', function () {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
expect(err).toBeNull();
|
||||
done();
|
||||
});
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
expect(err).toBeNull();
|
||||
done();
|
||||
});
|
||||
}
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const Application = require('./spectronSetup');
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for Bring to front', () => {
|
@ -1,4 +1,4 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const Application = require('./spectronSetup');
|
||||
const path = require('path');
|
||||
let app = new Application({});
|
||||
|
||||
@ -40,7 +40,7 @@ describe('Tests for clipboard', () => {
|
||||
});
|
||||
|
||||
it('should check window count', () => {
|
||||
return app.client.url('file:///' + path.join(__dirname, '..', 'demo/index.html'));
|
||||
return app.client.url('file:///' + path.join(__dirname, '..', '..', 'demo/index.html'));
|
||||
});
|
||||
|
||||
it('should set the username field', () => {
|
@ -6,7 +6,7 @@ describe('Tests for Close', () => {
|
||||
let app;
|
||||
|
||||
beforeAll((done) => {
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const Application = require('./spectronSetup');
|
||||
app = new Application({});
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
@ -1,8 +1,8 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const childProcess = require('child_process');
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const {isMac} = require('../js/utils/misc');
|
||||
const Application = require('./spectronSetup');
|
||||
const {isMac} = require('../../js/utils/misc');
|
||||
let robot;
|
||||
let configPath;
|
||||
|
4
tests/spectron/jest_spectron.json
Normal file
4
tests/spectron/jest_spectron.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"testMatch": ["**/*.spectron.js"],
|
||||
"verbose": true
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const childProcess = require('child_process');
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const {isMac} = require('../js/utils/misc');
|
||||
const Application = require('./spectronSetup');
|
||||
const {isMac} = require('../../js/utils/misc');
|
||||
let robot;
|
||||
let configPath;
|
||||
|
@ -1,6 +1,6 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const Application = require('./spectronSetup');
|
||||
const path = require('path');
|
||||
const {isMac} = require('../js/utils/misc');
|
||||
const {isMac} = require('../../js/utils/misc');
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for Notification position', () => {
|
||||
@ -43,13 +43,7 @@ describe('Tests for Notification position', () => {
|
||||
});
|
||||
|
||||
it('should load demo html page', () => {
|
||||
let filePath;
|
||||
if (process.platform === 'win32') {
|
||||
filePath = 'file:///' + path.join(__dirname, '..', 'demo/index.html');
|
||||
} else {
|
||||
filePath = 'file://$(pwd)/' + path.join(__dirname, '..', 'demo/index.html')
|
||||
}
|
||||
return app.client.url(filePath);
|
||||
return app.client.url('file:///' + path.join(__dirname, '..', '..', 'demo/index.html'));
|
||||
});
|
||||
|
||||
it('should load demo html', () => {
|
@ -1,8 +1,8 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const childProcess = require('child_process');
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const {isMac} = require('../js/utils/misc');
|
||||
const Application = require('./spectronSetup');
|
||||
const {isMac} = require('../../js/utils/misc');
|
||||
let robot;
|
||||
let configPath;
|
||||
|
Loading…
Reference in New Issue
Block a user