@@ -36,24 +36,22 @@ export class DashboardPageObject extends FtrService {
3636 private readonly renderable = this . ctx . getService ( 'renderable' ) ;
3737 private readonly listingTable = this . ctx . getService ( 'listingTable' ) ;
3838 private readonly elasticChart = this . ctx . getService ( 'elasticChart' ) ;
39- private readonly PageObjects = this . ctx . getPageObjects ( [
40- 'common' ,
41- 'header' ,
42- 'visualize' ,
43- 'discover' ,
44- ] ) ;
39+ private readonly common = this . ctx . getPageObject ( 'common' ) ;
40+ private readonly header = this . ctx . getPageObject ( 'header' ) ;
41+ private readonly visualize = this . ctx . getPageObject ( 'visualize' ) ;
42+ private readonly discover = this . ctx . getPageObject ( 'discover' ) ;
4543
4644 async initTests ( { kibanaIndex = 'dashboard/legacy' , defaultIndex = 'logstash-*' } = { } ) {
4745 this . log . debug ( 'load kibana index with visualizations and log data' ) ;
4846 await this . esArchiver . load ( kibanaIndex ) ;
4947 await this . kibanaServer . uiSettings . replace ( { defaultIndex } ) ;
50- await this . PageObjects . common . navigateToApp ( 'dashboard' ) ;
48+ await this . common . navigateToApp ( 'dashboard' ) ;
5149 }
5250
5351 public async preserveCrossAppState ( ) {
5452 const url = await this . browser . getCurrentUrl ( ) ;
5553 await this . browser . get ( url , false ) ;
56- await this . PageObjects . header . waitUntilLoadingHasFinished ( ) ;
54+ await this . header . waitUntilLoadingHasFinished ( ) ;
5755 }
5856
5957 public async clickFullScreenMode ( ) {
@@ -138,9 +136,9 @@ export class DashboardPageObject extends FtrService {
138136 await this . testSubjects . existOrFail ( `discard-unsaved-${ title . split ( ' ' ) . join ( '-' ) } ` ) ;
139137 await this . testSubjects . click ( `discard-unsaved-${ title . split ( ' ' ) . join ( '-' ) } ` ) ;
140138 if ( confirmDiscard ) {
141- await this . PageObjects . common . clickConfirmOnModal ( ) ;
139+ await this . common . clickConfirmOnModal ( ) ;
142140 } else {
143- await this . PageObjects . common . clickCancelOnModal ( ) ;
141+ await this . common . clickCancelOnModal ( ) ;
144142 }
145143 }
146144
@@ -227,7 +225,7 @@ export class DashboardPageObject extends FtrService {
227225
228226 */
229227 public async expectToolbarPaginationDisplayed ( ) {
230- const isLegacyDefault = this . PageObjects . discover . useLegacyTable ( ) ;
228+ const isLegacyDefault = this . discover . useLegacyTable ( ) ;
231229 if ( isLegacyDefault ) {
232230 const subjects = [ 'btnPrevPage' , 'btnNextPage' , 'toolBarPagerText' ] ;
233231 await Promise . all ( subjects . map ( async ( subj ) => await this . testSubjects . existOrFail ( subj ) ) ) ;
@@ -334,9 +332,9 @@ export class DashboardPageObject extends FtrService {
334332
335333 // avoids any 'Object with id x not found' errors when switching tests.
336334 public async clearSavedObjectsFromAppLinks ( ) {
337- await this . PageObjects . header . clickVisualize ( ) ;
338- await this . PageObjects . visualize . gotoLandingPage ( ) ;
339- await this . PageObjects . header . clickDashboard ( ) ;
335+ await this . header . clickVisualize ( ) ;
336+ await this . visualize . gotoLandingPage ( ) ;
337+ await this . header . clickDashboard ( ) ;
340338 await this . gotoDashboardLandingPage ( ) ;
341339 }
342340
@@ -402,15 +400,15 @@ export class DashboardPageObject extends FtrService {
402400 // Confirm that the Dashboard has actually been saved
403401 await this . testSubjects . existOrFail ( 'saveDashboardSuccess' ) ;
404402 } ) ;
405- const message = await this . PageObjects . common . closeToast ( ) ;
406- await this . PageObjects . header . waitUntilLoadingHasFinished ( ) ;
407- await this . PageObjects . common . waitForSaveModalToClose ( ) ;
403+ const message = await this . common . closeToast ( ) ;
404+ await this . header . waitUntilLoadingHasFinished ( ) ;
405+ await this . common . waitForSaveModalToClose ( ) ;
408406
409407 const isInViewMode = await this . testSubjects . exists ( 'dashboardEditMode' ) ;
410408 if ( saveOptions . exitFromEditMode && ! isInViewMode ) {
411409 await this . clickCancelOutOfEditMode ( ) ;
412410 }
413- await this . PageObjects . header . waitUntilLoadingHasFinished ( ) ;
411+ await this . header . waitUntilLoadingHasFinished ( ) ;
414412
415413 return message ;
416414 }
@@ -481,7 +479,7 @@ export class DashboardPageObject extends FtrService {
481479 this . log . debug ( 'entering new title' ) ;
482480 await this . testSubjects . setValue ( 'savedObjectTitle' , dashboardTitle ) ;
483481
484- await this . PageObjects . common . pressEnterKey ( ) ;
482+ await this . common . pressEnterKey ( ) ;
485483 await this . testSubjects . waitForDeleted ( modalDialog ) ;
486484 }
487485
@@ -495,7 +493,7 @@ export class DashboardPageObject extends FtrService {
495493 await this . listingTable . searchForItemWithName ( dashboardName ) ;
496494 await this . retry . try ( async ( ) => {
497495 await this . listingTable . clickItemLink ( 'dashboard' , dashboardName ) ;
498- await this . PageObjects . header . waitUntilLoadingHasFinished ( ) ;
496+ await this . header . waitUntilLoadingHasFinished ( ) ;
499497 // check Dashboard landing page is not present
500498 await this . testSubjects . missingOrFail ( 'dashboardLandingPage' , { timeout : 10000 } ) ;
501499 } ) ;
0 commit comments