[arquillian-issues] [JBoss JIRA] (ARQGRA-189) Support @Page in Page objects

Anthony O. (JIRA) jira-events at lists.jboss.org
Mon Sep 10 12:56:33 EDT 2012


Anthony O. created ARQGRA-189:
---------------------------------

             Summary: 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: Lukáš Fryč


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



More information about the arquillian-issues mailing list