-
Notifications
You must be signed in to change notification settings - Fork 2
Running Madcow Tests
By default, the runMadcow.sh
and runMadcow.bat
scripts will execute all tests.
To run a single or set of test files pass the following arguments to the script
./runMadcow.sh -test TestOne,TestTwo,TestThree
Do not specify the file extensions of the tests! We will figure that out for you.
To run a single test within a csv file, add an exclamation mark and then the test name.
./runMadcow.sh -test CsvExample\!test_Two
The exclamation mark must be escaped using a '' in Linux and Mac OSX.
To run an individual worksheet or test from a spreadsheet test, add an exclamation mark and then the name of the test or worksheet that you want to execute.
./runMadcow.sh -test spreadsheet_test\!Test7
./runMadcow.sh -test spreadsheet_test\!WorkSheet1
Madcow gives users the ability to emulate a specific browser when running a test or set of tests from ant. To do so, simply add the "browser" property to your ant call, for example:
./runMadcow.sh -test TestOne,TestTwo,TestThree -browser {browser}
Where browser
is one of the following:
- InternetExplorer6
- InternetExplorer7
- Firefox2
- Firefox3
If no browser is specified, Madcow will use Firefox 3 as the default browser to emulate.
Madcow has the ability to only run a specific subset of tests, a suite, using a specific suite pattern. This will match on the name of a particular directory(s) using the ant pattern matching syntax - see the Ant Pattern Matching Reference for further details.
To do so, simply add the suite
property to your execution. For example, to run all tests which are contained (or within a child folder) in a folder named finance
:
./runMadcow.sh -suite finance
This suite pattern will match on the specific folder name, regardless of it's depth within the project hierarchy. So if we have a project structure as follows:
tests
|
--- development
|
--- finance
--- integrated
|
--- finance
Then running a suite of finance
will execute both tests within the development/finance
suite and the integrated/finance
suite.
To only have a specific finance suite run, you also need to specify the parent directory; such as to only run the integrated finance suite, it is specified as follows:
./runMadcow.sh -suite integrated/finance
Within your IDE you can run groovy tests individually by
- Setting a VM option within the run configuration. Set the {{basedir}} option to point at the root directory of the Madcow project
-Dbasedir=/to/your/project/root/dir
- Ensure that the
.madcow/lib
and.madcow/webtest/lib
directories are on the classpath.
To run all tests simply run the default ant target (run-all-tests
) by running ant.
ant
To run a single or set of test files from ant run the following target
ant run-tests -DmadcowTests="TestOne,TestTwo,TestThree"
To run a single test within a CSV or Spreadsheet file, add an exclamation mark and then the test name, or sheet name.
ant run-tests -DmadcowTests='csv_test!test 3'
ant run-tests -DmadcowTests='spreadsheet_test!Test7'
ant run-tests -DmadcowTests='spreadsheet_test!WorkSheet1'
ant run-tests -DmadcowTests="TestOne,TestTwo,TestThree" -Dbrowser="{browser}"
To run a specific suite of tests from ant, run the following target and set the madcowSuitesPattern
ant property
ant run-all-tests -DmadcowSuitesPattern="integrated/finance"
- Home
- Setting Up
- Configuration
- Writing Madcow Tests
- Running Madcow Tests
- Data Parameters
- Templates
- Macros
- Disabling A Test
- Spreadsheet Scenario Testing
Madcow Operations
- Madcow Operations
- Madcow Operations - Table
- Madcow Operations - XPath Extras
- List of Madcow Operations
Extending and Customising Madcow
Reference
For Developers