abstractBrowsingSession <Page_Type>
Index
Constructors
constructor
Type parameters
- Page_Type: Page<any>
Returns BrowsingSession<Page_Type>
Methods
closePagesOtherThan
Parameters
pageOfInterest: Page_Type
Returns Promise<void>
publicabstractbrowserCapabilities
Returns basic meta-data about the browser associated with this browsing session.
Returns Promise<BrowserCapabilities>
currentPage
Returns a Page representing the currently active top-level browsing context.
Returns Promise<Page_Type>
register
Registers specified pages to be managed by this BrowsingSession.
Parameters
rest...pages: Page_Type[]
Returns void
deregister
Informs this BrowsingSession that it should no longer manage pages identified by the given
pageIds
.Parameters
rest...pageIds: CorrelationId[]
Returns void
allPages
Returns a pages representing all the available top-level browsing context, e.g. all the open browser tabs.
Returns Promise<Page_Type[]>
registeredPageIds
Returns the ids of any pages this BrowsingSession is aware of.
Returns CorrelationId[]
changeCurrentPageTo
Informs the BrowsingSession that the âcurrent pageâ has changed to
page
.Please note that different Web integration tools have a different definition of what a âcurrent pageâ is. For example, Selenium or WebdriverIO use a single âfocusedâ window that a developer needs to explicitly âswitch toâ in their tests in order to interact with it. This is similar to how a regular user would interact with Web pages; switching from one tab to another, but not interacting with more than one window/tab simultaneously.
Playwright and Puppeteer, on the other hand, donât have a concept of the âcurrentâ page at all, since they allow the developer to interact with multiple open tabs/windows at the same time.
Web integration-specific implementations of this class should override this method to define how the concept of the âcurrent pageâ should be interpreted by Serenity/JS.
Parameters
page: Page_Type
Returns Promise<void>
closeAllPages
Closes all the pages available in this browsing context
Returns Promise<void>
Represents the pages open in the current browsing context.
Youâll need to use this class directly only if youâre planning to integrate Serenity/JS with a new Web integration tool.