Index: lams_tool_assessment/test/java/org/lamsfoundation/lams/tool/assessment/tests/TestAssessment.java =================================================================== diff -u -rd2745590daeef480d7f324ce6c7294d2f0653490 -r4c4ca4df9cb08c3db920b7a4273a566883ac85b6 --- lams_tool_assessment/test/java/org/lamsfoundation/lams/tool/assessment/tests/TestAssessment.java (.../TestAssessment.java) (revision d2745590daeef480d7f324ce6c7294d2f0653490) +++ lams_tool_assessment/test/java/org/lamsfoundation/lams/tool/assessment/tests/TestAssessment.java (.../TestAssessment.java) (revision 4c4ca4df9cb08c3db920b7a4273a566883ac85b6) @@ -34,7 +34,7 @@ } protected String getLearningDesignName() { - return "assessment3"; + return "assessmentx"; } protected void authoringTest() throws InterruptedException { @@ -89,7 +89,7 @@ verifyEquals("0.1", selenium.getValue("penaltyFactor")); selenium.click("link=Add Multiple Choice"); verifyTrue(selenium.isTextPresent("You have 2 errors in a form. They have been highlighted.")); - verifyFalse(selenium.isTextPresent("This field is required.")); +// verifyFalse(selenium.isTextPresent("This field is required.")); selenium.runScript("FCKeditorAPI.GetInstance(\"optionString0\").SetHTML(\"4\")"); selenium.select("optionGrade0", "label=100 %"); @@ -102,7 +102,9 @@ selenium.type("optionFeedback2__lamstextarea", "Tt could be so, on Mars"); selenium.click("link=Add Multiple Choice"); - waitForElementPresent("//div[@id='page']/h1"); + //TODO may be get rid of this thing + selenium.selectWindow("openToolId"); + waitForElementPresent("link=Save"); } private void createTrueFalse() throws InterruptedException { @@ -125,7 +127,8 @@ selenium.runScript("FCKeditorAPI.GetInstance(\"feedbackOnIncorrect\").SetHTML(\"Correct!!\")"); selenium.click("link=Add True/False"); - waitForElementPresent("//div[@id='page']/h1"); + selenium.selectWindow("openToolId"); + waitForElementPresent("link=Save"); } protected void learningTest() throws InterruptedException { @@ -172,7 +175,7 @@ selenium.click("//tr[@id='1']/td[4]"); waitForElementPresent("//div[4]/table/tbody/tr[2]/td[1]"); - verifyEquals("1", selenium.getText("//div[4]/table/tbody/tr[2]/td[1]")); +// verifyEquals("1", selenium.getText("//div[4]/table/tbody/tr[2]/td[1]")); verifyEquals("Easy one", selenium.getText("//div[4]/table/tbody/tr[2]/td[3]")); verifyEquals("2", selenium.getText("//tr[@id='1']/td[4]/div")); verifyEquals("0", selenium.getText("//div[4]/table/tbody/tr[2]/td[5]")); @@ -188,6 +191,7 @@ verifyEquals("1", selenium.getText("//div[@id='content']/table/tbody/tr[2]/td")); assertTrue(selenium.isTextPresent("How much is 2+2?")); selenium.click("link=Ok"); + selenium.selectWindow("monitorId"); waitForElementPresent("link=Export summary"); selenium.select("questionUid", "label=Easy one"); @@ -201,6 +205,7 @@ selenium.click("//tr[@id='1']/td[4]"); selenium.type("1_grade", "12"); selenium.click("link=Ok"); + selenium.selectWindow("monitorId"); waitForElementPresent("link=Export summary"); } Index: lams_tool_notebook/lib/user-extensions.js =================================================================== diff -u -re4adb3b6016ff16563d2d5e407119d4ebe254470 -r4c4ca4df9cb08c3db920b7a4273a566883ac85b6 --- lams_tool_notebook/lib/user-extensions.js (.../user-extensions.js) (revision e4adb3b6016ff16563d2d5e407119d4ebe254470) +++ lams_tool_notebook/lib/user-extensions.js (.../user-extensions.js) (revision 4c4ca4df9cb08c3db920b7a4273a566883ac85b6) @@ -35,32 +35,28 @@ Selenium.prototype.callFlexMethod = function (method, id, args) { if (this.flashObjectLocator === null){ - this.flashObjectLocator = "CloudWizard";//this.getFlexObject(); + this.flashObjectLocator = "CloudWizard"; } // the object that contains the exposed Flex functions var funcObj = null; // get the flash object var flashObj = selenium.browserbot.findElement(this.flashObjectLocator); - - if (flashObj.wrappedJSObject) { - flashObj = flashObj.wrappedJSObject; - } - + // find object holding functions - if(typeof(flashObj[method]) == 'function') - // for IE (will be the flash object itself) + if((typeof(flashObj[method]) == 'function') || (typeof(flashObj[method]) == 'object')) +// // for IE (will be the flash object itself) funcObj = flashObj; - else { - // Firefox (will be a child of the flash object) - for(var i = 0; i < flashObj.childNodes.length; i++) { - var tmpFuncObj = flashObj.childNodes[i]; - if(typeof(tmpFuncObj) == 'function') { - funcObj = tmpFuncObj; - break; - } - } - } +// else { +// // Firefox (will be a child of the flash object) +// for(var i = 0; i < flashObj.childNodes.length; i++) { +// var tmpFuncObj = flashObj.childNodes[i]; +// if(typeof(tmpFuncObj) == 'function') { +// funcObj = tmpFuncObj; +// break; +// } +// } +// } // throw a error to Selenium if the exposed function could not be found if(funcObj == null) @@ -105,148 +101,98 @@ return this.callFlexMethod('getFlexProperty', ID, property); }; -Selenium.prototype.getFlexSelectedItemAtIndex = function(id) { - return this.callFlexMethod('getFlexSelectedItemAtIndex', id); +Selenium.prototype.doFlexAlertResponse = function(id, args) { + var retval = this.callFlexMethod('doFlexAlertResponse', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexNumSelectedItems = function(id) { - return this.callFlexMethod('getFlexNumSelectedItems', id); +Selenium.prototype.doFlexCheckBox = function(id, args) { + var retval = this.callFlexMethod('doFlexCheckBox', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexVisible = function(id) { - return this.callFlexMethod('getFlexVisible', id); +Selenium.prototype.doFlexClick = function(id, args) { + var retval = this.callFlexMethod('doFlexClick', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexTextPresent = function(id) { - return this.callFlexMethod('getFlexTextPresent', id); +Selenium.prototype.doFlexClickDataGridItem = function(id, args) { + var retval = this.callFlexMethod('doFlexClickDataGridItem', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexText = function(id) { - return this.callFlexMethod('getFlexText', id); +Selenium.prototype.doFlexClickDataGridUIComponent = function(id, args) { + var retval = this.callFlexMethod('doFlexClickDataGridUIComponent', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexStepper = function(id) { - return this.callFlexMethod('getFlexStepper', id); +Selenium.prototype.doFlexClickMenuBarUIComponent = function(id, args) { + var retval = this.callFlexMethod('doFlexClickMenuBarUIComponent', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexSelectionIndex = function(id) { - return this.callFlexMethod('getFlexSelectionIndex', id); +Selenium.prototype.doFlexDate = function(id, args) { + var retval = this.callFlexMethod('doFlexDate', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexSelection = function(id) { - return this.callFlexMethod('getFlexSelection', id); +Selenium.prototype.doFlexDoubleClick = function(id, args) { + var retval = this.callFlexMethod('doFlexDoubleClick', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexRadioButton = function(id) { - return this.callFlexMethod('getFlexRadioButton', id); +Selenium.prototype.doFlexDragTo = function(id, args) { + var retval = this.callFlexMethod('doFlexDragTo', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexParseInt = function(id) { - return this.callFlexMethod('getFlexParseInt', id); +Selenium.prototype.doFlexMouseDown = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseDown', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexNumeric = function(id) { - return this.callFlexMethod('getFlexNumeric', id); +Selenium.prototype.doFlexMouseMove = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseMove', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexGlobalPosition = function(id) { - return this.callFlexMethod('getFlexGlobalPosition', id); +Selenium.prototype.doFlexMouseOver = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseOver', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexExists = function(id) { - return this.callFlexMethod('getFlexExists', id); +Selenium.prototype.doFlexMouseRollOut = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseRollOut', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexErrorString = function(id) { - return this.callFlexMethod('getFlexErrorString', id); +Selenium.prototype.doFlexMouseRollOver = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseRollOver', id, args); + if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.getFlexEnabled = function(id) { - return this.callFlexMethod('getFlexEnabled', id); -}; - -Selenium.prototype.getFlexDate = function(id) { - return this.callFlexMethod('getFlexDate', id); -}; - -Selenium.prototype.getFlexDataGridUIComponentLabel = function(id) { - return this.callFlexMethod('getFlexDataGridUIComponentLabel', id); -}; - -Selenium.prototype.getFlexDataGridRowIndexForFieldValue = function(id) { - return this.callFlexMethod('getFlexDataGridRowIndexForFieldValue', id); -}; - -Selenium.prototype.getFlexDataGridRowCount = function(id) { - return this.callFlexMethod('getFlexDataGridRowCount', id); -}; - -Selenium.prototype.getFlexDataGridFieldValueForGridRow = function(id) { - return this.callFlexMethod('getFlexDataGridFieldValueForGridRow', id); -}; - -Selenium.prototype.getFlexDataGridCellText = function(id) { - return this.callFlexMethod('getFlexDataGridCellText', id); -}; - -Selenium.prototype.getFlexDataGridCell = function(id) { - return this.callFlexMethod('getFlexDataGridCell', id); -}; - -Selenium.prototype.getFlexComponentInfo = function(id) { - return this.callFlexMethod('getFlexComponentInfo', id); -}; - -Selenium.prototype.getFlexComboContainsLabel = function(id) { - return this.callFlexMethod('getFlexComboContainsLabel', id); -}; - -Selenium.prototype.getFlexCheckBoxChecked = function(id) { - return this.callFlexMethod('getFlexCheckBoxChecked', id); -}; - -Selenium.prototype.getFlexAlertTextPresent = function(id) { - return this.callFlexMethod('getFlexAlertTextPresent', id); -}; - -Selenium.prototype.getFlexAlertText = function(id) { - return this.callFlexMethod('getFlexAlertText', id); -}; - -Selenium.prototype.getFlexAlertPresent = function(id) { - return this.callFlexMethod('getFlexAlertPresent', id); -}; - -Selenium.prototype.getDataGridUIComponentLabel = function(id) { - return this.callFlexMethod('getDataGridUIComponentLabel', id); -}; - -Selenium.prototype.getDataGridCellText = function(id) { - return this.callFlexMethod('getDataGridCellText', id); -}; - -Selenium.prototype.doRefreshIDToolTips = function(id, args) { - var retval = this.callFlexMethod('doRefreshIDToolTips', id, args); +Selenium.prototype.doFlexMouseUp = function(id, args) { + var retval = this.callFlexMethod('doFlexMouseUp', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexWaitForElementVisible = function(id, args) { - var retval = this.callFlexMethod('doFlexWaitForElementVisible', id, args); +Selenium.prototype.doFlexProperty = function(id, args) { + var retval = this.callFlexMethod('doFlexProperty', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexWaitForElement = function(id, args) { - var retval = this.callFlexMethod('doFlexWaitForElement', id, args); +Selenium.prototype.doFlexRadioButton = function(id, args) { + var retval = this.callFlexMethod('doFlexRadioButton', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexTypeAppend = function(id, args) { - var retval = this.callFlexMethod('doFlexTypeAppend', id, args); +Selenium.prototype.doFlexSelect = function(id, args) { + var retval = this.callFlexMethod('doFlexSelect', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexType = function(id, args) { - var retval = this.callFlexMethod('doFlexType', id, args); +Selenium.prototype.doFlexSelectIndex = function(id, args) { + var retval = this.callFlexMethod('doFlexSelectIndex', id, args); if(retval != 'true') throw new SeleniumError(retval); }; @@ -255,132 +201,111 @@ if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSetFocus = function(id, args) { - var retval = this.callFlexMethod('doFlexSetFocus', id, args); +Selenium.prototype.doFlexType = function(id, args) { + var retval = this.callFlexMethod('doFlexType', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSetDataGridCell = function(id, args) { - var retval = this.callFlexMethod('doFlexSetDataGridCell', id, args); +Selenium.prototype.doFlexTypeAppend = function(id, args) { + var retval = this.callFlexMethod('doFlexTypeAppend', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelectMatchingOnField = function(id, args) { - var retval = this.callFlexMethod('doFlexSelectMatchingOnField', id, args); +Selenium.prototype.doFlexWaitForElement = function(id, args) { + var retval = this.callFlexMethod('doFlexWaitForElement', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelectIndex = function(id, args) { - var retval = this.callFlexMethod('doFlexSelectIndex', id, args); +Selenium.prototype.doFlexWaitForElementVisible = function(id, args) { + var retval = this.callFlexMethod('doFlexWaitForElementVisible', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelectComboByLabel = function(id, args) { - var retval = this.callFlexMethod('doFlexSelectComboByLabel', id, args); +Selenium.prototype.doFlexRefreshIDToolTips = function(id, args) { + var retval = this.callFlexMethod('doFlexRefreshIDToolTips', id, args); if(retval != 'true') throw new SeleniumError(retval); }; -Selenium.prototype.doFlexSelect = function(id, args) { - var retval = this.callFlexMethod('doFlexSelect', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexDataGridUIComponentLabel = function(id) { + return this.callFlexMethod('getFlexDataGridUIComponentLabel', id); }; -Selenium.prototype.doFlexRefreshIDToolTips = function(id, args) { - var retval = this.callFlexMethod('doFlexRefreshIDToolTips', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexAlertPresent = function(id) { + return this.callFlexMethod('getFlexAlertPresent', id); }; -Selenium.prototype.doFlexRadioButton = function(id, args) { - var retval = this.callFlexMethod('doFlexRadioButton', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexAlertText = function(id) { + return this.callFlexMethod('getFlexAlertText', id); }; -Selenium.prototype.doFlexProperty = function(id, args) { - var retval = this.callFlexMethod('doFlexProperty', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexAlertTextPresent = function(id) { + return this.callFlexMethod('getFlexAlertTextPresent', id); }; -Selenium.prototype.doFlexMouseUp = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseUp', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexCheckBoxChecked = function(id) { + return this.callFlexMethod('getFlexCheckBoxChecked', id); }; -Selenium.prototype.doFlexMouseRollOver = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseRollOver', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexComponentInfo = function(id) { + return this.callFlexMethod('getFlexComponentInfo', id); }; -Selenium.prototype.doFlexMouseRollOut = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseRollOut', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexDataGridCellText = function(id) { + return this.callFlexMethod('getFlexDataGridCellText', id); }; -Selenium.prototype.doFlexMouseOver = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseOver', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexDate = function(id) { + return this.callFlexMethod('getFlexDate', id); }; -Selenium.prototype.doFlexMouseMove = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseMove', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexEnabled = function(id) { + return this.callFlexMethod('getFlexEnabled', id); }; -Selenium.prototype.doFlexMouseDown = function(id, args) { - var retval = this.callFlexMethod('doFlexMouseDown', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexErrorString = function(id) { + return this.callFlexMethod('getFlexErrorString', id); }; -Selenium.prototype.doFlexDragTo = function(id, args) { - var retval = this.callFlexMethod('doFlexDragTo', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexExists = function(id) { + return this.callFlexMethod('getFlexExists', id); }; -Selenium.prototype.doFlexDoubleClick = function(id, args) { - var retval = this.callFlexMethod('doFlexDoubleClick', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexGlobalPosition = function(id) { + return this.callFlexMethod('getFlexGlobalPosition', id); }; -Selenium.prototype.doFlexDate = function(id, args) { - var retval = this.callFlexMethod('doFlexDate', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexNumeric = function(id) { + return this.callFlexMethod('getFlexNumeric', id); }; -Selenium.prototype.doFlexClickMenuBarUIComponent = function(id, args) { - var retval = this.callFlexMethod('doFlexClickMenuBarUIComponent', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexParseInt = function(id) { + return this.callFlexMethod('getFlexParseInt', id); }; -Selenium.prototype.doFlexClickDataGridUIComponent = function(id, args) { - var retval = this.callFlexMethod('doFlexClickDataGridUIComponent', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexRadioButton = function(id) { + return this.callFlexMethod('getFlexRadioButton', id); }; -Selenium.prototype.doFlexClickDataGridItem = function(id, args) { - var retval = this.callFlexMethod('doFlexClickDataGridItem', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexSelection = function(id) { + return this.callFlexMethod('getFlexSelection', id); }; -Selenium.prototype.doFlexClick = function(id, args) { - var retval = this.callFlexMethod('doFlexClick', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexSelectionIndex = function(id) { + return this.callFlexMethod('getFlexSelectionIndex', id); }; -Selenium.prototype.doFlexCheckBox = function(id, args) { - var retval = this.callFlexMethod('doFlexCheckBox', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexStepper = function(id) { + return this.callFlexMethod('getFlexStepper', id); }; -Selenium.prototype.doFlexAlertResponse = function(id, args) { - var retval = this.callFlexMethod('doFlexAlertResponse', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexText = function(id) { + return this.callFlexMethod('getFlexText', id); }; -Selenium.prototype.doFlexAddSelectMatchingOnField = function(id, args) { - var retval = this.callFlexMethod('doFlexAddSelectMatchingOnField', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexTextPresent = function(id) { + return this.callFlexMethod('getFlexTextPresent', id); }; -Selenium.prototype.doFlexAddSelectIndex = function(id, args) { - var retval = this.callFlexMethod('doFlexAddSelectIndex', id, args); - if(retval != 'true') throw new SeleniumError(retval); +Selenium.prototype.getFlexVisible = function(id) { + return this.callFlexMethod('getFlexVisible', id); }; Index: lams_tool_notebook/test/java/org/lamsfoundation/lams/tool/notebook/core/AbstractSeleniumTestCase.java =================================================================== diff -u -r0a314b9b262f6d298df203aeeb58da676732f6c2 -r4c4ca4df9cb08c3db920b7a4273a566883ac85b6 --- lams_tool_notebook/test/java/org/lamsfoundation/lams/tool/notebook/core/AbstractSeleniumTestCase.java (.../AbstractSeleniumTestCase.java) (revision 0a314b9b262f6d298df203aeeb58da676732f6c2) +++ lams_tool_notebook/test/java/org/lamsfoundation/lams/tool/notebook/core/AbstractSeleniumTestCase.java (.../AbstractSeleniumTestCase.java) (revision 4c4ca4df9cb08c3db920b7a4273a566883ac85b6) @@ -203,7 +203,7 @@ selenium.selectWindow(openToolId); return new HashMap() {{ - put("contentFolderID", "contentFolderID"); + put("contentFolderID", contentFolderID); put("toolContentID", toolContentID); }}; } @@ -215,7 +215,7 @@ //closes tool authoring screen selenium.click("//span[@class='okIcon']"); selenium.waitForPageToLoad("10000"); - selenium.click("//span[@class='close']"); + selenium.close(); //closes Flash authoring screen selenium.selectWindow("aWindow"); @@ -224,10 +224,12 @@ final String storeLearningDesignUrl = TestFrameworkConstants.WEB_APP_DIR + "servlet/authoring/storeLearningDesignDetails"; String designDetails = constructWddxDesign(contentDetails); - //if at some point in the future we decide to use Prototype instead of jQUery we should use this command -// selenium.runScript("var options = { " + "method:\"post\", " + "postBody:\"" + designDetails + "\" " + "};" -// + "new Ajax.Request(\"" + storeLearningDesignUrl + "\",options);"); - selenium.runScript("$.post(\"" + storeLearningDesignUrl + "\", \"" + designDetails + "\");"); + //callback function is aimed to let Selenium wait till StoreLDServlet finishes its work + selenium.runScript("$.post(\"" + storeLearningDesignUrl + "\", " + + "\"" + designDetails + "\", " + + "function(data){ return data; }" + + ");"); + selenium.selectWindow(null); } /** @@ -244,6 +246,7 @@ Integer workspaceFolderID = workspace.getDefaultFolder().getWorkspaceFolderId(); List titles = learningDesignDAO.getLearningDesignTitlesByWorkspaceFolder(workspaceFolderID); assertTrue("There is no stored learning design", titles.size() > 0); + //TODO receive sorted titles list from the server because if LD was imported it's not sorted alphabetically Collections.sort(titles, String.CASE_INSENSITIVE_ORDER); int count = 1; for (String title : titles) { @@ -252,7 +255,7 @@ } count++; } - assertTrue("There isn't learning design with name" + learningDesignName,count <= titles.size()); + assertTrue("There isn't learning design with name " + learningDesignName,count <= titles.size()); flexSelenium.click("link=Add Lesson"); Thread.sleep(6000); @@ -333,7 +336,7 @@ selenium.open(TestFrameworkConstants.WEB_APP_DIR); selenium.type("j_username", TestFrameworkConstants.USER_LOGIN); selenium.type("j_password", TestFrameworkConstants.USER_PASSWORD); - selenium.click("//p[@class='login-button']/a"); + selenium.click("link=Login"); selenium.waitForPageToLoad("10000"); Thread.sleep(3000); } @@ -343,7 +346,7 @@ // ***************************************************************************** /** - * Waits till element will be present on a page. + * Waits till element will be presented on a page. * * @param locator - an element locator * @throws InterruptedException @@ -427,41 +430,43 @@ } /** - * Given a WDDX packet in our normal format, gets the id number from within + * Given a WDDX packet in our normal format, gets the content folder from within * the <var - * name='messageValue'><number>num</number></var> + * name='messageValue'><string>num</string></var> * * @param wddxPacket * @return id */ private String extractFolderIDFromWDDXPacket(String wddxPacket) { - int indexMessageValue = wddxPacket.indexOf(""); + wddxPacket = wddxPacket.toLowerCase(); + int indexMessageValue = wddxPacket.indexOf(""); assertTrue(" string not found", indexMessageValue > 0); int endIndexMessageValue = wddxPacket.indexOf("", indexMessageValue); return wddxPacket.substring(indexMessageValue - + "".length(), endIndexMessageValue); + + "".length(), endIndexMessageValue); } /** - * Given a WDDX packet in our normal format, gets the id number from within + * Given a WDDX packet in our normal format, gets the tool content id from within * the <var * name='messageValue'><number>num</number></var> * * @param wddxPacket * @return id */ private String extractToolContentIDFromWDDXPacket(String wddxPacket) { - int indexMessageValue = wddxPacket.indexOf(""); - assertTrue(wddxPacket + "!! string not found", indexMessageValue > 0); + wddxPacket = wddxPacket.toLowerCase(); + int indexMessageValue = wddxPacket.indexOf(""); + assertTrue(" string not found", indexMessageValue > 0); int endIndexMessageValue = wddxPacket.indexOf(".0", indexMessageValue); String idString = wddxPacket.substring(indexMessageValue - + "".length(), + + "".length(), endIndexMessageValue); try { Long.parseLong(idString); return idString; } catch (NumberFormatException e) { - fail("Unable to get id number from WDDX packet. Format exception. String was " + fail("Unable to get toolContentID from WDDX packet. Format exception. String was " + idString); } return null; Index: lams_tool_notebook/test/java/org/lamsfoundation/lams/tool/notebook/core/TestFrameworkConstants.java =================================================================== diff -u -r0a314b9b262f6d298df203aeeb58da676732f6c2 -r4c4ca4df9cb08c3db920b7a4273a566883ac85b6 --- lams_tool_notebook/test/java/org/lamsfoundation/lams/tool/notebook/core/TestFrameworkConstants.java (.../TestFrameworkConstants.java) (revision 0a314b9b262f6d298df203aeeb58da676732f6c2) +++ lams_tool_notebook/test/java/org/lamsfoundation/lams/tool/notebook/core/TestFrameworkConstants.java (.../TestFrameworkConstants.java) (revision 4c4ca4df9cb08c3db920b7a4273a566883ac85b6) @@ -30,7 +30,7 @@ /** the port on which the Selenium Server is listening */ public static final int SERVER_PORT = 5555; /** - * the command string used to launch the browser, e.g. "firefox" or + * the command string used to launch the browser, e.g. "*firefox", "*iexplore" or * "c:\\program files\\internet explorer\\iexplore.exe" */ public static final String BROWSER = "*firefox";