File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
test/functional/page_objects Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments