[6.x] Fixed omission that caused the test to still be flaky. Need to make sure the element is displayed. (#28517) (#28856)

* Made change to cluster overview service to more reliably check if the page has loaded.

* Made change to cluster overview service to more reliably check if the page has loaded.
This commit is contained in:
John Dorlus 2019-01-16 12:46:28 -05:00 committed by GitHub
parent 818ea88e79
commit 5fd3742f5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
import expect from 'expect.js';
export function MonitoringClusterOverviewProvider({ getService }) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');
@ -54,8 +56,15 @@ export function MonitoringClusterOverviewProvider({ getService }) {
return new class ClusterOverview {
async isOnClusterOverview() {
const pageId = await retry.try(() => testSubjects.find(SUBJ_CLUSTER_OVERVIEW));
return pageId !== null;
await retry.try(async () => {
const clusterHeadingElement = await testSubjects.find(SUBJ_CLUSTER_NAME);
expect(await clusterHeadingElement.isDisplayed()).to.be(true);
});
await retry.try(async () => {
const clusterHeading = await testSubjects.find(SUBJ_CLUSTER_NAME);
expect(await clusterHeading.getVisibleText()).not.to.be.empty();
});
return true;
}
getClusterName() {
return testSubjects.getVisibleText(SUBJ_CLUSTER_NAME);