2015-12-10 23:52:20 +08:00
|
|
|
export function assertBasicWindow() {
|
2015-12-13 06:11:22 +08:00
|
|
|
it('has main window visible', (done)=> {
|
2015-12-10 23:52:20 +08:00
|
|
|
this.app.client.isWindowVisible()
|
2015-12-13 06:11:22 +08:00
|
|
|
.then((result)=> expect(result).toBe(true))
|
|
|
|
.finally(done);
|
2015-12-10 23:52:20 +08:00
|
|
|
});
|
|
|
|
|
2015-12-13 06:11:22 +08:00
|
|
|
it('has main window focused', (done)=> {
|
2015-12-10 23:52:20 +08:00
|
|
|
this.app.client.isWindowFocused()
|
2015-12-13 06:11:22 +08:00
|
|
|
.then((result)=> expect(result).toBe(true))
|
|
|
|
.finally(done);
|
2015-12-10 23:52:20 +08:00
|
|
|
});
|
|
|
|
|
2015-12-13 06:11:22 +08:00
|
|
|
it('is not minimized', (done)=> {
|
2015-12-10 23:52:20 +08:00
|
|
|
this.app.client.isWindowMinimized()
|
2015-12-13 06:11:22 +08:00
|
|
|
.then((result)=> expect(result).toBe(false))
|
|
|
|
.finally(done);
|
2015-12-10 23:52:20 +08:00
|
|
|
});
|
|
|
|
|
2015-12-13 06:11:22 +08:00
|
|
|
it('doesn not have the dev tools open', (done)=> {
|
2015-12-10 23:52:20 +08:00
|
|
|
this.app.client.isWindowDevToolsOpened()
|
2015-12-13 06:11:22 +08:00
|
|
|
.then((result)=> expect(result).toBe(false))
|
|
|
|
.finally(done);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function assertNoErrorsInLogs(client) {
|
|
|
|
return client.log('browser').then((log)=> {
|
|
|
|
expect(
|
|
|
|
log.value.filter((logEntry)=> logEntry.level === 'SEVERE').length
|
|
|
|
).toEqual(0);
|
|
|
|
return Promise.resolve();
|
2015-12-10 23:52:20 +08:00
|
|
|
});
|
|
|
|
}
|