Closed jenssuhr closed 7 years ago
Hi Jens
I tried to reproduce this issue but wasn't able to. Can you have a look at https://github.com/unic/ScalaWebTest/pull/37/files and https://travis-ci.org/unic/ScalaWebTest/builds/237816435 ?
What am I missing? Can you create a pull-request with a failing test?
Kind Regards Dani
That's pretty weird. If I copy both my test and the full HTML output of the tested page to the scalatest project and run the integration tests, the test succeeds. If I run the same thing in my AEM application, it fails.
I suspect there is something else, which is different when served from AEM.
Your input got me thinking about some behavior optimizations. The misfits which confused you, are due to the fact that the gauge verifies the attributes, before verifying the order of the elements.
In some cases this helps in other cases it leads to strange error messages. Imagine the content is the same as in your Page HTML, but the gauge has bar
and baz
in the opposite order. In this case it is preferred, if the gauge reports a wrong element order. To do so we have to search for bar
in all possible positions, not only after baz
.
In case the element order is correct, but the attributes do not align, the misfits from verifying elements, which are at the wrong position, are alienating. I'm still looking for a solution to cover both situations in a good way.
Your ticket triggered the idea to verify all attributes and the element order, and then only report misfits for the closest matches. But I'm not yet sure if this may workout. I will open a new ticket to try this out.
We analyzed this issue together and could see that the description of this issue is off. Therefore I will close it as not a bug. But we could find one issue and one possible improvement, which will be tracked in separate issues. Bug https://github.com/unic/ScalaWebTest/issues/38 opened Enhancement https://github.com/unic/ScalaWebTest/issues/39 opened
Using ScalaWebTest 1.1.0 (but the issue occurred with previous versions as well), HTML gauges seem to have a problem with sibling elements without IDs.
Page HTML:
ScalaWebTest gauge:
Result:
This also happens with other elements like
div
andli
.