retry tab change (#125260)

This commit is contained in:
Joe Reuter 2022-02-10 18:59:39 +01:00 committed by GitHub
parent ec7f2f3d8c
commit cbca869e8f
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() {