Skip to content

Commit 3c47c7b

Browse files
committed
make sure uploader windows close on windows
1 parent 0cc20df commit 3c47c7b

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

test/spectron/src/Base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ class Base {
66
windowCount() {
77
return this.app.client.waitUntilWindowLoaded().getWindowCount();
88
}
9+
10+
focusUploader() {
11+
return this.app.browserWindow.focus();
12+
}
913
}
1014

1115
export default new Base();

test/spectron/test/functionality/login.functionality.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe('Login', () => {
2222
});
2323

2424
test('should login', async () => {
25+
await Base.focusUploader();
2526
await LoginScreen.usernameInput.setValue(process.env.SPECTRON_USER_EMAIL);
2627
await LoginScreen.usernameInput.getValue()
2728
.should.eventually.equal(process.env.SPECTRON_USER_EMAIL);

test/spectron/test/ui/login.elements.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ describe('UI Test', () => {
2121
});
2222

2323
test('should have all UI elements', async () => {
24-
LoginScreen.signUpLink.isVisible()
24+
await Base.focusUploader();
25+
await LoginScreen.signUpLink.isVisible()
2526
.should.eventually.be.true;
2627
await LoginScreen.tidepoolLogo.isVisible()
2728
.should.eventually.be.true;

test/spectron/utilities.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ export async function startApp() {
2323
UploadScreen.setApp(app);
2424
LoginScreen.setApp(app);
2525
Base.setApp(app);
26-
return app.start().then(() => {
27-
app.browserWindow.focus();
28-
app.browserWindow.setAlwaysOnTop(true);
29-
});
26+
return app.start();
3027
}
3128

3229
export async function stopApp(app) {
3330
if (app && app.isRunning()) {
34-
await app.stop();
31+
return app.stop();
3532
}
3633
}

0 commit comments

Comments
 (0)