\ No newline at end of file
Index: framework/webtools/webapp/webtools/WEB-INF/actions/selenium/testList.bsh
===================================================================
--- framework/webtools/webapp/webtools/WEB-INF/actions/selenium/testList.bsh (revision 0)
+++ framework/webtools/webapp/webtools/WEB-INF/actions/selenium/testList.bsh (revision 0)
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+import java.util.Iterator;
+import java.util.List;
+import java.util.LinkedList;
+
+import org.ofbiz.base.component.ComponentConfig;
+import org.ofbiz.base.config.GenericConfigException;
+import org.ofbiz.base.config.ResourceHandler;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.testtools.ModelTestSuite;
+import org.ofbiz.testtools.SeleniumTest;
+import org.ofbiz.base.util.UtilMisc;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javolution.util.FastList;
+
+String module = "selenium.bsh";
+
+List seleniumTests = FastList.newInstance();
+List testSuiteInfoList = ComponentConfig.getAllTestSuiteInfos();
+Iterator testSuiteInfoIter = testSuiteInfoList.iterator();
+List modelTestSuiteList = FastList.newInstance();
+String suiteName = "";
+suiteName = request.getParameter("suite");
+while (testSuiteInfoIter.hasNext()) {
+ ComponentConfig.TestSuiteInfo testSuiteInfo = (ComponentConfig.TestSuiteInfo) testSuiteInfoIter.next();
+
+ ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();
+ try {
+ Document testSuiteDocument = testSuiteResource.getDocument();
+ Element documentElement = testSuiteDocument.getDocumentElement();
+ ModelTestSuite modelTestSuite = new ModelTestSuite(documentElement);
+ if(modelTestSuite.getSuiteName().equals(suiteName)){
+ List webTestList = modelTestSuite.getWebTestList();
+ Iterator webTestListItr = webTestList.iterator();
+ while(webTestListItr.hasNext()){
+ webTest = webTestListItr.next();
+ if(webTest instanceof SeleniumTest){
+ seleniumTests.add(UtilMisc.toMap("caseName", webTest.getCaseName(), "casePath", webTest.getTestPath()));
+ }
+ }
+ }
+ } catch (GenericConfigException e) {
+ String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
+ Debug.logError(e, errMsg, module);
+ }
+}
+context.put("seleniumTests",seleniumTests);
+context.put("suiteName",suiteName);
Index: framework/webtools/webapp/webtools/WEB-INF/actions/selenium/getRegressionTest.bsh
===================================================================
--- framework/webtools/webapp/webtools/WEB-INF/actions/selenium/getRegressionTest.bsh (revision 0)
+++ framework/webtools/webapp/webtools/WEB-INF/actions/selenium/getRegressionTest.bsh (revision 0)
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+import java.util.Iterator;
+import java.util.List;
+import java.util.LinkedList;
+
+import org.ofbiz.base.component.ComponentConfig;
+import org.ofbiz.base.config.GenericConfigException;
+import org.ofbiz.base.config.ResourceHandler;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.testtools.ModelTestSuite;
+import org.ofbiz.testtools.SeleniumTest;
+import org.ofbiz.base.util.UtilMisc;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javolution.util.FastList;
+
+String module = "selenium.bsh";
+
+List testSuiteInfoList = ComponentConfig.getAllTestSuiteInfos();
+Iterator testSuiteInfoIter = testSuiteInfoList.iterator();
+List modelTestSuiteList = FastList.newInstance();
+String suiteName = "";
+suiteName = request.getParameter("suiteName");
+String caseName = "";
+caseName = request.getParameter("caseName");
+while (testSuiteInfoIter.hasNext()) {
+ ComponentConfig.TestSuiteInfo testSuiteInfo = (ComponentConfig.TestSuiteInfo) testSuiteInfoIter.next();
+ ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();
+ try {
+ Document testSuiteDocument = testSuiteResource.getDocument();
+ Element documentElement = testSuiteDocument.getDocumentElement();
+ ModelTestSuite modelTestSuite = new ModelTestSuite(documentElement);
+ if(modelTestSuite.getSuiteName().equals(suiteName)){
+ List webTestList = modelTestSuite.getWebTestList();
+ Iterator webTestListItr = webTestList.iterator();
+ while(webTestListItr.hasNext()){
+ webTest = webTestListItr.next();
+ if(webTest instanceof SeleniumTest){
+ if(webTest.getCaseName().equals(caseName)){
+ context.put("casePath", webTest.getTestPath());
+ }
+ }
+ }
+ }
+ } catch (GenericConfigException e) {
+ String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
+ Debug.logError(e, errMsg, module);
+ }
+}
Index: framework/webtools/webapp/webtools/WEB-INF/actions/selenium/selenium.bsh
===================================================================
--- framework/webtools/webapp/webtools/WEB-INF/actions/selenium/selenium.bsh (revision 0)
+++ framework/webtools/webapp/webtools/WEB-INF/actions/selenium/selenium.bsh (revision 0)
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+import java.util.Iterator;
+import java.util.List;
+import java.util.LinkedList;
+
+import org.ofbiz.base.component.ComponentConfig;
+import org.ofbiz.base.config.GenericConfigException;
+import org.ofbiz.base.config.ResourceHandler;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.testtools.ModelTestSuite;
+import org.ofbiz.testtools.SeleniumTest;
+import org.ofbiz.base.util.UtilMisc;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javolution.util.FastList;
+
+String module = "selenium.bsh";
+
+List testSuites = FastList.newInstance();
+List testSuiteInfoList = ComponentConfig.getAllTestSuiteInfos();
+Iterator testSuiteInfoIter = testSuiteInfoList.iterator();
+List modelTestSuiteList = FastList.newInstance();
+while (testSuiteInfoIter.hasNext()) {
+ ComponentConfig.TestSuiteInfo testSuiteInfo = (ComponentConfig.TestSuiteInfo) testSuiteInfoIter.next();
+
+ ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();
+ try {
+ Document testSuiteDocument = testSuiteResource.getDocument();
+ Element documentElement = testSuiteDocument.getDocumentElement();
+ ModelTestSuite modelTestSuite = new ModelTestSuite(documentElement);
+ if(modelTestSuite.getWebTestList().size()>0){
+ testSuites.add(modelTestSuite.getSuiteName());
+ modelTestSuiteList.add(modelTestSuite);
+ }
+ } catch (GenericConfigException e) {
+ String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
+ Debug.logError(e, errMsg, module);
+ }
+}
+context.put("testSuites",testSuites);
\ No newline at end of file
Index: framework/webtools/webapp/webtools/WEB-INF/controller.xml
===================================================================
--- framework/webtools/webapp/webtools/WEB-INF/controller.xml (revision 514971)
+++ framework/webtools/webapp/webtools/WEB-INF/controller.xml (working copy)
@@ -517,6 +517,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -589,5 +623,15 @@
+
+
+
+
+
+
+
+
+
+
Index: framework/webtools/webapp/webtools/main.ftl
===================================================================
--- framework/webtools/webapp/webtools/main.ftl (revision 514971)
+++ framework/webtools/webapp/webtools/main.ftl (working copy)
@@ -121,6 +121,11 @@
#if>