Skip to content

Commit

Permalink
Wait for kbn loading message to close
Browse files Browse the repository at this point in the history
  • Loading branch information
pheyos committed Feb 13, 2020
1 parent a7a9518 commit 4daf85e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
}
});

await this.waitForKbnLoadingMessageToClose();
await this.closeWelcomeScreenIfNeeded();
}

Expand Down Expand Up @@ -505,10 +506,19 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
});
}

async waitForKbnLoadingMessageToClose() {
log.debug('Waiting for Kibana loading message to close');
await retry.tryForTime(30 * 1000, async () => {
if (await testSubjects.exists('kbnLoadingMessage')) {
throw new Error('loading message still open');
}
});
}

async closeWelcomeScreenIfNeeded() {
if (await testSubjects.exists('skipWelcomeScreen')) {
await testSubjects.click('skipWelcomeScreen');
await testSubjects.missingOrFail('skipWelcomeScreen', { timeout: 5000 });
await testSubjects.missingOrFail('skipWelcomeScreen');
}
}
}
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/page_objects/security_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function SecurityPageProvider({ getService, getPageObjects }) {
await testSubjects.setValue('loginPassword', password);
await testSubjects.click('loginSubmit');

await PageObjects.common.waitForKbnLoadingMessageToClose();
await PageObjects.common.closeWelcomeScreenIfNeeded();

// wait for either space selector, kibanaChrome or loginErrorMessage
Expand Down

0 comments on commit 4daf85e

Please sign in to comment.