Hi Thorsten,

what IItemReuseStrategy are you using?

DefaultItemReuseStrategy creates new items on each render, which leads to new ids.

Maybe testing your additional panels initiates additional pages renderings?

Have fun
Sven


On 18.03.20 09:29, Thorsten Schöning wrote:
Hi all,

I have some test in Wicket which renders a HTML-table using some
"DataView" and in that test I'm distinguishing the cases 0, 1 and 3
result rows. The following is an example for 1 and 3 rows:

assertNotNull(tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:1",
 true,  false), "No first result item available.");
assertNull(   
tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:2",
 false, false), "A second result item available.");
assertNotNull(tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:3",
 true,  false), "No third result item available.");
assertNull(   
tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:4",
 false, false), "A fourth result item available.");
The above worked for some days, but yesterday I changed the overall
HTML-template to add additional panels and the tests above stopped to
work. It's important to note that the added panel has nothing to do
with that table, it is completely unrelated in the header-part of the
body of the template and therefore shouldn't have any influence on the
table.

Nevertheless, the tests fail now, because the IDs of the generated
result rows seem to be off by one. In the debugger I can see that the
number of result rows is still as expected, but the former ID "1" has
changed to "2" now for some reason. So after reimplementing the test
to check "rows.getItemCount()" instead of concrete component-IDs, they
succeed again. But checking availability of expected components felt
more correct to me.

Any idea what the cause for the changed child-component-ID might be?

Looking at "RepeatingView", it seems the generated ID is neither
static nor am I aware of reusing components during tests. And I don't
think that the newly added panel has any influence, I guess it's more
on execution order of tests or something. But all my tests are
executed in order 0, 1 and 3 results and that didn't change since the
days before as well.

As I have changed the tests this is not a big deal currently, but I'm
wondering what I'm missing here. Thanks for your thoughts!

Mit freundlichen Grüßen,

Thorsten Schöning


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to