Fork me on GitHub

casperjs-runner:integration-test

Full name:

com.github.casperjs:casperjs-runner-maven-plugin:1.0.7-SNAPSHOT:integration-test

Description:

Runs JavaScript and/or CoffeScript test files on CasperJS instance, but in "integration-test" mode. IE does not fails the build if there are test errors, letting the verify Mojo doing it.

Attributes:

  • Requires a Maven project to be executed.
  • Since version: 1.0.0.
  • Binds by default to the lifecycle phase: integration-test.

Optional Parameters

Name Type Since Description
arguments List 1.0.0 A list of <argument> to add to the casperjs command line.
casperExecPath String 1.0.0 Complete path of the executable for CasperJS.
Default value: Found from toolchain named casperjs, then from this parameter, then from PATH with default value of casperjs on Linux/Mac or casperjs.exe (casperjs.bat for compatibility with old versions of CasperJS) on Windows
User property is: casperjs.executable.
casperjsVerbose boolean 1.0.2 For CasperJS 1.1.x, set --verbose option, --direct for CasperJS 1.0.x: will output log messages directly to the console
Default value is: false.
User property is: casperjs.casperjsVerbose.
direct boolean 1.0.0 Deprecated. No reason given
Default value is: false.
User property is: casperjs.direct.
enableLogReports boolean 1.0.5 Should CasperJS generates log reports. If true (which is the default), a log file will be generated for each test, containing the output of the CasperJS run. These reports will be generated in the reportsDirectory directory, with a name of test filename>.txt.
Default value is: true.
User property is: casperjs.enableLogReports.
enableXmlReports boolean 1.0.2 Should CasperJS generates XML reports, through the --xunit=[filename] option. If true, such reports will be generated in the reportsDirectory directory, with a name of TEST-<test filename>.xml.
Default value is: false.
User property is: casperjs.enableXmlReports.
engine String 1.0.0 CasperJS 1.1 and above
Set the for the CasperJS option --engine=[engine]: will change the rendering engine (phantomjs or slimerjs)
User property is: casperjs.engine.
environmentVariables Map 1.0.0 Environment variables to set on the command line, instead of the default, inherited, ones.
failFast boolean 1.0.0 Set the CasperJS --fail-fast option: will terminate the current test suite as soon as a first failure is encountered.
Default value is: false.
User property is: casperjs.failFast.
includeCS boolean 1.0.0 A flag to indicate if the *.coffee found in tests.directory should be executed.
Default value is: true.
User property is: casperjs.include.coffeescript.
includeJS boolean 1.0.0 A flag to indicate if the *.js found in tests.directory should be executed.
Default value is: true.
User property is: casperjs.include.javascript.
includes String 1.0.0 Set the value for the CasperJS option --includes=[foo.js,bar.js]: will includes the foo.js and bar.js files before each test file execution.
User property is: casperjs.includes.
includesPatterns List 1.0.1 A list of <includesPattern> elements specifying the files (by pattern) to set on the --includes option.
When not specified and the ${tests.directory}/includes directory exists, this will be set to

<includesPatterns>
  <includesPattern>${tests.directory}/includes/**/*.js</includesPattern>
</includesPatterns>

logLevel String 1.0.0 Set the value for the CasperJS option --log-level=[logLevel]: sets the logging level (see http://casperjs.org/logging.html).
User property is: casperjs.logLevel.
post String 1.0.0 Set the value for the CasperJS option --post=[post-test.js]: will add the tests contained in post-test.js after having executed the whole test suite. If a post.js file is found on the ${tests.directory}, this option will be set automatically
User property is: casperjs.post.
pre String 1.0.0 Set the value for the CasperJS option --pre=[pre-test.js]: will add the tests contained in pre-test.js before executing the test suite. If a pre.js file is found on the ${tests.directory}, this option will be set automatically
User property is: casperjs.pre.
reportsDir File 1.0.2 Directory where the xUnit reports will be stored.
Default value is: ${project.build.directory}/casperjs-reports.
User property is: casperjs.reports.directory.
session MavenSession 1.0.0 The current maven session, used by the ToolChainManager
Default value is: ${session}.
skip boolean 1.0.1 Set this to true to bypass unit tests entirely.
Default value is: ${maven.test.skip}.
User property is: casperjs.skip.
targetDir File 1.0.0 The directory where output files will be stored
Default value is: ${project.build.directory}/casperjs.
test String 1.0.0 Specify this parameter to run individual tests by file name, overriding the testIncludes/testExcludes parameters. Each pattern you specify here will be used to create an include pattern formatted like **/${test}.{js,coffee}, so you can just type "-Dtest=MyTest" to run a single test called foo/MyTest.js or foo/MyTest.coffee.
User property is: casperjs.test.
testFailureCountFile File 1.0.0 A file in which the count of failed tests will be written. We'll check this file in the verify phase to fail the build, if the testFailures ignored during the test mojo.
Default value is: ${project.build.directory}/casperjsFailureCount.
User property is: casperjs.testFailure.countFile.
testsDir File 1.0.0 Directory where the tests to execute are stored.
If ${tests.directory}/includes and ${tests.directory}/scripts directories exist, this is changed to ${tests.directory}/scripts and all *.js files in ${tests.directory}/includes will automatically be added to the CasperJS --includes list.
Default value is: ${basedir}/src/test/casperjs.
User property is: casperjs.tests.directory.
testsExcludes List 1.0.1 A list of <testsExclude> elements specifying the tests (by pattern) that should be excluded in testing.
testsIncludes List 1.0.1 A list of <testsInclude> elements specifying the tests (by pattern) that should be included in testing.
Default value: When not specified and when the test parameter is not specified, the default includes will be (javascript patterns will only be set if includeJS is true, and coffee patterns will only be set if includeCS is true )

<testsIncludes>
  <testsInclude>**/Test*.js</testsInclude>
  <testsInclude>**/*Test.js</testsInclude>
  <testsInclude>**/*TestCase.js</testsInclude>
  <testsInclude>**/Test*.coffee</testsInclude>
  <testsInclude>**/*Test.coffee</testsInclude>
  <testsInclude>**/*TestCase.coffee</testsInclude>
</testsIncludes>

verbose boolean 1.0.0 Set the plugin to be verbose during its execution.
Default value is: ${maven.verbose}.
User property is: casperjs.verbose.

Parameter Details

arguments:

A list of <argument> to add to the casperjs command line.
  • Type: java.util.List
  • Since: 1.0.0
  • Required: No

casperExecPath:

Complete path of the executable for CasperJS.
Default value: Found from toolchain named casperjs, then from this parameter, then from PATH with default value of casperjs on Linux/Mac or casperjs.exe (casperjs.bat for compatibility with old versions of CasperJS) on Windows
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.executable

casperjsVerbose:

For CasperJS 1.1.x, set --verbose option, --direct for CasperJS 1.0.x: will output log messages directly to the console
  • Type: boolean
  • Since: 1.0.2
  • Required: No
  • User Property: casperjs.casperjsVerbose
  • Default: false

direct:

Deprecated. No reason given
Set the CasperJS --direct option: will output log messages directly to the console. Deprecated: use the casperjsVerbose option
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.direct
  • Default: false

enableLogReports:

Should CasperJS generates log reports. If true (which is the default), a log file will be generated for each test, containing the output of the CasperJS run. These reports will be generated in the reportsDirectory directory, with a name of test filename>.txt.
  • Type: boolean
  • Since: 1.0.5
  • Required: No
  • User Property: casperjs.enableLogReports
  • Default: true

enableXmlReports:

Should CasperJS generates XML reports, through the --xunit=[filename] option. If true, such reports will be generated in the reportsDirectory directory, with a name of TEST-<test filename>.xml.
  • Type: boolean
  • Since: 1.0.2
  • Required: No
  • User Property: casperjs.enableXmlReports
  • Default: false

engine:

CasperJS 1.1 and above
Set the for the CasperJS option --engine=[engine]: will change the rendering engine (phantomjs or slimerjs)
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.engine

environmentVariables:

Environment variables to set on the command line, instead of the default, inherited, ones.
  • Type: java.util.Map
  • Since: 1.0.0
  • Required: No

failFast:

Set the CasperJS --fail-fast option: will terminate the current test suite as soon as a first failure is encountered.
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.failFast
  • Default: false

includeCS:

A flag to indicate if the *.coffee found in tests.directory should be executed.
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.include.coffeescript
  • Default: true

includeJS:

A flag to indicate if the *.js found in tests.directory should be executed.
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.include.javascript
  • Default: true

includes:

Set the value for the CasperJS option --includes=[foo.js,bar.js]: will includes the foo.js and bar.js files before each test file execution.
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.includes

includesPatterns:

A list of <includesPattern> elements specifying the files (by pattern) to set on the --includes option.
When not specified and the ${tests.directory}/includes directory exists, this will be set to

<includesPatterns>
  <includesPattern>${tests.directory}/includes/**/*.js</includesPattern>
</includesPatterns>
  • Type: java.util.List
  • Since: 1.0.1
  • Required: No

logLevel:

Set the value for the CasperJS option --log-level=[logLevel]: sets the logging level (see http://casperjs.org/logging.html).
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.logLevel

post:

Set the value for the CasperJS option --post=[post-test.js]: will add the tests contained in post-test.js after having executed the whole test suite. If a post.js file is found on the ${tests.directory}, this option will be set automatically
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.post

pre:

Set the value for the CasperJS option --pre=[pre-test.js]: will add the tests contained in pre-test.js before executing the test suite. If a pre.js file is found on the ${tests.directory}, this option will be set automatically
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.pre

reportsDir:

Directory where the xUnit reports will be stored.
  • Type: java.io.File
  • Since: 1.0.2
  • Required: No
  • User Property: casperjs.reports.directory
  • Default: ${project.build.directory}/casperjs-reports

session:

The current maven session, used by the ToolChainManager
  • Type: org.apache.maven.execution.MavenSession
  • Since: 1.0.0
  • Required: No
  • Default: ${session}

skip:

Set this to true to bypass unit tests entirely.
  • Type: boolean
  • Since: 1.0.1
  • Required: No
  • User Property: casperjs.skip
  • Default: ${maven.test.skip}

targetDir:

The directory where output files will be stored
  • Type: java.io.File
  • Since: 1.0.0
  • Required: No
  • Default: ${project.build.directory}/casperjs

test:

Specify this parameter to run individual tests by file name, overriding the testIncludes/testExcludes parameters. Each pattern you specify here will be used to create an include pattern formatted like **/${test}.{js,coffee}, so you can just type "-Dtest=MyTest" to run a single test called foo/MyTest.js or foo/MyTest.coffee.
  • Type: java.lang.String
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.test

testFailureCountFile:

A file in which the count of failed tests will be written. We'll check this file in the verify phase to fail the build, if the testFailures ignored during the test mojo.
  • Type: java.io.File
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.testFailure.countFile
  • Default: ${project.build.directory}/casperjsFailureCount

testsDir:

Directory where the tests to execute are stored.
If ${tests.directory}/includes and ${tests.directory}/scripts directories exist, this is changed to ${tests.directory}/scripts and all *.js files in ${tests.directory}/includes will automatically be added to the CasperJS --includes list.
  • Type: java.io.File
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.tests.directory
  • Default: ${basedir}/src/test/casperjs

testsExcludes:

A list of <testsExclude> elements specifying the tests (by pattern) that should be excluded in testing.
  • Type: java.util.List
  • Since: 1.0.1
  • Required: No

testsIncludes:

A list of <testsInclude> elements specifying the tests (by pattern) that should be included in testing.
Default value: When not specified and when the test parameter is not specified, the default includes will be (javascript patterns will only be set if includeJS is true, and coffee patterns will only be set if includeCS is true )

<testsIncludes>
  <testsInclude>**/Test*.js</testsInclude>
  <testsInclude>**/*Test.js</testsInclude>
  <testsInclude>**/*TestCase.js</testsInclude>
  <testsInclude>**/Test*.coffee</testsInclude>
  <testsInclude>**/*Test.coffee</testsInclude>
  <testsInclude>**/*TestCase.coffee</testsInclude>
</testsIncludes>
  • Type: java.util.List
  • Since: 1.0.1
  • Required: No

verbose:

Set the plugin to be verbose during its execution.
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: casperjs.verbose
  • Default: ${maven.verbose}