2018-03-12 06:35:25 -05:00
|
|
|
const Application = require('./spectronSetup');
|
2018-08-28 21:24:12 -05:00
|
|
|
const WebActions = require('./spectronWebActions');
|
|
|
|
const WindowsActions = require('./spectronWindowsActions');
|
|
|
|
const constants = require('./spectronConstants.js');
|
2018-03-12 06:35:25 -05:00
|
|
|
const path = require('path');
|
2018-08-28 21:24:12 -05:00
|
|
|
const ui = require('./spectronInterfaces.js');
|
2018-09-19 00:36:40 -05:00
|
|
|
let TIMEOUT_TEST_SUITE = parseInt(constants.TIMEOUT_TEST_SUITE, 10);
|
2018-08-28 21:24:12 -05:00
|
|
|
let app, windowsActions;
|
2018-03-12 06:35:25 -05:00
|
|
|
|
|
|
|
describe('Tests for getVersionInfo API', () => {
|
2018-09-19 00:36:40 -05:00
|
|
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = TIMEOUT_TEST_SUITE;
|
2018-03-12 06:35:25 -05:00
|
|
|
|
2018-08-28 21:24:12 -05:00
|
|
|
beforeAll(async (done) => {
|
|
|
|
try {
|
|
|
|
app = await new Application({}).startApplication({ testedHost: constants.TESTED_HOST, alwaysOnTop: true });
|
|
|
|
webActions = await new WebActions(app);
|
|
|
|
windowsActions = await new WindowsActions(app);
|
2018-03-12 06:35:25 -05:00
|
|
|
done();
|
2018-08-28 21:24:12 -05:00
|
|
|
} catch (err) {
|
|
|
|
await windowsActions.stopApp();
|
2018-03-13 05:20:32 -05:00
|
|
|
done.fail(new Error(`Unable to start application error: ${err}`));
|
2018-08-28 21:24:12 -05:00
|
|
|
};
|
2018-03-12 06:35:25 -05:00
|
|
|
});
|
|
|
|
|
2018-08-28 21:24:12 -05:00
|
|
|
afterAll(async (done) => {
|
|
|
|
try {
|
|
|
|
await windowsActions.stopApp();
|
|
|
|
done();
|
|
|
|
} catch (err) {
|
|
|
|
done.fail(new Error(`Failed at post-condition: ${err}`));
|
|
|
|
};
|
2018-03-12 06:35:25 -05:00
|
|
|
});
|
|
|
|
|
2018-08-28 21:24:12 -05:00
|
|
|
it('Should verify if the version numbers are correct', async (done) => {
|
|
|
|
try {
|
|
|
|
if (await windowsActions.isAppRunning()) {
|
|
|
|
await webActions.navigateURL('file:///' + path.join(__dirname, '..', '..', 'demo/index.html'));
|
|
|
|
await windowsActions.bringToFront("Symphony");
|
|
|
|
await webActions.clickIfElementVisible(ui.GET_VERSION_BUTTON);
|
|
|
|
await webActions.verifyVersionInfo();
|
|
|
|
}
|
2018-03-12 06:35:25 -05:00
|
|
|
done();
|
2018-08-28 21:24:12 -05:00
|
|
|
} catch (err) {
|
|
|
|
done.fail(new Error(`Fail to verify the version numbers: ${err}`));
|
|
|
|
};
|
2018-03-12 06:35:25 -05:00
|
|
|
});
|
2018-08-28 21:24:12 -05:00
|
|
|
});
|