import * as playwright from "playwright" ; /**
 * Main class for testing in Portals
 */ export class PortalUiTest { private _browser : playwright . Browser ; private _context : playwright . BrowserContext ; private _page : playwright . Page ; private _portalUrl : string ; get browser ( ) { return this . _browser ; } get context ( ) { return this . _context ; } get page ( ) { return this . _page ; } param { string } browser param { playwright . launchOptions } launchOptions returns { Array < playwright . Browser , playwright . BrowserContext , playwright . Page } remarks launch = async ( browser = "chromium" , launchOptions ? , contextOptions ? ) : Promise < [ playwright . Browser , playwright . BrowserContext , playwright . Page ] > => { this . _browser = await playwright [ browser ] . launch ( launchOptions ) ; this . _context = await this . _browser . newContext ( { viewport : null , ... contextOptions } ) ; this . _page = await this . _context . newPage ( ) ; return [ this . _browser , this . _context , this . _page ] ; } ; param { string } url open = async ( url ) => { this . _portalUrl = url ; await Promise . all ( [ this . page . goto ( `${ this . _portalUrl }` ) , this . page . waitForNavigation ( { waitUntil : "networkidle" } ) ] ) ; } ; param { string } user param { string } password login = async ( userName , password ) => { await this . page . goto ( `${ this . _portalUrl }/signIn` ) ; await this . page . waitForNavigation ( { waitUntil : "networkidle" } ) ; const userNameField = await this . page . waitForSelector ( "#Username" ) ; await userNameField . type ( userName ) ; const passwordField = await this . page . waitForSelector ( "#Password" ) ; await passwordField . type ( password ) ; await this . page . keyboard . press ( "enter" ) ; await this . page . waitForNavigation ( { waitUntil : "networkidle" } ) ; } ; /**
     * Shut down
     */ close = async ( ) => { await this . browser . close ( ) ; } ; }