Permalink
Browse files

Added a run.cfm file to run all cf9 tests via the html runner

Broke the browser startup tests into two test cases
Updated .gitignore to ignore the folder created by Se-RC when starting Safari
  • Loading branch information...
1 parent 59fcc90 commit 78a2df00f68d209854fee19d482d8782511eccf8 @bobsilverberg bobsilverberg committed Jun 22, 2011
Showing with 73 additions and 19 deletions.
  1. +1 −1 .gitignore
  2. +44 −0 test/cf9/run.cfm
  3. +4 −18 test/cf9/seleniumStartupTest.cfc
  4. +24 −0 test/cf9/seleniumStartup_WindowsVMTest.cfc
View
@@ -2,4 +2,4 @@
.project
.settings/
settings.xml
-
+Selenium-RC/"
View
@@ -0,0 +1,44 @@
+<!---
+NOTE: these tests take a long time to run. A lot of the time is in a subset of tests that use CF's built-in component explorer, which is a pig. In addition, the EXT output is slower than the HTML output.
+
+--->
+<cfsetting requesttimeout="300">
+
+
+<cfparam name="url.output" default="extjs">
+<cfparam name="url.debug" default="false">
+<cfparam name="url.quiet" default="false">
+
+<cfset dir = getDirectoryFromPath(getCurrentTemplatePath()) />
+<cfset DTS = createObject("component","mxunit.runner.DirectoryTestSuite")>
+
+
+<cfset excludes = "fixture">
+
+<cfinvoke component="#DTS#"
+ method="run"
+ directory="#dir#"
+ componentpath="cfselenium.test.cf9"
+ recurse="true"
+ excludes="#excludes#"
+ returnvariable="Results">
+
+<cfif not url.quiet>
+
+ <cfif NOT StructIsEmpty(DTS.getCatastrophicErrors())>
+ <cfdump var="#DTS.getCatastrophicErrors()#" expand="false" label="#StructCount(DTS.getCatastrophicErrors())# Catastrophic Errors">
+ </cfif>
+
+ <cfsetting showdebugoutput="true">
+ <cfoutput>#results.getResultsOutput(url.output)#</cfoutput>
+
+ <cfif isBoolean(url.debug) AND url.debug>
+ <div class="bodypad">
+ <cfdump var="#results.getResults()#" label="Debug">
+ </div>
+ </cfif>
+
+</cfif>
+
+<!---
+<cfdump var="#results.getDebug()#"> --->
@@ -4,6 +4,10 @@ component extends="cfselenium.CFSeleniumTestCase" {
selenium = createObject("component", "cfselenium.selenium").init();
browserUrl = "http://wiki.mxunit.org/";
}
+
+ function tearDown() {
+ selenium.stop();
+ }
function shouldBeAbleToStartFirefox() {
selenium.start(browserUrl,"*firefox");
@@ -17,23 +21,5 @@ component extends="cfselenium.CFSeleniumTestCase" {
selenium.start(browserUrl,"*googlechrome");
}
- function shouldBeAbleToStartIEOnWindowsVM() {
- hostname = "192.168.56.101";
- selenium = createobject("component","cfselenium.selenium").init(hostname, 4444);
- assertTrue(len(selenium.getSessionId()) eq 0);
- selenium.start(browserUrl, "*iexplore");
- assertFalse(len(selenium.getSessionId()) eq 0);
- }
-
- /* errors from Windows, but it is attempting to start a browser anyway
- function shouldBeAbleToStartFirefoxWindowsVM() {
- hostname = "192.168.56.101";
- selenium = createobject("component","selenium").init(browserUrl,hostname, 4444, "*firefox");
- assertTrue(len(selenium.getSessionId()) eq 0);
- selenium.start();
- assertFalse(len(selenium.getSessionId()) eq 0);
- }
- */
-
}
@@ -0,0 +1,24 @@
+component extends="cfselenium.CFSeleniumTestCase" {
+
+ function beforeTests() {
+ hostname = "192.168.56.101";
+ selenium = createobject("component","cfselenium.selenium").init(hostname, 4444);
+ browserUrl = "http://wiki.mxunit.org/";
+ }
+
+ function shouldBeAbleToStartIEOnWindowsVM() {
+ assertTrue(len(selenium.getSessionId()) eq 0);
+ selenium.start(browserUrl, "*iexplore");
+ assertFalse(len(selenium.getSessionId()) eq 0);
+ }
+
+ /* problem starting FF on Windows VM
+ function shouldBeAbleToStartFirefoxWindowsVM() {
+ assertTrue(len(selenium.getSessionId()) eq 0);
+ selenium.start(browserUrl, "*firefox");
+ assertFalse(len(selenium.getSessionId()) eq 0);
+ }
+ */
+
+}
+

0 comments on commit 78a2df0

Please sign in to comment.