|
FIxed in IDE revision 476. I'm not an admin of Selenium IDE, so I can't close this issue myself, but that's OK, because I'd like Shinya to review it. Haven't tested the translated code thoroughly, but the code seems good. Er, actually this problem is a bit harder than it looks. TestVerifications retrieves an array including values that contain ",", specifically:
A naive join turns this into "first option,second option,third,,option" but Core translates this into "first option,second option,third\,\,option" in htmlutils.js selArrayToString. To fix this right, I guess we'd have to re-implement selArrayToString in every language, but that sucks. In revision 477 I committed code that did the opposite of what I just suggested. Instead of doing all the hard work of implementing selArrayToString in 7 languages/formatters, I just stripped the escaped commas out of the pattern. This makes the test pass, though it is technically less safe. But I think implementing selArrayToString in the formatter would make all of our other generated code really unnecessarily ugly, and you can always change the test manually later if you want, so I'm sticking with what I've got. oh, and unit tests fixed revision 478. Looks good, thanks for fixing! |
||||||||||||||||||||||||||||||||||||||
Just eliminating the length assertion would cause an unexpected ArrayIndexOutOfBoundsException if the actual length was shorter than expected, and I think that's not very kind.
I think we should change the code so that it joins the string and matches it against the whole pattern. For instance, | assertAllWindowNames | , | can be translated to a Ruby code like this:
array = @selenium.get_all_window_names
assert_match /^[\s\S]*,[\s\S]*$/, array.join(",")