You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maxime00 <ma...@hotmail.com> on 2014/09/26 13:41:03 UTC
[Problem] Attribute not found
Hello, I have a weird issue in my tests. I have a html file with that line :
wich is supposed to add a question circle in my page.
When I run my tests, I do :
public void testWicketExist() throws Exception {
// GIVEN : Page was created
// Page creation
ModuleCreatePanel panel = new ModuleCreatePanel("test", new
PageParameters());
// WHEN : render a module table panel
panel = this.tester.startComponentInPage(panel);
WicketHelper.printChildrenTree(this.tester.getLastRenderedPage());
// THEN : check the value in the attribute
WicketHelper
.assertAttribute(
"link must have the expected class!",
"fa fa-question-circle",
this.tester
.getComponentFromLastRenderedPage("test:newModulePanel:moduleCreateForm:address-helper"),
"class");
}
But the WicketHelper.assertAttribute can't find it. Would you know why ?
(the path is fine, I displayed it with
WicketHelper.printChildrenTree(this.tester.getLastRenderedPage()); )
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: [Problem] Attribute not found
Posted by Maxime00 <ma...@hotmail.com>.
We chose to use java instead, thank you for your help. (we couldn't find
where the error is)
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667728.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: [Problem] Attribute not found
Posted by Martin Grigorov <mg...@apache.org>.
Use org.apache.wicket.util.tester.BaseWicketTester#getLastResponseAsString()
to print the response. Make sure the element is there.
If it is there then fire the debugger and see why getTagByWicketId()
doesn't see it. Then file a bug at JIRA.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Fri, Sep 26, 2014 at 2:43 PM, Maxime00 <ma...@hotmail.com>
wrote:
> It is false :(
> Another idea ?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667723.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: [Problem] Attribute not found
Posted by Maxime00 <ma...@hotmail.com>.
It is false :(
Another idea ?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667723.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: [Problem] Attribute not found
Posted by Martin Grigorov <mg...@apache.org>.
See IMarkupSettings#setStripWicketTags().
It has to be 'false' to be able to use tester.getTagByWicketId().
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Fri, Sep 26, 2014 at 2:29 PM, Maxime00 <ma...@hotmail.com>
wrote:
> We used :
>
> TagTester tagById = this.tester.getTagByWicketId("address-helper");
> assertNotNull(tagById);
>
> Assert fail
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667721.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: [Problem] Attribute not found
Posted by Maxime00 <ma...@hotmail.com>.
We used :
TagTester tagById = this.tester.getTagByWicketId("address-helper");
assertNotNull(tagById);
Assert fail
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667721.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: [Problem] Attribute not found
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
WicketHelper is your own class. We cannot know how it works.
You can use WicketTester.getTagBy(Wicket)Id() instead.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Fri, Sep 26, 2014 at 1:41 PM, Maxime00 <ma...@hotmail.com>
wrote:
> Hello, I have a weird issue in my tests. I have a html file with that line
> :
>
>
>
> wich is supposed to add a question circle in my page.
> When I run my tests, I do :
>
> public void testWicketExist() throws Exception {
> // GIVEN : Page was created
> // Page creation
> ModuleCreatePanel panel = new ModuleCreatePanel("test", new
> PageParameters());
> // WHEN : render a module table panel
> panel = this.tester.startComponentInPage(panel);
> WicketHelper.printChildrenTree(this.tester.getLastRenderedPage());
> // THEN : check the value in the attribute
> WicketHelper
> .assertAttribute(
> "link must have the expected class!",
> "fa fa-question-circle",
> this.tester
>
>
> .getComponentFromLastRenderedPage("test:newModulePanel:moduleCreateForm:address-helper"),
> "class");
> }
>
> But the WicketHelper.assertAttribute can't find it. Would you know why ?
> (the path is fine, I displayed it with
> WicketHelper.printChildrenTree(this.tester.getLastRenderedPage()); )
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>