[JBoss JIRA] (ARQGRA-326) Support for full initialization of outer class instance of a page fragment declared as inner class
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-326?page=com.atlassian.jira.plugin... ]
Lukáš Fryč updated ARQGRA-326:
------------------------------
Fix Version/s: 2.0-Tracking
> Support for full initialization of outer class instance of a page fragment declared as inner class
> --------------------------------------------------------------------------------------------------
>
> Key: ARQGRA-326
> URL: https://issues.jboss.org/browse/ARQGRA-326
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Components: core
> Affects Versions: 2.0.0.Alpha4
> Reporter: Juraj Húska
> Priority: Minor
> Fix For: 2.0-Tracking
>
>
> If a Page Fragment is declared as inner class, then it can not access the fields of its outer class, as their are not inicialized by Graphene Enrichers, thus are {{null}}.
> The possible ugly workaround for such initialization can be:
> {code}
> if (pageFragment.getClass().getEnclosingClass() != null) {
> Field field = pageFragment.getClass().getDeclaredField("this$0");
> field.setAccessible(true);
> Object outer = field.get(pageFragment);
> enrichRecursively(root, outer);
> }
> {code}
> It should be placed in some utility class, so it can be easily unit tested.
> There is one drawback of this method and that is, the outer class can not contain injection point for the inner class, otherwise it will cycle. The inner class can be obtained only dynamically via {{Graphene.createPageFragment}}.
--
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
12 years, 7 months
[JBoss JIRA] (ARQGRA-292) Extend fluent wating API to support page fragments
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-292?page=com.atlassian.jira.plugin... ]
Lukáš Fryč edited comment on ARQGRA-292 at 9/3/13 5:52 AM:
-----------------------------------------------------------
This is partially resolved by allowing page fragment to implement WebElement:
{code:java}
class PageFragment implements WebElement;
Graphene.waitAjax().until().element(pf).is().visible();
{code}
Further improvement can be achieved by introducing the interface you suggested:
{code:java}
class PageFragment implements Waitable<PageFramentWaitConditions> {
PageFramentWaitConditions getWaitable();
class PageFramentWaitConditions {
void visible() {
...
}
}
}
// obtain conditions
PageFramentWaitConditions cond = Graphene.waitAjax().until().pageFragment(pf).is();
// wait for condition
cond.visible();
{code}
was (Author: lfryc):
This is partially resolved by allowing page fragment to implement WebElement:
{code:java}
class PageFragment implements WebElement;
Graphene.waitAjax().until().element(pf).is().visible();
{code}
Further improvement can be achieved by introducing the interface you suggested:
{code:java}
class PageFragment implements Waitable<PageFragmentWaitable> {
}
class PageFragmentWaitable {
void visible() {
...
}
}
{code}
> Extend fluent wating API to support page fragments
> --------------------------------------------------
>
> Key: ARQGRA-292
> URL: https://issues.jboss.org/browse/ARQGRA-292
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Affects Versions: 2.0.0.Alpha4
> Reporter: Jan Papousek
>
> Provide reasonable interfaces for page fragments to be able to extend fluent API for them, e.g. _Visible_:
> {code}
> Visible pf = ...;
> Graphene.waitAjax().until().pageFragment(pf).is().visible();
> {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
12 years, 7 months
[JBoss JIRA] (ARQGRA-292) Extend fluent wating API to support page fragments
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-292?page=com.atlassian.jira.plugin... ]
Lukáš Fryč commented on ARQGRA-292:
-----------------------------------
This is partially resolved by allowing page fragment to implement WebElement:
{code:java}
class PageFragment implements WebElement;
Graphene.waitAjax().until().element(pf).is().visible();
{code}
Further improvement can be achieved by introducing the interface you suggested:
{code:java}
class PageFragment implements Waitable<PageFragmentWaitable> {
}
class PageFragmentWaitable {
void visible() {
...
}
}
{code}
> Extend fluent wating API to support page fragments
> --------------------------------------------------
>
> Key: ARQGRA-292
> URL: https://issues.jboss.org/browse/ARQGRA-292
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Affects Versions: 2.0.0.Alpha4
> Reporter: Jan Papousek
>
> Provide reasonable interfaces for page fragments to be able to extend fluent API for them, e.g. _Visible_:
> {code}
> Visible pf = ...;
> Graphene.waitAjax().until().pageFragment(pf).is().visible();
> {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
12 years, 7 months