[arquillian-issues] [JBoss JIRA] (ARQGRA-199) Provide a way to create Page Fragments dynamically
Lukáš Fryč (JIRA)
jira-events at lists.jboss.org
Fri Nov 2 11:28:17 EDT 2012
[ https://issues.jboss.org/browse/ARQGRA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731272#comment-12731272 ]
Lukáš Fryč edited comment on ARQGRA-199 at 11/2/12 11:27 AM:
-------------------------------------------------------------
{code:java}
public class Page {
@FindBy(...)
TabPanelImpl<WebElement, TabPanel<Calendar>> tabPanel =
// artifically created TabPanelImpl instance using CGLib;
// the instance will also implement "DynamicFragment" interface;
// use ClassImposterizer.imposterise(MethodInterceptor);
// this will create tree-like structure reflecting type information for <WebElement, TabPanel<Calendar>>
dynamicFragment(
WebElement.class,
dynamicFragment(Calendar.class));
ContainerFor2<WebElement, TabPanel<Calendar>> tabs = tabPanel.tabs();
WebElement element = tabPanel.tabs().get(1);
WebElement element = tabPanel.tabs().first();
accordion.items().second();
// proxy of ContainerFor2 interface will be passed to TabPanelImpl
// and returned by TabPanel#tabs()
interface ContainerFor2<T1, T2> {
get(int i);
// proxy delegates to this.get(1)
@Order(1)
T1 first();
// proxy delegates to this.get(2)
@Order(2)
T2 second();
}
}
{code}
was (Author: lfryc):
{code:java}
public class Page {
@FindBy(...)
TabPanelImpl<WebElement, TabPanel<Calendar>> tabPanel =
// artifically created TabPanelImpl instance using CGLib;
// the instance will also implement "DynamicFragment" interface;
// use ClassImposterizer.imposterise(MethodInterceptor);
// this will create tree-like structure reflecting type information for <WebElement, TabPanel<Calendar>>
dynamicFragment(
WebElement.class,
dynamicFragment(Calendar.class));
WebElement element = tabPanel.tabs().get(1);
WebElement element = tabPanel.tabs().first();
accordion.items().second();
// proxy of ContainerFor2 interface will be passed to TabPanelImpl
// and returned by TabPanel#tabs()
interface ContainerFor2<T1, T2> {
get(int i);
// proxy delegates to this.get(1)
@Order(1)
T1 first();
// proxy delegates to this.get(2)
@Order(2)
T2 second();
}
}
{code}
> Provide a way to create Page Fragments dynamically
> --------------------------------------------------
>
> Key: ARQGRA-199
> URL: https://issues.jboss.org/browse/ARQGRA-199
> Project: Arquillian Graphene
> Issue Type: Enhancement
> Components: api, unit-test
> Affects Versions: 2.0.0.Alpha2
> Reporter: Juraj Húska
> Assignee: Juraj Húska
> Fix For: 2.0.0.Alpha3
>
>
> The only way now to declare and initialize Page Fragment is to annotate the implementation class of that Page Fragment by {{@FindBy}} (or use static factory method).
> It will nice and vital addition to have way how to declare and create Page Fragments dynamically.
> It will be for example useful in the use case described in the [comment|https://issues.jboss.org/browse/ARQGRA-199?focusedCommentId=12731165&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12731165] below.
--
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