forked from finos/SymphonyElectron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectronProductionLogging.spectron.js
52 lines (46 loc) · 1.74 KB
/
electronProductionLogging.spectron.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const Application = require('./spectronSetup');
const WindowsActions = require('./spectronWindowsActions');
const { isMac } = require('../../js/utils/misc.js');
const Utils = require('./spectronUtils');
let app;
let windowActions;
!isMac ? describe('Tests for Electron Production Logging', () => {
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
beforeAll(async (done) => {
try {
app = await new Application({}).startApplication();
windowActions = await new WindowsActions(app);
await windowActions.deleteAllLogFiles();
done();
} catch (err) {
done.fail(new Error(`Unable to start application error: ${err}`));
};
});
afterAll(async (done) => {
try {
if (app && app.isRunning()) {
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
await app.stop();
done();
}
} catch (err) {
done.fail(new Error(`Failed at post-condition: ${err}`));
};
});
/**
* Verify the production logs exists when clicking on "Show logs in Explorer"
* TC-ID: 3935260
* Cover scenarios in AVT-1029
*/
it('Verify the production logs exists when clicking on Show logs in Explorer', async (done) => {
try {
await windowActions.openMenu(["Help", "Troubleshooting", "Show Logs in Explorer"]);
Utils.sleep(2000) //sleep for creating log
await windowActions.verifyLogExported();
done();
} catch (err) {
done.fail(new Error(`Fail to export production logs with error: ${err}`));
};
});
}) : describe.skip();