diff --git a/.gitignore b/.gitignore
index ac21e11..602548f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
.settings/
settings.xml
Selenium-RC/"
+testbox
+tests/results
diff --git a/BaseSpec.cfc b/BaseSpec.cfc
new file mode 100755
index 0000000..55e0b9e
--- /dev/null
+++ b/BaseSpec.cfc
@@ -0,0 +1,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()
+ }
+
+}
\ No newline at end of file
diff --git a/CFSeleniumTestCase.cfc b/CFSeleniumTestCase.cfc
deleted file mode 100755
index e654283..0000000
--- a/CFSeleniumTestCase.cfc
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CFSeleniumTestCase_Tags.cfc b/CFSeleniumTestCase_Tags.cfc
deleted file mode 100644
index 1264112..0000000
--- a/CFSeleniumTestCase_Tags.cfc
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Selenium-RC/selenium-server-standalone-2.42.2.jar b/Selenium-RC/selenium-server-standalone-2.46.0.jar
similarity index 77%
rename from Selenium-RC/selenium-server-standalone-2.42.2.jar
rename to Selenium-RC/selenium-server-standalone-2.46.0.jar
index 31b582d..f470326 100644
Binary files a/Selenium-RC/selenium-server-standalone-2.42.2.jar and b/Selenium-RC/selenium-server-standalone-2.46.0.jar differ
diff --git a/box.json b/box.json
new file mode 100644
index 0000000..aefcaaf
--- /dev/null
+++ b/box.json
@@ -0,0 +1,84 @@
+{
+ "name":"CFSelenium",
+ "version":"2.0.0",
+ "author":"Ortus Solutions, Corp",
+ "homepage":"https://github.com/Ortus-Solutions/CFSelenium",
+ "documentation":"https://github.com/Ortus-Solutions/CFSelenium/wiki",
+ "repository":{
+ "type":"git",
+ "url":"https://github.com/Ortus-Solutions/CFSelenium.git"
+ },
+ "bugs":"https://github.com/Ortus-Solutions/CFSelenium/issues",
+ "slug":"cfselenium",
+ "shortDescription":"CFSelenium provides a native client library for Selenium-RC",
+ "description":"CFSelenium is a ColdFusion Component (CFC) which provides a native client library for Selenium-RC. This allows you to write tests, using CFML, which will drive a browser and verify results via Selenium-RC.",
+ "type":"projects",
+ "keywords":[
+ "cfselenium",
+ "testing",
+ "selenium"
+ ],
+ "engines":[
+ {
+ "type":"lucee",
+ "version":">=4.5.x"
+ },
+ {
+ "type":"adobe",
+ "version":">=10"
+ }
+ ],
+ "projectURL":"https://github.com/Ortus-Solutions/CFSelenium",
+ "license":[
+ {
+ "type":"Apache2",
+ "url":"http://www.apache.org/licenses/LICENSE-2.0"
+ }
+ ],
+ "contributors":[
+
+ ],
+ "dependencies":{
+
+ },
+ "devDependencies":{
+ "testbox":"2.0.0"
+ },
+ "installPaths":{
+ "testbox":"testbox"
+ },
+ "ignore":[
+ "**/.*",
+ "test",
+ "tests"
+ ],
+ "testbox":{
+ "runner":[
+ {
+ "default":""
+ }
+ ],
+ "labels":[
+
+ ],
+ "reporter":"",
+ "reporterResults":"",
+ "bundles":[
+ ""
+ ],
+ "directory":{
+ "mapping":"",
+ "recurse":true
+ },
+ "watchers":[
+
+ ],
+ "notify":{
+ "emails":[
+
+ ],
+ "growl":"",
+ "url":""
+ }
+ }
+}
\ No newline at end of file
diff --git a/readme.html b/readme.html
new file mode 100644
index 0000000..6e11e99
--- /dev/null
+++ b/readme.html
@@ -0,0 +1,1080 @@
+
CFSelenium - A Native CFML (ColdFusion) Client Library for Selenium-RC
+
+This project was forked from Bob Silverberg’s project: http://github.com/bobsilverberg/CFSelenium
+
+What is CFSelenium?
+CFSelenium is a ColdFusion Component (CFC) which provides a native client library for Selenium-RC. This allows you to write tests, using CFML, which will drive a browser and verify results via Selenium-RC.
+Requirements
+
+- ColdFusion 9+ or Lucee 4.5+
+- The Selenium-RC Server jar, the latest version of which is included in the distribution
+
+Installation
+CFSelenium can be installed via CommandBox by typing:
+box install cfselenium
+
+
+Note: Optionally if you would like to integreate with TestBox you will have to create a mapping to the cfselenium
installed folder as /cfselenium
.
+Usage
+Optionally, start the Selenium-RC server. Selenium.cfc
will automatically start the Selenium-RC server for you in the background if it isn’t already started. To start it manually, the command is similar to this:
+java -jar selenium-server-standalone-2.46.0.jar
+
+
+Create an instance of selenium.cfc.
+selenium = new Selenium();
+
+
+You can also pass the host and port into the constructor, which default to localhost and 4444:
+selenium = new selenium("localhost", 4444);
+
+To start up a browser, call selenium.start() passing in the starting url and, optionally, a browser command telling it which browser to start (the default is *firefox):
+selenium.start("http://github.com/");
+
+To start a different browser (e.g., Google Chrome), pass in the browser command too:
+selenium.start("http://github.com/","*googlechrome");
+
+Call methods on the selenium object to drive the browser and check values. For example:
+selenium.open("/bobsilverberg/CFSelenium");
+assertEquals("bobsilverberg/CFSelenium - GitHub", selenium.getTitle());
+selenium.click("link=readme.md");
+selenium.waitForPageToLoad("30000");
+assertEquals("readme.md at master from bobsilverberg's CFSelenium - GitHub", selenium.getTitle());
+selenium.click("raw-url");
+selenium.waitForPageToLoad("30000");
+assertEquals("", selenium.getTitle());
+assertTrue(selenium.isTextPresent("[CFSelenium]"));
+
+You can shut down the browser using the stop() method:
+selenium.stop();
+
+A Base Test Case for MXUnit
+Also included in the distribution is a base test case for MXUnit, called CFSeleniumTestCase.cfc. This is designed to instantiate the selenium.cfc for you and start up a browser session once, before all of your tests run, and shut down the browser after all the tests have completed. To use this base test case, simply extend it in your own test case:
+component extends="CFSelenium.CFSeleniumTestCase"
+
+You will then want to place a beforeTests() method in your test case which sets the browserUrl and the calls the base test case’s beforeTests() method:
+public void function beforeTests(){
+ browserURL = "http://github.com/";
+ super.beforeTests();
+}
+
+
+Also included in the distribution is a Firefox extension which will add a formatter to Selenium-IDE which will allow you to export tests in CFSelenium / MXUnit format. The plugin can be found in the formats folder.
+Support
+The script-based version of CFSelenium is maintained by Bob Silverberg and the tag-based version is maintained by Brian Swartzfager. Thanks also to Marc Esher for the logic which starts and stops the Selenium-RC server automatically.
+Please use the main repo’s issue tracker to report bugs and request enhancements.
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 10d0496..4b64de2 100644
--- a/readme.md
+++ b/readme.md
@@ -1,72 +1,157 @@
-[CFSelenium](http://github.com/bobsilverberg/CFSelenium) - A Native CFML (ColdFusion) Client Library for Selenium-RC
-=============================================================================================================
+# CFSelenium - A Native CFML (ColdFusion) Client Library for Selenium-RC
-### What is CFSelenium? ###
+> This project was forked from Bob Silverberg's project: http://github.com/bobsilverberg/CFSelenium
+
+## What is CFSelenium?
CFSelenium is a ColdFusion Component (CFC) which provides a native client library for Selenium-RC. This allows you to write tests, using CFML, which will drive a browser and verify results via Selenium-RC.
-### Requirements ###
+### Requirements
+
+1. [ColdFusion 10+](http://www.coldfusion.com) or [Lucee 4.5+](http://lucee.org)
+2. The [Selenium-RC Server jar](http://www.seleniumhq.org/download/), the latest version of which is included in the distribution
+3. [TestBox](http://www.ortussolutions.com/products/testbox) for Behavior Driven Development and contributing to our test suite.
+
+### Support
+
+* Please use the main repo's [issue tracker](https://github.com/Ortus-Solutions/CFSelenium/issues) to report bugs and request enhancements.
+* You can also use the **TestBox** help group for help: https://groups.google.com/forum/#!forum/coldbox
+
+## Installation
+
+CFSelenium can be installed via [CommandBox](http://www.ortussolutions.com/products/commandbox) by typing:
+
+```bash
+box install cfselenium
+```
+
+This will create the following structure under a `cfselenium` folder:
+
+* **formats** : Browser Extensions
+* **Selenium-RC** : The Selenium Standalone Java Server
+* **BaseSpec.cfc** : The TestBox base specification to use for Selenium driven specs
+* **Selenium.cfc** : This nice project CFC
+* **Server.cfc** : The driver CFC for the embedded server
+
+**Note:** Optionally if you would like to integrate with [TestBox](http://www.ortussolutions.com/products/testbox) you will have to create a mapping to the `cfselenium` installed folder as `/cfselenium`.
+
+### Contributing
+
+If you want to contribute to this project, please make sure you clone it from here: https://github.com/Ortus-Solutions/CFSelenium/. You will need [CommandBox](http://www.ortussolutions.com/products/commandbox) in order to do development, so once installed and cloned, just type:
+
+```bash
+box install && box server start
+```
-1. [ColdFusion 7+](http://www.coldfusion.com) - ColdFusion 9+ is required for the script-based cfc. You can use the tag-based cfc, selenium_tags on CF 7 and 8.
-2. The [Selenium-RC Server jar](http://code.google.com/p/selenium/downloads/list), the latest version of which is included in the distribution
+In the root of the clone and all the required dependencies will be installed and you can contribute to the project. An embedded server will also be started so you can execute the tests and develop.
-### Usage ###
+## Usage
-Optionally, start the Selenium-RC server. Selenium.cfc will automatically start the Selenium-RC server for you in the background if it isn't already started (note this does not work on CF7). To start it manually, the command is similar to this:
+Optionally, start the Selenium-RC server. `Selenium.cfc` will automatically start the Selenium-RC server for you in the background if it isn't already started. To start it manually, the command is similar to this:
- java -jar selenium-server-standalone-2.42.2.jar
+```bash
+java -jar selenium-server-standalone-2.46.0.jar
+```
Create an instance of selenium.cfc.
- selenium = new selenium();
+```js
+selenium = new Selenium();
+```
-You can also pass the host and port into the constructor, which default to localhost and 4444:
+You can also pass the **host** and **port** into the constructor, which default to `localhost` and `4444`:
- selenium = new selenium("localhost", 4444);
+```js
+selenium = new Selenium( "localhost", 4444 );
+```
-To start up a browser, call selenium.start() passing in the starting url and, optionally, a browser command telling it which browser to start (the default is *firefox):
+To start up a browser, call `selenium.start()` passing in the starting URL and, optionally, a browser command telling it which browser to start (the default is `*firefox`):
- selenium.start("http://github.com/");
+```
+selenium.start( "http://github.com/" );
+```
To start a different browser (e.g., Google Chrome), pass in the browser command too:
- selenium.start("http://github.com/","*googlechrome");
+```
+selenium.start( "http://github.com/", "*googlechrome" );
+```
-Call methods on the selenium object to drive the browser and check values. For example:
+Call methods on the selenium object to drive the browser and check values. Most likely you will be using [TestBox](http://www.ortussolutions.com/products/testbox) for driving expectations on these values:
- selenium.open("/bobsilverberg/CFSelenium");
- assertEquals("bobsilverberg/CFSelenium - GitHub", selenium.getTitle());
- selenium.click("link=readme.md");
- selenium.waitForPageToLoad("30000");
- assertEquals("readme.md at master from bobsilverberg's CFSelenium - GitHub", selenium.getTitle());
- selenium.click("raw-url");
- selenium.waitForPageToLoad("30000");
- assertEquals("", selenium.getTitle());
- assertTrue(selenium.isTextPresent("[CFSelenium]"));
+```js
+// all your suites go here.
+describe( "CFSelenium", function(){
-You can shut down the browser using the stop() method:
+ it( "can open an external readme", function(){
+ selenium.open("/Ortus-Solutions/CFSelenium");
- selenium.stop();
+ expect( selenium.getTitle() ).toInclude( "CFSelenium" );
+ });
-### A Base Test Case for MXUnit ###
+ it( "can navigate and verify", function(){
+ selenium.click( "link=readme.md" );
+ selenium.waitForPageToLoad( "30000" );
+ sleep( 1000 );
-Also included in the distribution is a base test case for MXUnit, called CFSeleniumTestCase.cfc. This is designed to instantiate the selenium.cfc for you and start up a browser session once, before all of your tests run, and shut down the browser after all the tests have completed. To use this base test case, simply extend it in your own test case:
+ expect( selenium.getTitle() ).toInclude( "readme.md" );
- component extends="CFSelenium.CFSeleniumTestCase"
+ selenium.click( "raw-url" );
+ selenium.waitForPageToLoad( "30000" );
-You will then want to place a beforeTests() method in your test case which sets the browserUrl and the calls the base test case's beforeTests() method:
+ expect( selenium.getTitle() ).toBeEmpty();
+ expect( selenium.isTextPresent("[CFSelenium]") ).toBeTrue();
- public void function beforeTests(){
- browserURL = "http://github.com/";
- super.beforeTests();
- }
+ });
-### A Selenium-IDE Formatter Too ###
+});
+```
+
+You can shut down the browser using the `stop()`` method:
+
+```js
+selenium.stop();
+```
+
+## TestBox Integration
+
+CFSelenium integrates with [TestBox](http://www.ortussolutions.com/products/testbox) via the `BaseSpec.cfc` that can be found in the root of the project. Every Spec that you create in which you want to enable CFSelenium for will inherit from this spec, which in turn inherits from the TestBox `BaseSpec` as well.
+
+```
+component extends="cfselenium.BaseSpec"{}
+```
-Also included in the distribution is a Firefox extension which will add a formatter to Selenium-IDE which will allow you to export tests in CFSelenium / MXUnit format. The plugin can be found in the _formats_ folder.
+Then you will have access to our life-cycle methods of `beforeAll` and `afterAll`. The `beforeAll()` method takes in two arguments in order to setup the Selenium connection. The `afterAll()` method can be omitted in your concrete spec and it stops the Selenium connection.
-### Support ###
+### BeforeAll()
-The script-based version of CFSelenium is maintained by [Bob Silverberg](https://github.com/bobsilverberg) and the tag-based version is maintained by [Brian Swartzfager](https://github.com/bcswartz). Thanks also to [Marc Esher](https://github.com/marcesher) for the logic which starts and stops the Selenium-RC server automatically.
+```js
+/**
+* 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" ){}
+```
+
+You can then use it in your specs:
+
+```js
+/**
+* Readme Spec
+*/
+component extends="cfselenium.BaseSpec"{
+
+/*********************************** LIFE CYCLE Methods ***********************************/
+
+ // executes before all suites+specs in the run() method
+ function beforeAll(){
+ super.beforeAll( "http://github.com/", "*firefox" );
+ }
+
+}
+```
+
+### A Selenium-IDE Formatter Too ###
-Please use the main repo's [issue tracker](https://github.com/bobsilverberg/CFSelenium/issues) to report bugs and request enhancements.
\ No newline at end of file
+Also included in the distribution is a Firefox extension which will add a formatter to Selenium-IDE which will allow you to export tests in CFSelenium / MXUnit format. The plugin can be found in the _formats_ folder.
\ No newline at end of file
diff --git a/selenium_tags.cfc b/selenium_tags.cfc
deleted file mode 100644
index 49abf5f..0000000
--- a/selenium_tags.cfc
+++ /dev/null
@@ -1,1710 +0,0 @@
-