Index: lams_tool_wiki/.classpath
===================================================================
diff -u -r61e7bbf20d65e2ecb5e50f3154e52264003defa1 -r204708ec61448107a4307bceb2a7e7b480ed6a27
--- lams_tool_wiki/.classpath (.../.classpath) (revision 61e7bbf20d65e2ecb5e50f3154e52264003defa1)
+++ lams_tool_wiki/.classpath (.../.classpath) (revision 204708ec61448107a4307bceb2a7e7b480ed6a27)
@@ -1,13 +1,23 @@
+
-
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_wiki/.project
===================================================================
diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r204708ec61448107a4307bceb2a7e7b480ed6a27
--- lams_tool_wiki/.project (.../.project) (revision 1082bdcc357c105126a5641cecc68acfa645b66b)
+++ lams_tool_wiki/.project (.../.project) (revision 204708ec61448107a4307bceb2a7e7b480ed6a27)
@@ -5,6 +5,41 @@
+
+ com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator
+
+
+
+
+ com.ibm.etools.validation.validationbuilder
+
+
+
+
+ com.ibm.sse.model.structuredbuilder
+
+
+
+
+ com.genuitec.eclipse.hibernate.HibernateBuilder
+
+
+
org.eclipse.jdt.core.javanature
Index: lams_tool_wiki/test/java/org/lamsfoundation/lams/tool/selenium/TestWiki.java
===================================================================
diff -u
--- lams_tool_wiki/test/java/org/lamsfoundation/lams/tool/selenium/TestWiki.java (revision 0)
+++ lams_tool_wiki/test/java/org/lamsfoundation/lams/tool/selenium/TestWiki.java (revision 204708ec61448107a4307bceb2a7e7b480ed6a27)
@@ -0,0 +1,169 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+package org.lamsfoundation.lams.tool.selenium;
+
+import java.util.Map;
+
+import org.lamsfoundation.lams.selenium.AbstractSeleniumTestCase;
+import org.lamsfoundation.lams.tool.wiki.util.WikiConstants;
+
+public class TestWiki extends AbstractSeleniumTestCase {
+
+ private static final String LEARNING_DESIGN_TITLE ="Wiki Test";
+ private static final String WIKI_TITLE1 = "Dog Wiki";
+ private static final String WIKI_TITLE2 = "Blue Healers";
+ private static final String WIKI_BODY1 = "Dogs come in many breeds.";
+ private static final String WIKI_BODY2 = "Blue Healers are small dogs origninally bred for farming and hunting";
+ private static final String WIKI_BODY3 = "Dogs come in many breeds, please attach a wiki page about a breed.";
+
+ private Map contentDetails;
+
+ protected String getToolSignature() {
+ return WikiConstants.TOOL_SIGNATURE;
+ }
+
+ protected String getLearningDesignName() {
+ return LEARNING_DESIGN_TITLE;
+ }
+
+ @Override
+ public void testEntireTool() throws Exception {
+ }
+
+ @Override
+ protected void learningTest() throws InterruptedException {
+ }
+
+ @Override
+ protected void monitoringTest() {
+ }
+
+ @Override
+ protected void authoringTest() throws Exception {
+ }
+
+ // *************************************************************************
+ // Wiki author tests
+ // *************************************************************************
+
+ /**
+ * Testing the wiki author module
+ */
+ public void testAuthor() {
+ try {
+
+ // Logging in and opening authoring
+ loginToLams();
+ contentDetails = setUpAuthoring();
+
+ // Testing wiki edit page
+ testAuthorEdit(WIKI_TITLE1, WIKI_BODY1);
+
+ // Testing wiki add page
+ testAuthorAdd(WIKI_TITLE2, WIKI_BODY2);
+
+ // Testing author edit again
+ selenium.runScript("changeWikiPage('" + WIKI_TITLE1 + "')");
+ selenium.waitForPageToLoad("30000");
+ testAuthorEdit(WIKI_TITLE1, WIKI_BODY3);
+
+ // Test history
+ testAuthorHistory(WIKI_TITLE1);
+
+ // Testing other tabs
+ selenium.click("tab-middle-link-2");
+ selenium.click("lockOnFinished");
+ selenium.click("tab-middle-link-3");
+ selenium.type("onlineInstruction__lamstextarea", "online instructions");
+
+ storeLearningDesign(contentDetails);
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+
+ }
+
+ /**
+ * Tests editing the wiki page in author
+ */
+ private void testAuthorEdit(String title, String body) {
+
+ // Go to the edit tab
+ selenium.runScript("changeDiv('edit')");
+
+ // Set the wiki title and body, then save
+ selenium.type("title", title);
+ selenium.runScript("FCKeditorAPI.GetInstance(\"wikiBody\").SetHTML(\"" + body + "\")");
+ selenium.runScript("doEditOrAdd('editPage')");
+ selenium.waitForPageToLoad("30000");
+
+ assertTrue("Title is not present on page: " + title, selenium.isTextPresent(title));
+ assertTrue("Wiki body is not present on page: " + body, selenium.isTextPresent(body));
+ }
+
+ /**
+ * Tests editing the wiki page in author
+ */
+ private void testAuthorAdd(String title, String body) {
+ // Go to the edit tab
+ selenium.runScript("changeDiv('add')");
+
+ // Set the wiki title and body, then save
+ selenium.type("newPageTitle", title);
+ selenium.runScript("FCKeditorAPI.GetInstance(\"newPageWikiBody\").SetHTML(\"" + body + "\")");
+ selenium.runScript("doEditOrAdd('addPage')");
+ selenium.waitForPageToLoad("30000");
+
+ selenium.runScript("changeWikiPage('" + title + "')");
+ selenium.waitForPageToLoad("30000");
+
+ assertTrue("Title is not present on page: " + title, selenium.isTextPresent(title));
+ assertTrue("Wiki body is not present on page: " + body, selenium.isTextPresent(body));
+ }
+
+ private void testAuthorHistory(String title) {
+ selenium.runScript("changeWikiPage('" + title + "')");
+ selenium.waitForPageToLoad("30000");
+
+ // Go to the history tab
+ selenium.runScript("changeDiv('history'" + "" + ")");
+ assertTrue("Revision is not present on edited page: " + title, selenium.isTextPresent("Revert"));
+
+ // TODO: Test the compare feature
+ }
+
+ // *************************************************************************
+ // Wiki learner tests
+ // *************************************************************************
+
+ public void testLearner() {
+ try {
+ loginToLams();
+ createNewLesson();
+ setUpLearning();
+ assertEquals("LAMS Learner", selenium.isElementPresent("//a[@id='finishButton']"));
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+
+}