On Sep 22, 2009, at 2:53 PM, Marius Dumitru Florea wrote:
> Vincent Massol wrote:
>> On Sep 22, 2009, at 2:39 PM, mflorea (SVN) wrote:
>>
>>> Author: mflorea
>>> Date: 2009-09-22 14:39:37 +0200 (Tue, 22 Sep 2009)
>>> New Revision: 23810
>>>
>>> Modified:
>>> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
>>> xpn/xwiki/it/selenium/LineTest.java
>>> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
>>> xpn/xwiki/it/selenium/NativeJavaScriptApiTest.java
>>> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
>>> xpn/xwiki/it/selenium/StandardFeaturesTest.java
>>> Log:
>>> Fixed some of the WYSIWYG failing tests
>>> * Replaced 'y' with 'Y' to overcome a Selenium bug that
>>> misinterprets 'y' as 'alt' key when typing.
>>
>
>> This must be well documented in the code below.
>
> It doesn't sound right to me to add a comment for each occurrence of
> 'Y'
> since the typed text is not important. It just happened that I used
> 'y'.
> I could have used anything else instead.
I don't agree at all. I thought you said it wasn't working with "y"
and you *HAD* to use "Y".
If I read "xYz" the first question that'll come to my mind is why is
the Y in uppercase. And next step I'll change to something else like
"dummy" and it'll suddenly fail with no reason and then I'll spend 2
days to figure out why.
You've discovered something you need to doc it.
Also we need to link to a page that explains the pb in the code so
that we can check if it's fixed in later versions and ensure it's a
real selenium bug and not a bug of ourselves using selenium wrongly.
Thanks
-Vincent
>
> Thanks,
> Marius
>
>>
>> Thanks
>> -Vincent
>>
>>> * The bogus BR tag is not deleted anymore in FF3.5 when pressing the
>>> Delete key so we must add it when asserting HTML.
>>>
>>>
>>> Modified: enterprise/trunk/distribution-test/wysiwyg-tests/src/test/
>>> it/com/xpn/xwiki/it/selenium/LineTest.java
>>> ===================================================================
>>> --- enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
>>> com/
>>> xpn/xwiki/it/selenium/LineTest.java 2009-09-22 12:09:21 UTC (rev
>>> 23809)
>>> +++ enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
>>> com/
>>> xpn/xwiki/it/selenium/LineTest.java 2009-09-22 12:39:37 UTC (rev
>>> 23810)
>>> @@ -252,11 +252,10 @@
>>> // thus we are forced to collapse the selection to the end.
>>> runScript("XWE.selection.collapseToEnd()");
>>> typeEnter();
>>> - typeText("xyz");
>>> - typeDelete();
>>> + typeText("xYz");
>>> assertXHTML("<!--startimage:[email protected]>"
>>> + "<img src=\"/xwiki/bin/download/XWiki/AdminSheet/
>>> photos.png\" alt=\"photos.png\">"
>>> - + "<!--stopimage--><p>xyz</p>");
>>> + + "<!--stopimage--><p>xYz<br class=\"spacer\"></p>");
>>> }
>>>
>>> /**
>>>
>>> Modified: enterprise/trunk/distribution-test/wysiwyg-tests/src/test/
>>> it/com/xpn/xwiki/it/selenium/NativeJavaScriptApiTest.java
>>> ===================================================================
>>> --- enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
>>> com/
>>> xpn/xwiki/it/selenium/NativeJavaScriptApiTest.java 2009-09-22
>>> 12:09:21 UTC (rev 23809)
>>> +++ enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
>>> com/
>>> xpn/xwiki/it/selenium/NativeJavaScriptApiTest.java 2009-09-22
>>> 12:39:37 UTC (rev 23810)
>>> @@ -123,7 +123,7 @@
>>> typeText("x");
>>> assertEquals("x", getSourceText("editor"));
>>>
>>> - typeText("y");
>>> + typeText("Y");
>>> clickButtonWithText("Load Editor");
>>> waitForCondition("typeof window.editor == 'object'");
>>> focusRichTextArea();
>>>
>>> Modified: enterprise/trunk/distribution-test/wysiwyg-tests/src/test/
>>> it/com/xpn/xwiki/it/selenium/StandardFeaturesTest.java
>>> ===================================================================
>>> --- enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
>>> com/
>>> xpn/xwiki/it/selenium/StandardFeaturesTest.java 2009-09-22 12:09:21
>>> UTC (rev 23809)
>>> +++ enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
>>> com/
>>> xpn/xwiki/it/selenium/StandardFeaturesTest.java 2009-09-22 12:39:37
>>> UTC (rev 23810)
>>> @@ -257,15 +257,15 @@
>>> {
>>> typeText("x");
>>> typeShiftEnter();
>>> - typeText("y");
>>> + typeText("Y");
>>> selectAllContent();
>>> clickUnorderedListButton();
>>> // Since the left arrow key doesn't move the caret we have
>>> to use the Range API instead.
>>> moveCaret("XWE.body.firstChild.childNodes[1].firstChild", 0);
>>> typeTab();
>>> - assertXHTML("<ul><li>x<ul><li>y</li></ul></li></ul>");
>>> + assertXHTML("<ul><li>x<ul><li>Y</li></ul></li></ul>");
>>> typeShiftTab();
>>> - assertXHTML("<ul><li>x</li><li>y</li></ul>");
>>> + assertXHTML("<ul><li>x</li><li>Y</li></ul>");
>>> }
>>>
>>> /**
>>> @@ -414,7 +414,7 @@
>>> */
>>> public void testInsertHRInsideParagraph()
>>> {
>>> - typeText("xy");
>>> + typeText("xY");
>>> applyStyleTitle1();
>>> applyStylePlainText();
>>>
>>> @@ -435,7 +435,7 @@
>>>
>>> // We have to assert the XHTML because the arrow keys don't
>>> move the caret so we can't test if the user can edit
>>> // the generated empty paragraphs. The fact that they
>>> contain a BR proves this.
>>> - assertXHTML("<p><br class=\"spacer\"></p><hr><p>x</
>>> p><hr><p>y</p><hr><p><br class=\"spacer\"></p>");
>>> + assertXHTML("<p><br class=\"spacer\"></p><hr><p>x</
>>> p><hr><p>Y</p><hr><p><br class=\"spacer\"></p>");
>>> }
>>>
>>> /**
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs