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

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Tue Sep 10 04:33:03 EDT 2013


     [ https://issues.jboss.org/browse/ARQGRA-361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukáš Fryč updated ARQGRA-361:
------------------------------

    Description: 
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.


    
> 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