SymphonyElectron/tests/spectron/close.spectron.js

41 lines
1015 B
JavaScript
Raw Normal View History

const Application = require('./spectronSetup');
let app = new Application({});
2017-07-06 08:16:37 -05:00
describe('Tests for Close', () => {
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
2017-07-06 08:16:37 -05:00
beforeAll((done) => {
return app.startApplication().then((startedApp) => {
app = startedApp;
done();
}).catch((err) => {
done.fail(new Error(`Unable to start application error: ${err}`));
2017-07-06 08:16:37 -05:00
});
});
afterAll((done) => {
if (app && app.isRunning()) {
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
app.stop().then(() => {
done();
}).catch((err) => {
done();
});
} else {
done();
}
});
it('should close the app', () => {
return app.stop();
});
it('should check whether the app is running', () => {
expect(app.isRunning()).toBe(false);
});
});