Skip to content

Commit cbca869

Browse files
authored
retry tab change (#125260)
1 parent ec7f2f3 commit cbca869

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

test/functional/page_objects/visual_builder_page.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,19 +450,27 @@ export class VisualBuilderPageObject extends FtrService {
450450
return await tableView.getVisibleText();
451451
}
452452

453+
private async switchTab(visType: string, tab: string) {
454+
const testSubj = `${visType}Editor${tab}Btn`;
455+
await this.retry.try(async () => {
456+
await this.testSubjects.click(testSubj);
457+
await this.header.waitUntilLoadingHasFinished();
458+
if (!(await (await this.testSubjects.find(testSubj)).elementHasClass('euiTab-isSelected'))) {
459+
throw new Error('tab not active');
460+
}
461+
});
462+
}
463+
453464
public async clickPanelOptions(tabName: string) {
454-
await this.testSubjects.click(`${tabName}EditorPanelOptionsBtn`);
455-
await this.header.waitUntilLoadingHasFinished();
465+
await this.switchTab(tabName, 'PanelOptions');
456466
}
457467

458468
public async clickDataTab(tabName: string) {
459-
await this.testSubjects.click(`${tabName}EditorDataBtn`);
460-
await this.header.waitUntilLoadingHasFinished();
469+
await this.switchTab(tabName, 'Data');
461470
}
462471

463472
public async clickAnnotationsTab() {
464-
await this.testSubjects.click('timeSeriesEditorAnnotationsBtn');
465-
await this.header.waitUntilLoadingHasFinished();
473+
await this.switchTab('timeSeries', 'Annotations');
466474
}
467475

468476
public async clickAnnotationsAddDataSourceButton() {

0 commit comments

Comments
 (0)