forked from teamcfadvance/CFSelenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCFSeleniumTestCase.cfc
More file actions
executable file
·19 lines (16 loc) · 983 Bytes
/
CFSeleniumTestCase.cfc
File metadata and controls
executable file
·19 lines (16 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<cfcomponent extends="mxunit.framework.TestCase">
<cffunction name="beforeTests" output="false" access="public" returntype="any" hint="">
<!--- NOTE: instantiating selenium will also start the Java if it was not already running --->
<cfset selenium = createObject("component", "cfselenium.selenium").init() />
<!--- we rely on subclasses to specify browser URL OR override this and create a variable named selenium
subclasses can optionally specify a browserCommand to override the default Firefox browser --->
<!--- This can be done in beforeTests OR setup --->
<cfparam name="browserCommand" default="*firefox" />
<cfset selenium.start(browserUrl,browserCommand) />
</cffunction>
<cffunction name="afterTests" output="false" access="public" returntype="any" hint="">
<cfset selenium.stop() />
<!--- NOTE: this will only stop the Java server if it was started by this test case --->
<cfset selenium.stopServer() />
</cffunction>
</cfcomponent>