[
https://issues.jboss.org/browse/ARQGRA-189?page=com.atlassian.jira.plugin...
]
Lukáš Fryč updated ARQGRA-189:
------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
Thanks for a pull request, Juraj!
Support @Page in Page objects
-----------------------------
Key: ARQGRA-189
URL:
https://issues.jboss.org/browse/ARQGRA-189
Project: Arquillian Graphene
Issue Type: Feature Request
Affects Versions: 2.Future
Reporter: Anthony O.
Assignee: Juraj Húska
Fix For: 2.0.0.Alpha3
Here is my use case : I've got a home page which when I click on a link in the menu
will redirect me to that feature page.
I want to code fluently, so that my test would like this :
{code}
public class FeatureTest extends Arquillian {
@Drone
private WebDriver driver;
@Page
private HomePage homePage;
@Test
public testClickMenuRedirect() {
FeaturePage featurePage = homePage.open(driver)
.openFeaturePageByMenu()
.doFeature();
assertEquals(featurePage.getSomeAttributeValue(), "someAttributeValue");
}
}
public class HomePage {
@Page
private FeaturePage featurePage;
@FindBy(id="featureLinkMenu")
private WebElement featureLinkMenu;
public HomePage open(WebDriver driver) {
driver.get("someUrl");
}
public FeaturePage openFeaturePageByMenu() {
guardHttp(featureLinkMenu).click();
return featurePage;
}
}
{code}
It could be implemented with a cache which would create only one instance by Page class
for each @Page on the root of the @Test ...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira