On Jun 12, 2008, at 1:50 AM, sdumitriu (SVN) wrote:
> Author: sdumitriu
> Date: 2008-06-12 01:50:00 +0200 (Thu, 12 Jun 2008)
> New Revision: 10268
>
> Modified:
> xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/WikiEditorTest.java
> Log:
> XWIKI-1007: Removing all content in page has no effect & the content
> of a wiki page is not allowed to be completely empty
> Added integration test
>
>
> Modified: xwiki-products/xwiki-enterprise/trunk/distribution-test/
> selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/
> WikiEditorTest.java
> ===================================================================
> --- xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/WikiEditorTest.java
> 2008-06-11 23:49:28 UTC (rev 10267)
> +++ xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/WikiEditorTest.java
> 2008-06-11 23:50:00 UTC (rev 10268)
> @@ -158,4 +158,20 @@
> getFieldValue("content"));
> // TODO: We need to find out how to make a text selection in
> Selenium
> }
> +
> + public void testEmptyContent()
I'd suggest: testEmptyDocumentContentIsAllowed
>
> + {
> + open("/xwiki/bin/edit/Test/EmptyWikiContent?editor=wiki");
> + setFieldValue("content", "this is some content");
> + clickEditSaveAndView();
> + assertFalse(getSelenium().isAlertPresent());
Why do we test for not having a dialog box present? There's content so
why should that happen? If it's required the test should have some
comments to explain it.
>
> + assertEquals(-1, getSelenium().getLocation().indexOf("/
> edit/"));
I don't understand this either since we have clicked on save, we're no
longer in edit and the url has view. Why verify this in this test
which is about verifying that empty content is allowed.
>
> + assertTextPresent("this is some content");
Again why test this. The ability to enter content is already tested in
other tests AFAIK.
>
> + open("/xwiki/bin/edit/Test/EmptyWikiContent?editor=wiki");
> + setFieldValue("content", "");
> + clickEditSaveAndView();
> + assertFalse(getSelenium().isAlertPresent());
> + assertEquals(-1, getSelenium().getLocation().indexOf("/
> edit/"));
> + assertTextNotPresent("this is some content");
Is there a need to do the 3 tests which seem to be about the same
verification?
Thanks
-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs