class Page { get url ( ) : string { return browser . getUrl ( ) ; } open ( url = "" ) { browser . url ( "/" + url ) ; } getElement ( selector , parent ? ) { return parent ? parent . $ ( selector ) : $ ( selector ) ; } getElements ( selector , parent ? ) { return parent ? parent . $$ ( selector ) : $$ ( selector ) ; } existing ( selector ) { return this . getElement ( selector ) . isExisting ( ) ; } waitForElement ( selector , parent ? ) { const element = this . getElement ( selector , parent ) ; element . waitForDisplayed ( ) ; return element ; } waitForElements ( selector , parent ? ) { this . getElement ( selector , parent ) . waitForDisplayed ( ) ; return this . getElements ( selector , parent ) ; } getWidget ( widgetName ) { return this . waitForElement ( `.mx-name-${ widgetName }` ) ; } getWidgets ( widgetName ) { return this . waitForElements ( `.mx-name-${ widgetName }` ) ; } headerElement ( pageTitle = "pageTitle1" ) { const title = this . getWidget ( pageTitle ) ; title . waitForDisplayed ( ) ; return title ; } header ( pageTitle = "pageTitle1" ) { return this . headerElement ( pageTitle ) . getText ( ) ; } get modalDialog ( ) : WebdriverIO . Element { return $ ( ".modal-dialog" ) ; } get modalDialogHeader ( ) : WebdriverIO . Element { return this . modalDialog . $ ( "#mxui_widget_Window_0_caption" ) ; } } export default new Page ( ) ;