mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron-318 (Included build number in the client version info) (#314)
1. Included build number in getVersionInfo method 2. Update the demo page version info to table view 3. Changed let to var to make it consistent across the file 4. Add Spectron test cases for getVersionInfo
This commit is contained in:
parent
ff803e3a24
commit
191ca0c05e
@ -1,5 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
table, th, td {
|
||||
padding: 5px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Symphony Electron API Demo</h1>
|
||||
@ -75,7 +85,21 @@
|
||||
<p>Get Version Info:</p>
|
||||
<button id='get-version'>get version info</button>
|
||||
<br>
|
||||
Version Info:<span id='info'></span>
|
||||
Version Info:
|
||||
<table >
|
||||
<tr>
|
||||
<th>API Version</th>
|
||||
<th>Container Identifier</th>
|
||||
<th>Container Version</th>
|
||||
<th>Build Number</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="api-version"></td>
|
||||
<td id="container-identifier"></td>
|
||||
<td id="container-ver"></td>
|
||||
<td id="build-number"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
<script>
|
||||
var openConfigWin = document.getElementById('open-config-win');
|
||||
@ -219,14 +243,19 @@
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
var getSources = document.getElementById('get-version');
|
||||
getSources.addEventListener('click', function() {
|
||||
var getVersionInfo = document.getElementById('get-version');
|
||||
getVersionInfo.addEventListener('click', function() {
|
||||
ssf.getVersionInfo().then(function(verInfo) {
|
||||
var verEl = document.getElementById('info');
|
||||
verEl.innerText = '\napi ver=' + verInfo.apiVer +
|
||||
'\ncontainer identifier=' + verInfo.containerIdentifier +
|
||||
'\ncontainer ver=' + verInfo.containerVer
|
||||
})
|
||||
let apiVersionInfo = document.getElementById('api-version');
|
||||
let containerIdentifier = document.getElementById('container-identifier');
|
||||
let version = document.getElementById('container-ver');
|
||||
let buildNumber = document.getElementById('build-number');
|
||||
|
||||
apiVersionInfo.innerText = verInfo.apiVer;
|
||||
containerIdentifier.innerText = verInfo.containerIdentifier;
|
||||
version.innerText = verInfo.containerVer;
|
||||
buildNumber.innerText = verInfo.buildNumber;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -21,6 +21,7 @@ const getMediaSources = require('../desktopCapturer/getSources');
|
||||
const getMediaSource = require('../desktopCapturer/getSource');
|
||||
const { TitleBar, updateContentHeight } = require('../windowsTitlebar');
|
||||
const titleBar = new TitleBar();
|
||||
const { buildNumber } = require('../../package.json');
|
||||
|
||||
require('../downloadManager');
|
||||
|
||||
@ -90,6 +91,7 @@ function createAPI() {
|
||||
const verInfo = {
|
||||
containerIdentifier: appName,
|
||||
containerVer: appVer,
|
||||
buildNumber: buildNumber,
|
||||
apiVer: '1.0.0'
|
||||
};
|
||||
resolve(verInfo);
|
||||
|
@ -82,6 +82,7 @@
|
||||
"url": "https://support.symphony.com"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bluebird": "3.5.1",
|
||||
"browserify": "14.5.0",
|
||||
"cross-env": "3.2.4",
|
||||
"electron": "1.8.3",
|
||||
|
71
tests/spectron/getVersionInfo.spectron.js
Normal file
71
tests/spectron/getVersionInfo.spectron.js
Normal file
@ -0,0 +1,71 @@
|
||||
const Application = require('./spectronSetup');
|
||||
const path = require('path');
|
||||
const { buildNumber } = require('../../package');
|
||||
const bluebird = require('bluebird');
|
||||
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for getVersionInfo API', () => {
|
||||
|
||||
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
|
||||
|
||||
beforeAll((done) => {
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
||||
done();
|
||||
}).catch((err) => {
|
||||
console.error(`Unable to start application error: ${err}`);
|
||||
expect(err).toBeNull();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
afterAll((done) => {
|
||||
if (app && app.isRunning()) {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
app.stop().then(() => {
|
||||
done();
|
||||
}).catch((err) => {
|
||||
done();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it('should launch the app', (done) => {
|
||||
return app.client.waitUntilWindowLoaded().then(() => {
|
||||
return app.client.getWindowCount().then((count) => {
|
||||
expect(count === 1).toBeTruthy();
|
||||
done();
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
it('should load demo html page', () => {
|
||||
return app.client.url('file:///' + path.join(__dirname, '..', '..', 'demo/index.html'));
|
||||
});
|
||||
|
||||
it('should verify if the version numbers are correct', function (done) {
|
||||
app.client.waitForExist('#get-version', 2000);
|
||||
app.client.click('#get-version');
|
||||
|
||||
bluebird.all([
|
||||
'#api-version',
|
||||
'#container-identifier',
|
||||
'#container-ver',
|
||||
'#build-number'
|
||||
]).mapSeries((string) => {
|
||||
return app.client.getText(string)
|
||||
}).then((values) => {
|
||||
expect(values[ 0 ]).toBe('1.0.0');
|
||||
expect(values[ 1 ]).toBe('Electron');
|
||||
expect(values[ 2 ]).toBe('1.8.3');
|
||||
expect(values[ 3 ]).toBe(buildNumber);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user