mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Discover] Fix management flaky test (#141650)
* [Discover] Tmp commit * [Discover] Update deprecated class * [Discover] Wait for lens page to load
This commit is contained in:
parent
fd16e6b224
commit
e35a7310e5
2 changed files with 18 additions and 12 deletions
|
@ -211,10 +211,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// verify Lens opens a visualization
|
||||
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
|
||||
'@timestamp',
|
||||
'Median of ram_Pain1'
|
||||
);
|
||||
await retry.waitFor('lens visualization', async () => {
|
||||
const elements = await testSubjects.getVisibleTextAll('lns-dimensionTrigger');
|
||||
return elements[0] === '@timestamp' && elements[1] === 'Median of ram_Pain1';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -314,9 +314,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// verify Lens opens a visualization
|
||||
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
|
||||
'Top 5 values of painString'
|
||||
);
|
||||
await retry.waitFor('lens visualization', async () => {
|
||||
const elements = await testSubjects.getVisibleTextAll('lns-dimensionTrigger');
|
||||
return elements[0] === 'Top 5 values of painString';
|
||||
});
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -408,9 +409,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// verify Lens opens a visualization
|
||||
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
|
||||
'Top 5 values of painBool'
|
||||
);
|
||||
await retry.waitFor('lens visualization', async () => {
|
||||
const elements = await testSubjects.getVisibleTextAll('lns-dimensionTrigger');
|
||||
return elements[0] === 'Top 5 values of painBool';
|
||||
});
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -503,7 +505,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// verify Lens opens a visualization
|
||||
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain('painDate');
|
||||
await retry.waitFor('lens visualization', async () => {
|
||||
const elements = await testSubjects.getVisibleTextAll('lns-dimensionTrigger');
|
||||
return elements[0] === 'painDate';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ export class DiscoverPageObject extends FtrService {
|
|||
|
||||
public async clickFieldListItemVisualize(fieldName: string) {
|
||||
const field = await this.testSubjects.find(`field-${fieldName}-showDetails`);
|
||||
const isActive = await field.elementHasClass('dscSidebarItem--active');
|
||||
const isActive = await field.elementHasClass('kbnFieldButton-isActive');
|
||||
|
||||
if (!isActive) {
|
||||
// expand the field to show the "Visualize" button
|
||||
|
@ -494,6 +494,7 @@ export class DiscoverPageObject extends FtrService {
|
|||
}
|
||||
|
||||
await this.testSubjects.click(`fieldVisualize-${fieldName}`);
|
||||
await this.header.waitUntilLoadingHasFinished();
|
||||
}
|
||||
|
||||
public async expectFieldListItemVisualize(field: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue