retry tab change (#125260) (#125287)

(cherry picked from commit cbca869e8f)

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
This commit is contained in:
Kibana Machine 2022-02-10 14:41:25 -05:00 committed by GitHub
parent 5b0b35e789
commit 5d1e96aca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -450,19 +450,27 @@ export class VisualBuilderPageObject extends FtrService {
return await tableView.getVisibleText();
}
private async switchTab(visType: string, tab: string) {
const testSubj = `${visType}Editor${tab}Btn`;
await this.retry.try(async () => {
await this.testSubjects.click(testSubj);
await this.header.waitUntilLoadingHasFinished();
if (!(await (await this.testSubjects.find(testSubj)).elementHasClass('euiTab-isSelected'))) {
throw new Error('tab not active');
}
});
}
public async clickPanelOptions(tabName: string) {
await this.testSubjects.click(`${tabName}EditorPanelOptionsBtn`);
await this.header.waitUntilLoadingHasFinished();
await this.switchTab(tabName, 'PanelOptions');
}
public async clickDataTab(tabName: string) {
await this.testSubjects.click(`${tabName}EditorDataBtn`);
await this.header.waitUntilLoadingHasFinished();
await this.switchTab(tabName, 'Data');
}
public async clickAnnotationsTab() {
await this.testSubjects.click('timeSeriesEditorAnnotationsBtn');
await this.header.waitUntilLoadingHasFinished();
await this.switchTab('timeSeries', 'Annotations');
}
public async clickAnnotationsAddDataSourceButton() {