[Flaky test] Application Usage: Wait for chrome to visible (#109405)

This commit is contained in:
Alejandro Fernández Haro 2021-08-23 10:58:34 +01:00 committed by GitHub
parent 92c6787af1
commit 75cdeae490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
it('keys in the schema match the registered application IDs', async () => {
await common.navigateToApp('home'); // Navigate to Home to make sure all the appIds are loaded
await common.navigateToApp('home'); // Navigate to Home
await common.isChromeVisible(); // Make sure the page is fully loaded
const appIds = await browser.execute(() => window.__applicationIds__);
if (!appIds || !Array.isArray(appIds)) {
throw new Error(
'Failed to retrieve all the existing applications in Kibana. Did it fail to boot or to navigate to home?'
);
}
try {
expect(Object.keys(applicationUsageSchema).sort()).to.eql(appIds.sort());
} catch (err) {