forked from teamcfadvance/CFSelenium
/
BaseSpec.cfc
executable file
·28 lines (24 loc) · 977 Bytes
/
BaseSpec.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Base Selenium based testing
* Please make sure you call the `beforeAll()` method with the appropriate `browserURL` and `browser` arguments
* The `beforeAll()` method will place an instance of the CFSelenium CFC in the `variables` scope as `selenium`
*/
component extends="testbox.system.BaseSpec"{
/*********************************** LIFE CYCLE Methods ***********************************/
/**
* Please note the two arguments to get a selenium server started
* @browserURL The base URL of the application to test.
* @browser The browser to run the tests, defaults to *firefox
*/
function beforeAll( required browserURL, browser="*firefox" ){
// create Selenium class
variables.selenium = new cfselenium.Selenium();
// Start it up.
variables.selenium.start( arguments.browserURL, arguments.browser );
}
// executes after all suites+specs in the run() method
function afterAll(){
variables.selenium.stop();
variables.selenium.stopServer()
}
}