Branch: refs/heads/master
Home:
https://github.com/xwiki/xwiki-enterprise
Commit: 6e0258a75e0e666db2f48672bcdb41bbefe0b717
https://github.com/xwiki/xwiki-enterprise/commit/6e0258a75e0e666db2f48672bc…
Author: Marius Dumitru Florea <marius(a)xwiki.com>
Date: 2012-05-02 (Wed, 02 May 2012)
Changed paths:
M
xwiki-enterprise-test/xwiki-enterprise-test-wysiwyg/src/test/it/org/xwiki/test/wysiwyg/framework/WysiwygTestSetup.java
Log Message:
-----------
[misc] Display hidden documents for Admin user because various WYSIWYG tests use hidden
documents.
diff --git
a/xwiki-enterprise-test/xwiki-enterprise-test-wysiwyg/src/test/it/org/xwiki/test/wysiwyg/framework/WysiwygTestSetup.java
b/xwiki-enterprise-test/xwiki-enterprise-test-wysiwyg/src/test/it/org/xwiki/test/wysiwyg/framework/WysiwygTestSetup.java
index 690daf1..97689c4 100644
---
a/xwiki-enterprise-test/xwiki-enterprise-test-wysiwyg/src/test/it/org/xwiki/test/wysiwyg/framework/WysiwygTestSetup.java
+++
b/xwiki-enterprise-test/xwiki-enterprise-test-wysiwyg/src/test/it/org/xwiki/test/wysiwyg/framework/WysiwygTestSetup.java
@@ -55,6 +55,9 @@ protected void setUp() throws Exception
return;
}
+ // Make sure the hidden documents are displayed to the Admin user.
+ displayHiddenDocumentsForAdmin(firstXWikiTest);
+
// Set up the WYSIWYG tests using the first WYSIWYG Test case for Selenium and
skin executor API.
enableAllEditingFeatures(firstXWikiTest);
}
@@ -82,14 +85,28 @@ private AbstractWysiwygTestCase getFirstWysiwygTest(Test test)
}
/**
+ * Sets the Admin user preference to display the hidden documents.
+ *
+ * @param helperTest helper {@link AbstractWysiwygTestCase} instance whose API to
use to do the setup
+ */
+ private void displayHiddenDocumentsForAdmin(AbstractWysiwygTestCase helperTest)
+ {
+ helperTest.loginAsAdmin();
+ helperTest.open("XWiki", "Admin", "edit",
"editor=object");
+ String propertyId = "XWiki.XWikiUsers_0_displayHiddenDocuments";
+ if
(!"1".equals(helperTest.getSelenium().getSelectedValue(propertyId))) {
+ helperTest.setFieldValue(propertyId, "1");
+ helperTest.clickEditSaveAndContinue();
+ }
+ }