@@ -579,7 +579,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
579579 async openDimensionEditor ( dimension : string , layerIndex = 0 , dimensionIndex = 0 ) {
580580 await retry . try ( async ( ) => {
581581 const dimensionEditor = (
582- await testSubjects . findAll ( `lns-layerPanel-${ layerIndex } > ${ dimension } ` )
582+ await testSubjects . findAll ( `lns-layerPanel-${ layerIndex } > ${ dimension } ` , 1000 )
583583 ) [ dimensionIndex ] ;
584584 await dimensionEditor . click ( ) ;
585585 } ) ;
@@ -591,7 +591,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
591591 async performLayerAction ( testSubject : string , layerIndex = 0 ) {
592592 await retry . try ( async ( ) => {
593593 // Hover over the tab to make the layer actions button visible
594- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
594+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
595595 if ( tabs [ layerIndex ] ) {
596596 await tabs [ layerIndex ] . moveMouseTo ( ) ;
597597 }
@@ -1120,12 +1120,13 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
11201120 seriesType = 'bar'
11211121 ) {
11221122 await testSubjects . click ( 'lnsLayerAddButton' ) ;
1123- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1123+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
11241124 const layerCount = tabs . length ;
11251125
11261126 await retry . waitFor ( 'check for layer type support' , async ( ) => {
11271127 const fasterChecks = await Promise . all ( [
1128- ( await find . allByCssSelector ( `[data-test-subj^="lns-layerPanel-"]` ) ) . length > layerCount ,
1128+ ( await find . allByCssSelector ( `[data-test-subj^="lns-layerPanel-"]` , 1000 ) ) . length >
1129+ layerCount ,
11291130 testSubjects . exists ( `lnsLayerAddButton-${ layerType } ` ) ,
11301131 ] ) ;
11311132 return fasterChecks . filter ( Boolean ) . length > 0 ;
@@ -1152,7 +1153,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
11521153 async duplicateLayer ( index : number = 0 ) {
11531154 await retry . try ( async ( ) => {
11541155 // Hover over the tab to make the layer actions button visible
1155- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1156+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
11561157 if ( tabs [ index ] ) {
11571158 await tabs [ index ] . moveMouseTo ( ) ;
11581159 }
@@ -1419,7 +1420,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
14191420
14201421 async openLayerContextMenu ( index : number = 0 ) {
14211422 // Hover over the tab to make the layer actions button visible
1422- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1423+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
14231424 if ( tabs [ index ] ) {
14241425 await tabs [ index ] . moveMouseTo ( ) ;
14251426 }
@@ -1675,7 +1676,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
16751676 async removeLayer ( index : number = 0 ) {
16761677 await retry . try ( async ( ) => {
16771678 // Hover over the tab to make the layer actions button visible
1678- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1679+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
16791680 if ( tabs [ index ] ) {
16801681 await tabs [ index ] . moveMouseTo ( ) ;
16811682 }
@@ -1691,25 +1692,25 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
16911692 } ,
16921693
16931694 async ensureLayerTabIsActive ( index : number = 0 ) {
1694- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1695+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
16951696 if ( tabs [ index ] ) {
16961697 await tabs [ index ] . click ( ) ; // Click to make it active
16971698 // Wait for the layer panel to render
16981699 await retry . waitFor ( 'layer panel to be visible' , async ( ) => {
1699- return await testSubjects . exists ( `lns-layerPanel-${ index } ` ) ;
1700+ return await testSubjects . exists ( `lns-layerPanel-${ index } ` , { timeout : 1000 } ) ;
17001701 } ) ;
17011702 }
17021703 } ,
17031704
17041705 async ensureLayerTabWithNameIsActive ( name : string ) {
1705- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1706+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
17061707 for ( let i = 0 ; i < tabs . length ; i ++ ) {
17071708 const tabText = await tabs [ i ] . getVisibleText ( ) ;
17081709 if ( tabText === name ) {
17091710 await tabs [ i ] . click ( ) ; // Click to make it active
17101711 // Wait for the layer panel to render
17111712 await retry . waitFor ( 'layer panel to be visible' , async ( ) => {
1712- return await testSubjects . exists ( `lns-layerPanel-${ i } ` ) ;
1713+ return await testSubjects . exists ( `lns-layerPanel-${ i } ` , { timeout : 1000 } ) ;
17131714 } ) ;
17141715 return ;
17151716 }
@@ -1719,10 +1720,10 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
17191720
17201721 async assertLayerCount ( expectedCount : number ) {
17211722 // Inside the tab content there should be one panel
1722- const layerPanels = await find . allByCssSelector ( '[data-test-subj^="lns-layerPanel-"]' ) ;
1723+ const layerPanels = await find . allByCssSelector ( '[data-test-subj^="lns-layerPanel-"]' , 1000 ) ;
17231724 expect ( layerPanels . length ) . to . eql ( 1 ) ;
17241725
1725- const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' ) ;
1726+ const tabs = await find . allByCssSelector ( '[data-test-subj^="unifiedTabs_tab_"]' , 1000 ) ;
17261727
17271728 // tabs will hidden if there's just one layer
17281729 if ( expectedCount <= 1 ) {
0 commit comments