mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -06:00
Electron build issues
1. Moved spectron test to a different directory 2. Added a npm command to run spectron test separately
This commit is contained in:
parent
4d40bde31a
commit
992bc6649e
@ -15,7 +15,8 @@
|
|||||||
"prebuild": "npm run rebuild && npm run browserify-preload",
|
"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",
|
"browserify-preload": "browserify -o js/preload/_preloadMain.js -x electron --insert-global-vars=__filename,__dirname js/preload/preloadMain.js",
|
||||||
"rebuild": "electron-rebuild -f",
|
"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/",
|
"lint": "eslint --ext .js js/",
|
||||||
"rename-exe": "cd dist/win-unpacked && ren Symphony.exe Symphony-Electron.exe"
|
"rename-exe": "cd dist/win-unpacked && ren Symphony.exe Symphony-Electron.exe"
|
||||||
},
|
},
|
||||||
|
@ -3,10 +3,10 @@ const childProcess = require('child_process');
|
|||||||
|
|
||||||
let activityDetection;
|
let activityDetection;
|
||||||
|
|
||||||
describe('Tests for Activity Detection', function() {
|
describe('Tests for Activity Detection', function () {
|
||||||
|
|
||||||
var originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
var originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||||
|
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
childProcess.exec(`npm rebuild --target=${process.version} --build-from-source`, function (err) {
|
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) {
|
afterAll(function (done) {
|
||||||
childProcess.exec('npm run rebuild', function (err, stdout) {
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||||
if (err){
|
done();
|
||||||
throw(err);
|
|
||||||
}
|
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return null', function() {
|
it('should return null', function () {
|
||||||
|
|
||||||
activityDetection.setActivityWindow(0, electron.ipcRenderer);
|
activityDetection.setActivityWindow(0, electron.ipcRenderer);
|
||||||
const noData = activityDetection.activityDetection();
|
const noData = activityDetection.activityDetection();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
const {isMac} = require('../js/utils/misc.js');
|
const {isMac} = require('../../js/utils/misc.js');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
let app = new Application({});
|
let app = new Application({});
|
||||||
@ -46,16 +46,12 @@ describe('Tests for Always on top', () => {
|
|||||||
if (app && app.isRunning()) {
|
if (app && app.isRunning()) {
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||||
app.stop().then(() => {
|
app.stop().then(() => {
|
||||||
childProcess.exec('npm run rebuild', function (err, stdout) {
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
done();
|
||||||
done();
|
|
||||||
});
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
childProcess.exec('npm run rebuild', function () {
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
expect(err).toBeNull();
|
||||||
expect(err).toBeNull();
|
done();
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -1,4 +1,4 @@
|
|||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
let app = new Application({});
|
let app = new Application({});
|
||||||
|
|
||||||
describe('Tests for Bring to front', () => {
|
describe('Tests for Bring to front', () => {
|
@ -1,4 +1,4 @@
|
|||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
let app = new Application({});
|
let app = new Application({});
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ describe('Tests for clipboard', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should check window count', () => {
|
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', () => {
|
it('should set the username field', () => {
|
@ -6,7 +6,7 @@ describe('Tests for Close', () => {
|
|||||||
let app;
|
let app;
|
||||||
|
|
||||||
beforeAll((done) => {
|
beforeAll((done) => {
|
||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
app = new Application({});
|
app = new Application({});
|
||||||
return app.startApplication().then((startedApp) => {
|
return app.startApplication().then((startedApp) => {
|
||||||
app = startedApp;
|
app = startedApp;
|
@ -1,8 +1,8 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
const {isMac} = require('../js/utils/misc');
|
const {isMac} = require('../../js/utils/misc');
|
||||||
let robot;
|
let robot;
|
||||||
let configPath;
|
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 path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
const {isMac} = require('../js/utils/misc');
|
const {isMac} = require('../../js/utils/misc');
|
||||||
let robot;
|
let robot;
|
||||||
let configPath;
|
let configPath;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {isMac} = require('../js/utils/misc');
|
const {isMac} = require('../../js/utils/misc');
|
||||||
let app = new Application({});
|
let app = new Application({});
|
||||||
|
|
||||||
describe('Tests for Notification position', () => {
|
describe('Tests for Notification position', () => {
|
||||||
@ -45,9 +45,9 @@ describe('Tests for Notification position', () => {
|
|||||||
it('should load demo html page', () => {
|
it('should load demo html page', () => {
|
||||||
let filePath;
|
let filePath;
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
filePath = 'file:///' + path.join(__dirname, '..', 'demo/index.html');
|
filePath = 'file:///' + path.join(__dirname, '..', '..', 'demo/index.html');
|
||||||
} else {
|
} else {
|
||||||
filePath = 'file://$(pwd)/' + path.join(__dirname, '..', 'demo/index.html')
|
filePath = 'file://$(pwd)/' + path.join(__dirname, '..', '..', 'demo/index.html')
|
||||||
}
|
}
|
||||||
return app.client.url(filePath);
|
return app.client.url(filePath);
|
||||||
});
|
});
|
@ -1,8 +1,8 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
const Application = require('./spectron/spectronSetup');
|
const Application = require('./spectronSetup');
|
||||||
const {isMac} = require('../js/utils/misc');
|
const {isMac} = require('../../js/utils/misc');
|
||||||
let robot;
|
let robot;
|
||||||
let configPath;
|
let configPath;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user