On Oct 10, 2008, at 11:53 AM, jvdrean (SVN) wrote:
> Author: jvdrean
> Date: 2008-10-10 11:53:57 +0200 (Fri, 10 Oct 2008)
> New Revision: 13481
>
> Added:
> enterprise/trunk/distribution-test/wysiwyg-tests/
> enterprise/trunk/distribution-test/wysiwyg-tests/pom.xml
> enterprise/trunk/distribution-test/wysiwyg-tests/src/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/xpn/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
> xpn/xwiki/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
> xpn/xwiki/it/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
> xpn/xwiki/it/selenium/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
> xpn/xwiki/it/selenium/AllTests.java
> 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/framework/
> enterprise/trunk/distribution-test/wysiwyg-tests/src/test/it/com/
> xpn/xwiki/it/selenium/framework/AbstractWysiwygTestCase.java
> Log:
> XE-319 : Write an integration tests framework for the new wysiwyg
> editor
>
> Initial version, the XHTML assertions must be reviewed since some
> behaviors looks weird.
[snip]
> + public void testTypingAndDeletion()
> + {
> + typeText("foobar");
> + assertXHTML("foobar<br>");
This is not correct. There should be no br.
> + typeBackspaces("foobar".length());
> + assertXHTML(WYSIWYG_DEFAULT_CONTENT);
Maybe an assertEmptyXHTML() would be better?
> + public void testParagraphs()
> + {
> + typeTextThenEnter("a");
> + typeTextThenEnter("b");
> + typeText("c");
> + assertXHTML("<p>a</p><p>b</p><p>c<br></p>");
The br is wrong.
> + public void testBold()
> + {
> + typeTextThenEnter("foobar");
> + selectElement("p", 1);
What does this mean? Select the first <p> element in the DOM?
Couldn't we have instead: selectText("foobar")? It would seems easier
to write and easier to understand.
> + clickBoldButton();
> + assertXHTML("<p><strong>foobar</strong></p><p><strong></
> strong><br></p>");
The second paragraph shouldn't be there.
> + public void testItalics()
> + {
> + typeTextThenEnter("foobar");
> + selectElement("p", 1);
> + clickItalicsButton();
> + assertXHTML("<p><em>foobar</em></p><p><em></em><br></p>");
Same
>
> + }
> +
> + public void testUnderline()
> + {
> + typeTextThenEnter("foobar");
> + selectElement("p", 1);
> + clickUnderlineButton();
> + assertXHTML("<p><ins>foobar</ins></p><p><ins></ins><br></
> p>");
same
>
> + }
> +
> + public void testStrikethrough()
> + {
> + typeTextThenEnter("foobar");
> + selectElement("p", 1);
> + clickStrikethroughButton();
> + assertXHTML("<p><del>foobar</del></p><p><del></del><br></
> p>");
same
>
> + }
> +
> + public void testSubscript()
> + {
> + typeTextThenEnter("foobar");
> + selectElement("p", 1);
> + clickSubscriptButton();
> + assertXHTML("<p><sub>foobar</sub></p><p><br></p>");
same
>
> + }
> +
> + public void testSuperscript()
> + {
> + typeTextThenEnter("foobar");
> + selectElement("p", 1);
> + clickSuperscriptButton();
> + assertXHTML("<p><sup>foobar</sup></p><p><br></p>");
same
>
> + }
> +
> + public void testUnorderedList()
> + {
> + // Create a list with 3 items
> + typeTextThenEnter("a");
> + typeTextThenEnter("b");
> + typeText("c");
> + selectAllContent();
> + clickUnorderedListButton();
> + assertXHTML("<ul><li>a</li><li>b</li><li>c<br></li></ul>");
> +
> + // Undo
> + clickUnorderedListButton();
> + assertXHTML("<p>a</p><p>b</p><p>c<br></p>");
br shouldn't be there
>
> +
> + // Create a list with 1 item and delete it
> + resetContent();
clearContent()?
> + typeText("a");
> + selectAllContent();
> + clickUnorderedListButton();
> + typeBackspaces(2);
> + assertXHTML("<br>");
should be empty.
> +
> + // Create a list with 1 item and delete the bullet
> + resetContent();
> + typeText("a");
> + selectAllContent();
> + clickUnorderedListButton();
> + typeLeftArrow();
> + typeBackspace();
> + assertXHTML("a");
[snip] (other tests also need to be fixed)
> +
> + public static final String WYSIWYG_DEFAULT_CONTENT = "<br>";
This is not correct. It should be empty.
Thanks
-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs