Description
Interface providing common methods for all the objects on the page - elements, modules and whole page.
Important methods
context.initPage(T extends Page)
- provide any class that extends Page class. Seb will automatically initiate it and cache it. Example:seb.initPage(HomePage.class)
context.initLogic(T extends Logic)
- provide any class that extends Logic class. Seb will automatically initiate it. Example:seb.initLogic(LoginLogic.class)
context.goTo(T extends Page)
- provide any class that extends Page class. Seb will automatically initiate it. Navigate to its URL and cahce it.context.isAt(T extends Page)
- provide any class that extends Page class. Seb will find out if given Page is same/subclass of cached Page.context.findOne()
- Seb will search given context for specified SebElement. Example:homePage.findOne(By.id("username"))
Data holding
Every subclass of SebContext supports data holding. It is particularly useful when you create your test with Cucumber or
any other BDD framework which does not allow sharing variables between different steps out of the box. With this functionality
you can add data to Seb at some step with method .addData(String, Object)
and then retrieve them at other step by calling .getData(String, Class<T>)
.
data will also be casted into specified type.