Author: erwan
Date: Fri Apr 15 13:55:38 2011 New Revision: 1092706 URL: http://svn.apache.org/viewvc?rev=1092706&view=rev Log: Now OFBiz is able to run HTML selenium testsuites. Non specific java code is coming from SeleniumHtmlClient (https://github.com/takamori/selenium-html-client-driver) which is under the Apache2 license. A testsuite is provided with the commit, just go to the selenium webtools' page, and execute it. For now, you still need to change the url.properties file, and start the selenium server. Added: ofbiz/trunk/framework/example/testdef/selenium/ ofbiz/trunk/framework/example/testdef/selenium/NewExample.html (with props) ofbiz/trunk/framework/example/testdef/selenium/testSuite.html ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/selenium/ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/selenium/SeleniumHtml.java Modified: ofbiz/trunk/framework/example/data/ExampleDemoData.xml ofbiz/trunk/framework/testtools/webapp/testtools/WEB-INF/controller.xml ofbiz/trunk/framework/testtools/widget/RunSeleniumForms.xml Modified: ofbiz/trunk/framework/example/data/ExampleDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/data/ExampleDemoData.xml?rev=1092706&r1=1092705&r2=1092706&view=diff ============================================================================== --- ofbiz/trunk/framework/example/data/ExampleDemoData.xml (original) +++ ofbiz/trunk/framework/example/data/ExampleDemoData.xml Fri Apr 15 13:55:38 2011 @@ -66,4 +66,5 @@ under the License. <!-- example test suite --> <SeleniumTestSuitePath testSuiteId="EXAMPLE_TESTSUITE" testSuiteName="example_testsuite" testSuiteType="XML" testSuitePath="framework/testtools/testdef/seleniumxml/example/example_testsuite.xml" description="test suite for example component"/> + <SeleniumTestSuitePath testSuiteId="EX_HTML_TESTSUITE" testSuiteName="example_html_testsuite" testSuiteType="HTML" testSuitePath="framework/example/testdef/selenium/testSuite.html" description="HTML test suite for example component"/> </entity-engine-xml> Added: ofbiz/trunk/framework/example/testdef/selenium/NewExample.html URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/testdef/selenium/NewExample.html?rev=1092706&view=auto ============================================================================== --- ofbiz/trunk/framework/example/testdef/selenium/NewExample.html (added) +++ ofbiz/trunk/framework/example/testdef/selenium/NewExample.html Fri Apr 15 13:55:38 2011 @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>NewExample</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">NewFeature</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/example/control/setSessionLocale?newLocale=en</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/example/control/logout</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>USERNAME</td> + <td>admin</td> +</tr> +<tr> + <td>type</td> + <td>PASSWORD</td> + <td>ofbiz</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>//input[@value='Login']</td> + <td></td> +</tr> +<tr> + <td>assertTitle</td> + <td>OFBiz: Example: Find Example</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/example/control/FindExample?portalPageId=Example</td> + <td></td> +</tr> +<tr> + <td>waitForTextPresent</td> + <td>New Example</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>link=New Example</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>EditExample_statusId</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>EditExample_statusId</td> + <td>label=Defined</td> +</tr> +<tr> + <td>type</td> + <td>EditExample_exampleName</td> + <td>New Example 1</td> +</tr> +<tr> + <td>type</td> + <td>EditExample_description</td> + <td>This is a description</td> +</tr> +<tr> + <td>type</td> + <td>EditExample_longDescription</td> + <td>Long description goes here</td> +</tr> +<tr> + <td>type</td> + <td>EditExample_comments</td> + <td>comments go here</td> +</tr> +<tr> + <td>type</td> + <td>EditExample_exampleSize</td> + <td>10</td> +</tr> +<tr> + <td>click</td> + <td>//button[@class='ui-datepicker-trigger'][1]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>//button[contains(text(),'Now')]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>//button[contains(text(),'Done')]</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>EditExample_anotherText</td> + <td>label=Contrived</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>submitButton</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>//div[@id='search-results']//a[@class='buttontext']</td> + <td></td> +</tr> +<tr> + <td>clickAndWait</td> + <td>//div[@id='search-results']//a[@class='buttontext']</td> + <td></td> +</tr> +<tr> + <td>clickAndWait</td> + <td>link=Items</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>description</td> + <td>Item 1</td> +</tr> +<tr> + <td>type</td> + <td>amount</td> + <td>100</td> +</tr> +<tr> + <td>select</td> + <td>amountUomId</td> + <td>label=Weight: Stone (st)</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>//input[@name='submitButton' and @value='Add']</td> + <td></td> +</tr> +<tr> + <td>assertConfirmation</td> + <td>Do you confirm ?</td> + <td></td> +</tr> +<tr> + <td>clickAndWait</td> + <td>link=Example</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/example/control/logout</td> + <td></td> +</tr> +</tbody></table> +</body> +</html> Propchange: ofbiz/trunk/framework/example/testdef/selenium/NewExample.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/example/testdef/selenium/NewExample.html ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/example/testdef/selenium/NewExample.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: ofbiz/trunk/framework/example/testdef/selenium/testSuite.html URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/testdef/selenium/testSuite.html?rev=1092706&view=auto ============================================================================== --- ofbiz/trunk/framework/example/testdef/selenium/testSuite.html (added) +++ ofbiz/trunk/framework/example/testdef/selenium/testSuite.html Fri Apr 15 13:55:38 2011 @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> + <title>Test Suite</title> +</head> +<body> +<table id="suiteTable" cellpadding="1" cellspacing="1" border="1" class="selenium"><tbody> +<tr><td><b>Test Suite</b></td></tr> +<tr><td><a href="NewExample.html">new example</a></td></tr> +</tbody></table> +</body> +</html> Added: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/selenium/SeleniumHtml.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/selenium/SeleniumHtml.java?rev=1092706&view=auto ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/selenium/SeleniumHtml.java (added) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/selenium/SeleniumHtml.java Fri Apr 15 13:55:38 2011 @@ -0,0 +1,383 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ofbiz.testtools.selenium; + +import com.thoughtworks.selenium.CommandProcessor; +import com.thoughtworks.selenium.HttpCommandProcessor; +import com.thoughtworks.selenium.SeleniumException; +import javolution.util.FastList; +import javolution.util.FastMap; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilGenerics; +import org.ofbiz.base.util.UtilHttp; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.lang.reflect.Method; +import java.util.*; + +public class SeleniumHtml { + public static final String module = SeleniumHtml.class.getName(); + private static Properties props; + public String host; + public int port; + public String browser; + public String baseUrl; + + Document document; + CommandProcessor commandProcessor; + + class TestSuite { + public File file; + public String name; + public Test tests[]; + public boolean result; + } + class Test { + public String label; + public File file; + public String name; + public Command commands[]; + public boolean result; + } + class Command { + public String cmd; + public String args[]; + public String result; + public boolean error; + public boolean failure; + } + + public SeleniumHtml() { + } + + public void setHost(String host) { + this.host = host; + } + + public void setPort(int port) { + this.port = port; + } + + public void setBrowser(String browser) { + this.browser = browser; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } + + public static String runHtmlTestSuite(HttpServletRequest request, HttpServletResponse response) throws Exception { + Map parameters = UtilHttp.getParameterMap(request); + String para = (String) parameters.get("testSuitePath"); + props = new Properties(); + + try { + SeleniumHtml client = new SeleniumHtml(); + client.host = props.getProperty("serverHost", "localhost"); + client.port = Integer.parseInt(props.getProperty("proxyPort", "4444")); + client.browser = props.getProperty("browser", "*firefox"); + client.baseUrl = props.getProperty("startUrl", "http://localhost:8080"); + + if (Debug.infoOn()) { + Debug.logInfo("Parameters used for selenium: host: " + client.host + + ", port: " + client.port + ", browser: " + client.browser + + ", baseUrl: " + client.baseUrl, module); + } + + File testFile = new File(para.trim()); + if (testFile.exists()) { + if (Debug.infoOn()) Debug.logInfo("Running this testsuite: " + testFile.getAbsolutePath(), module); + + Map results = client.runSuite(testFile.getAbsolutePath()); + if ("true".equals(results.get("status").toString())) { + request.setAttribute("_EVENT_MESSAGE_LIST_", results.get("logs")); + } else { + request.setAttribute("_ERROR_MESSAGE_LIST_", results.get("logs")); + } + } + } catch (Exception e) { + Debug.logError(e.getMessage(), module); + return "error"; + } + return "success"; + } + + public Map runSuite(String filename) throws Exception { + TestSuite suite = new TestSuite(); + suite.file = new File(filename); + File suiteDirectory = suite.file.getParentFile(); + this.document = parseDocument(filename); + Element table = (Element) this.document.getElementsByTagName("table").item(0); + NodeList tableRows = table.getElementsByTagName("tr"); + Element tableNameRow = (Element) tableRows.item(0); + suite.name = tableNameRow.getTextContent(); + suite.result = true; + suite.tests = new Test[tableRows.getLength() - 1]; + + Map<String, Object> results = FastMap.newInstance(); + List<String> messages = FastList.newInstance(); + Map testResults; + + for (int i = 1; i < tableRows.getLength(); i++) { + Element tableRow = (Element) tableRows.item(i); + Element cell = (Element) tableRow.getElementsByTagName("td").item(0); + Element link = (Element) cell.getElementsByTagName("a").item(0); + Test test = new Test(); + test.label = link.getTextContent(); + test.file = new File(suiteDirectory, link.getAttribute("href")); + + SeleniumHtml subclient = new SeleniumHtml(); + subclient.setHost(this.host); + subclient.setPort(this.port); + subclient.setBrowser(this.browser); + subclient.setBaseUrl(this.baseUrl); + testResults = subclient.runTest(test); + suite.result &= test.result; + suite.tests[i - 1] = test; + messages = UtilGenerics.checkList(testResults.get("log")); + } + + results.put("logs", messages); + results.put("status", suite.result); + return results; + } + + public Map runTest(Test test) throws Exception { + String filename = test.file.toString(); + List<String> messages = FastList.newInstance(); + + if (Debug.infoOn()) { + Debug.logInfo("Running " + filename + " against " + this.host + ":" + this.port + " with " + this.browser, module); + } + this.document = parseDocument(filename); + + if (this.baseUrl == null) { + NodeList links = this.document.getElementsByTagName("link"); + if (links.getLength() != 0) { + Element link = (Element) links.item(0); + setBaseUrl(link.getAttribute("href")); + } + } + if (Debug.infoOn()) { + Debug.logInfo("Base URL=" + this.baseUrl, module); + } + + Node body = this.document.getElementsByTagName("body").item(0); + Element resultContainer = document.createElement("div"); + resultContainer.setTextContent("Result: "); + Element resultElt = document.createElement("span"); + resultElt.setAttribute("id", "result"); + resultElt.setIdAttribute("id", true); + resultContainer.appendChild(resultElt); + body.insertBefore(resultContainer, body.getFirstChild()); + + Element executionLogContainer = document.createElement("div"); + executionLogContainer.setTextContent("Execution Log:"); + Element executionLog = document.createElement("div"); + executionLog.setAttribute("id", "log"); + executionLog.setIdAttribute("id", true); + executionLog.setAttribute("style", "white-space: pre;"); + executionLogContainer.appendChild(executionLog); + body.appendChild(executionLogContainer); + + NodeList tableRows = document.getElementsByTagName("tr"); + Element theadRow = (Element) tableRows.item(0); + test.name = theadRow.getTextContent(); + + this.commandProcessor = new HtmlCommandProcessor(this.host, this.port, this.browser, this.baseUrl); + String resultState; + String resultLog; + test.result = true; + try { + this.commandProcessor.start(); + test.commands = new Command[tableRows.getLength() - 1]; + for (int i = 1; i < tableRows.getLength(); i++) { + Element stepRow = (Element) tableRows.item(i); + Command command = executeStep(stepRow); + messages.add(command.result + " --> " + command.cmd + " " + Arrays.asList(command.args)); + + test.commands[i - 1] = command; + if (command.error) { + test.result = false; + } + if (command.failure) { + test.result = false; + break; + } + } + resultState = test.result ? "PASSED" : "FAILED"; + resultLog = (test.result ? "Test Complete" : "Error"); + this.commandProcessor.stop(); + } catch (Exception e) { + test.result = false; + resultState = "ERROR"; + resultLog = "Failed to initialize session\n" + e; + e.printStackTrace(); + } + document.getElementById("result").setTextContent(resultState); + Element log = document.getElementById("log"); + log.setTextContent(log.getTextContent() + resultLog + "\n"); + + Map<String, Object> results = FastMap.newInstance(); + results.put("log", messages); + + return results; + } + + public Command executeStep(Element stepRow) throws Exception { + Command command = new Command(); + NodeList stepFields = stepRow.getElementsByTagName("td"); + String cmd = stepFields.item(0).getTextContent().trim(); + command.cmd = cmd; + ArrayList<String> argList = new ArrayList<String>(); + if (stepFields.getLength() == 1) { + // skip comments + command.result = "OK"; + return command; + } + for (int i = 1; i < stepFields.getLength(); i++) { + String content = stepFields.item(i).getTextContent(); + content = content.replaceAll(" +", " "); + content = content.replace('\u00A0', ' '); + content = content.trim(); + argList.add(content); + } + String args[] = argList.toArray(new String[0]); + command.args = args; + if (Debug.infoOn()) { + Debug.logInfo(cmd + " " + Arrays.asList(args), module); + } + try { + command.result = this.commandProcessor.doCommand(cmd, args); + command.error = false; + } catch (Exception e) { + command.result = e.getMessage(); + command.error = true; + } + command.failure = command.error && !cmd.startsWith("verify"); + return command; + } + + Document parseDocument(String filename) throws Exception { + FileReader reader = new FileReader(filename); + String firstLine = new BufferedReader(reader).readLine(); + reader.close(); + Document document = null; + if (firstLine.startsWith("<?xml")) { + Debug.logInfo("XML detected; using default XML parser.", module); + } else { + try { + Class nekoParserClass = Class.forName("org.cyberneko.html.parsers.DOMParser"); + Object parser = nekoParserClass.newInstance(); + Method parse = nekoParserClass.getMethod("parse", new Class[] { String.class }); + Method getDocument = nekoParserClass.getMethod("getDocument", new Class[0]); + parse.invoke(parser, filename); + document = (Document) getDocument.invoke(parser); + } catch (Exception e) { + Debug.logInfo("NekoHTML HTML parser not found; HTML4 support disabled.", module); + } + } + if (document == null) { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + try { // http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic + factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + } + catch (ParserConfigurationException e) { + Debug.logInfo("Warning: Could not disable external DTD loading", module); + } + DocumentBuilder builder = factory.newDocumentBuilder(); + document = builder.parse(filename); + } + return document; + } + + class HtmlCommandProcessor extends HttpCommandProcessor { + final static String INDEX_SPECIFIER = "index="; + final static String ID_SPECIFIER = "id="; + final static String LABEL_SPECIFIER = "label="; + final static String VALUE_SPECIFIER = "value="; + + boolean expectError; + + public HtmlCommandProcessor(String host, int port, String browser, String baseUrl) { + super(host, port, browser, baseUrl); + } + + public String doCommand(String cmd, String args[]) { + if (cmd.equals("store")) { + cmd += "Expression"; + } else if (cmd.equals("assertSelected") || cmd.equals("verifySelected")) { + if (args[1].startsWith(INDEX_SPECIFIER)) { + cmd += "Index"; + args[1] = args[1].substring(INDEX_SPECIFIER.length()); + } else if (args[1].startsWith(ID_SPECIFIER)) { + cmd += "Id"; + args[1] = args[1].substring(ID_SPECIFIER.length()); + } else if (args[1].startsWith(LABEL_SPECIFIER)) { + cmd += "Label"; + args[1] = args[1].substring(LABEL_SPECIFIER.length()); + } else if (args[1].startsWith(VALUE_SPECIFIER)) { + cmd += "Value"; + args[1] = args[1].substring(VALUE_SPECIFIER.length()); + } else { + cmd += "Label"; + } + } else if (cmd.endsWith("ErrorOnNext") || cmd.endsWith("FailureOnNext")) { + expectError = true; + return "OK"; + } else if (cmd.equals("echo")) { + return "OK," + args[0]; + } else if (cmd.equals("pause")) { + try { + Thread.sleep(Integer.parseInt(args[0])); + return "OK"; + } catch (InterruptedException e) { + return "ERROR: pause interrupted"; + } + } + try { + String result = super.doCommand(cmd, args); + if (expectError) { + throw new SeleniumException("ERROR: Error expected"); + } else { + return result; + } + } catch (SeleniumException e) { + if (expectError) { + expectError = false; + return "OK"; + } else { + throw e; + } + } + } + } +} Modified: ofbiz/trunk/framework/testtools/webapp/testtools/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/webapp/testtools/WEB-INF/controller.xml?rev=1092706&r1=1092705&r2=1092706&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/webapp/testtools/WEB-INF/controller.xml (original) +++ ofbiz/trunk/framework/testtools/webapp/testtools/WEB-INF/controller.xml Fri Apr 15 13:55:38 2011 @@ -68,6 +68,12 @@ <security https="true" auth="true"/> <response name="success" type="request" value="selenium"/> </request-map> + + <request-map uri="runHtmlSuite"> + <event type="java" path="org.ofbiz.testtools.selenium.SeleniumHtml" invoke="runHtmlTestSuite"/> + <response name="success" type="view" value="selenium" /> + <response name="error" type="view" value="selenium" /> + </request-map> <!-- selenium Test Case --> <view-map name="selenium" type="screen" page="component://testtools/widget/CommonScreens.xml#selenium"/> Modified: ofbiz/trunk/framework/testtools/widget/RunSeleniumForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/widget/RunSeleniumForms.xml?rev=1092706&r1=1092705&r2=1092706&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/widget/RunSeleniumForms.xml (original) +++ ofbiz/trunk/framework/testtools/widget/RunSeleniumForms.xml Fri Apr 15 13:55:38 2011 @@ -23,13 +23,16 @@ <form name="editSeleniumTestSuitePath" target="updateSeleniumTestSuitePath" type="single" title="Add new selenium test suite" default-map-name="testSuitePath" header-row-style="header-row" default-table-style="basic-table"> - - <!--alt-target use-when="testSuitePath==null" target="createSeleniumTestSuitePath"/--> - - <field name="testSuiteId" use-when="testSuitePath == null"><text></text></field> - <field name="testSuiteId" use-when="testSuitePath != null"><display></display></field> - <field name="testSuiteName"><text></text></field> - <field name="testSuitePath"><text></text></field> + <field name="testSuiteId" use-when="testSuitePath == null"><text/></field> + <field name="testSuiteId" use-when="testSuitePath != null"><display/></field> + <field name="testSuiteName"><text/></field> + <field name="testSuiteType"> + <drop-down allow-empty="false"> + <option key="XML" description="XML"/> + <option key="HTML" description="HTML"/> + </drop-down> + </field> + <field name="testSuitePath"><text/></field> <field name="description"><textarea rows="3"/></field> <field name="submitButton" title=""><submit button-type="button"/></field> </form> @@ -41,16 +44,24 @@ <parameter param-name="testSuiteId"/> </hyperlink> </field> - <field name="testSuiteName"><display></display></field> - <field name="testSuitePath"><display></display></field> - <field name="description"><display></display></field> - - <field name="runTest" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> + <field name="testSuiteName"><display/></field> + <field name="testSuitePath"><display/></field> + <field name="description"><display/></field> + <field name="testSuiteType"><display/></field> + <field name="runTest" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext" + use-when=""XML".equals(testSuiteType)"> <hyperlink target="runTestSuite" description="${uiLabelMap.CommonRun}"> <parameter param-name="testSuiteId"/> <parameter param-name="testSuitePath" /> </hyperlink> </field> + <field name="runTest" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext" + use-when=""HTML".equals(testSuiteType)"> + <hyperlink target="runHtmlSuite" description="${uiLabelMap.CommonRun}"> + <parameter param-name="testSuiteId"/> + <parameter param-name="testSuitePath"/> + </hyperlink> + </field> <field name="remove" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> <hyperlink target="removeSeleniumTestSuitePath" description="${uiLabelMap.CommonDelete}"> <parameter param-name="testSuiteId"/> |
Free forum by Nabble | Edit this page |