[arquillian-issues] [JBoss JIRA] (ARQGRA-377) Improve the conditions API

Karel Piwko (JIRA) jira-events at lists.jboss.org
Mon Sep 16 04:59:03 EDT 2013


    [ https://issues.jboss.org/browse/ARQGRA-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804397#comment-12804397 ] 

Karel Piwko commented on ARQGRA-377:
------------------------------------

We need to have conditions/predicates supported in all assert, assume and if() statement.

So, hamcrest matchers solve problem only partly, because I assume you can't use them in if() statements.

That said, I think that hamcrest matchers represent a great addition to JUnit. There also http://code.google.com/p/selenium/wiki/LiftStyleApi, which is trying to improve writing conditions for WebDriver.
                
> Improve the conditions API
> --------------------------
>
>                 Key: ARQGRA-377
>                 URL: https://issues.jboss.org/browse/ARQGRA-377
>             Project: Arquillian Graphene
>          Issue Type: Enhancement
>          Components: core
>    Affects Versions: 2.0.0.Beta1
>            Reporter: Juraj Húska
>
> Currently the conditions API looks like:
> {code}
> new WebElementConditionFactory(webElement).isEnabled().apply(webDriverInstance);{code}
> It should be improved to be more concise.
> Consider inspiring with *hamcrest* library ([link|https://code.google.com/p/hamcrest/]), which should allow to have conditions API like:
> {code}
> import static foo.bar.Matchers.*;
> public void testEquals() {
>     WebElement element = browser.findBy(By.tagName("body"));
>     assertThat(element, isDisplayed());
> }
> {code}

--
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