[arquillian-issues] [JBoss JIRA] (ARQGRA-361) Reimplement WebElement/PageFragment/ElementWrapper Enrichers to have one enrichment base which delegates to factories

Juraj Húska (JIRA) jira-events at lists.jboss.org
Tue Sep 10 05:33:03 EDT 2013


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

Juraj Húska commented on ARQGRA-361:
------------------------------------

It would be vital addition indeed.

I am just wondering how do you imagine the {{PageFragmentRegistry}} registration API. Where and how an user can register their fragments ?
                
> Reimplement WebElement/PageFragment/ElementWrapper Enrichers to have one enrichment base which delegates to factories
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARQGRA-361
>                 URL: https://issues.jboss.org/browse/ARQGRA-361
>             Project: Arquillian Graphene
>          Issue Type: Bug
>            Reporter: Lukáš Fryč
>
> All of these enrichers scans for FindBy annotations:
> * [WebElementEnricher|https://github.com/arquillian/arquillian-graphene/blob/2.0.0.Alpha5/graphene-webdriver/graphene-webdriver-impl/src/main/java/org/jboss/arquillian/graphene/enricher/WebElementEnricher.java#L41]
> * [PageFragmentEnricher|https://github.com/arquillian/arquillian-graphene/blob/2.0.0.Alpha5/graphene-webdriver/graphene-webdriver-impl/src/main/java/org/jboss/arquillian/graphene/enricher/PageFragmentEnricher.java#L58]
> * [WebElementWrapperEnricher|https://github.com/arquillian/arquillian-graphene/blob/2.0.0.Alpha5/graphene-webdriver/graphene-webdriver-impl/src/main/java/org/jboss/arquillian/graphene/enricher/WebElementWrapperEnricher.java#L28]
> That leads into disambiguity since the solution is not readable. It also brings code duplication.
> ----
> The suggested refactoring should lead into one enricher, which delegates to particular factories.
> It will evaluate which type of injection should happen:
> * interface / abstract class (needs to check newly created registry for implementation)
> ** this is suitable for WebElement or GrapheneElement injections (GrapheneElement needs to be refactored to interface)
> ** it's also case of page fragments with interface and implementation
> * element wrapper: MyWrapper(WebElement)
> ** this is case of e.g. Select(WebElement)
> * page fragment implementation
> When interface / abstract class doesn't find suitable implementation or it is a final class, exception should be thrown.

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