With the current version of Mozmill both functions assertValue and assertText also pass when the reference parameter contains a sub string of the nodes value or text, e.g. when the location bar contains "http://www.mozilla.org" and you call the assertValue function with "org" is passes. IMO that is the wrong behavior and has to be fixed. I would like to see the following API which also makes us flexible: Both functions have three parameters * node: The node we run the check against * value/text: The desired content we expect to have * fullMatch (optional): Whether the value is exactly the node value or a substring (default 1) What are your opinions?
Current implementation: assertText: http://code.google.com/p/mozmill/source/browse/trunk/mozmill/extension/resource/modules/controller.js#498 assertValue: http://code.google.com/p/mozmill/source/browse/trunk/mozmill/extension/resource/modules/controller.js#554 Right now, we can workaround this problem by comparing the values on our own by code like 'element.getNode().value == value' or 'element.getNode().innerHTML == value'. One nice improvement could also be to get rid of the assertText function and check the node type which way we have to compare the value.
Priority: -- → P3
The assert naming scheme implies the property we are asserting, what happens if a node as a value property and you are wanting to validate it's textContent or innerHTML? I think we should leave both asserts because they have different purposes, but I will improve the comparison code tomorrow.
Adam, any update on that? Two weeks are gone now.
FYI: There is also a corresponding windmill bug on this. http://trac.getwindmill.com/ticket/278
Now they are a comparison instead of an indexof: Committed revision 477.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Verified fixed with r477. Do we need a better doc on this?
Assignee: nobody → adam.christian
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.