Merge pull request #3189 from balena-io/windows-docker-spectron

spectron: Make tests pass on Windows Docker containers
This commit is contained in:
bulldozer-balena[bot] 2020-06-01 10:37:36 +00:00 committed by GitHub
commit 5b509d147f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,14 @@ describe('Spectron', function () {
describe('Browser Window', function () {
it('should open a browser window', async function () {
return expect(await app.browserWindow.isVisible()).to.be.true;
// 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.isFocused()).to.be.true;
});
it('should set a proper title', async function () {