mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-18 16:56:32 +00:00
Disable spectron tests on macOS
Change-type: patch
This commit is contained in:
parent
d0c66b2c48
commit
3be372d49f
@ -15,46 +15,52 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
|
import { platform } from 'os';
|
||||||
import { Application } from 'spectron';
|
import { Application } from 'spectron';
|
||||||
import * as electronPath from 'electron';
|
import * as electronPath from 'electron';
|
||||||
|
|
||||||
describe('Spectron', function () {
|
// TODO: spectron fails to start on the CI with:
|
||||||
// Mainly for CI jobs
|
// Error: Failed to create session.
|
||||||
this.timeout(40000);
|
// unknown error: Chrome failed to start: exited abnormally
|
||||||
|
if (platform() !== 'darwin') {
|
||||||
|
describe('Spectron', function () {
|
||||||
|
// Mainly for CI jobs
|
||||||
|
this.timeout(40000);
|
||||||
|
|
||||||
const app = new Application({
|
const app = new Application({
|
||||||
path: (electronPath as unknown) as string,
|
path: (electronPath as unknown) as string,
|
||||||
args: ['--no-sandbox', '.'],
|
args: ['--no-sandbox', '.'],
|
||||||
});
|
|
||||||
|
|
||||||
before('app:start', async () => {
|
|
||||||
await app.start();
|
|
||||||
});
|
|
||||||
|
|
||||||
after('app:stop', async () => {
|
|
||||||
if (app && app.isRunning()) {
|
|
||||||
await app.stop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Browser Window', () => {
|
|
||||||
it('should open a browser window', async () => {
|
|
||||||
// We can't use `isVisible()` here as it won't work inside
|
|
||||||
// a Windows Docker container, but we can approximate it
|
|
||||||
// with these set of checks:
|
|
||||||
const bounds = await app.browserWindow.getBounds();
|
|
||||||
expect(bounds.height).to.be.above(0);
|
|
||||||
expect(bounds.width).to.be.above(0);
|
|
||||||
expect(await app.browserWindow.isMinimized()).to.be.false;
|
|
||||||
expect(
|
|
||||||
(await app.browserWindow.isVisible()) ||
|
|
||||||
(await app.browserWindow.isFocused()),
|
|
||||||
).to.be.true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set a proper title', async () => {
|
before('app:start', async () => {
|
||||||
// @ts-ignore (SpectronClient.getTitle exists)
|
await app.start();
|
||||||
return expect(await app.client.getTitle()).to.equal('Etcher');
|
});
|
||||||
|
|
||||||
|
after('app:stop', async () => {
|
||||||
|
if (app && app.isRunning()) {
|
||||||
|
await app.stop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Browser Window', () => {
|
||||||
|
it('should open a browser window', async () => {
|
||||||
|
// We can't use `isVisible()` here as it won't work inside
|
||||||
|
// a Windows Docker container, but we can approximate it
|
||||||
|
// with these set of checks:
|
||||||
|
const bounds = await app.browserWindow.getBounds();
|
||||||
|
expect(bounds.height).to.be.above(0);
|
||||||
|
expect(bounds.width).to.be.above(0);
|
||||||
|
expect(await app.browserWindow.isMinimized()).to.be.false;
|
||||||
|
expect(
|
||||||
|
(await app.browserWindow.isVisible()) ||
|
||||||
|
(await app.browserWindow.isFocused()),
|
||||||
|
).to.be.true;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set a proper title', async () => {
|
||||||
|
// @ts-ignore (SpectronClient.getTitle exists)
|
||||||
|
return expect(await app.client.getTitle()).to.equal('Etcher');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user