Skip to content

Commit 5e4f75c

Browse files
committed
wait for login button to load before clicking on it
1 parent ac5aa2b commit 5e4f75c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

test/spectron/src/LoginScreen.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class LoginScreen {
5454
get driverDismiss() {
5555
return this.app.client.$('button[class*="btnSecondary"]');
5656
}
57+
58+
waitUntilLoginButtonLoaded() {
59+
return this.app.client.waitUntilTextExists('button[type="submit"]', 'Log in', 10000);
60+
}
5761
}
5862

5963
export default new LoginScreen();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('Login', () => {
2828
await LoginScreen.passwordInput.setValue(process.env.SPECTRON_USER_PASSWORD);
2929
await LoginScreen.passwordInput.getValue()
3030
.should.eventually.equal(process.env.SPECTRON_USER_PASSWORD);
31+
await LoginScreen.waitUntilLoginButtonLoaded();
3132
await LoginScreen.loginButton.click();
3233
await UploadScreen.waitUntilDeviceScreenLoaded();
3334
await UploadScreen.uploadDeviceList.isVisible()

0 commit comments

Comments
 (0)