Improve the documentation about how to pass options to casperjs.

Original report
It would be nice to be able to use the --xunit casper option to export the test results to XML with the xunit format to be able to integrate the tests with CI systems.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David Hernández’s picture

Assigned: David Hernández » Unassigned
Status: Active » Needs review
FileSize
2.13 KB

Here is a patch for this.

juampynr’s picture

David, you should be able to append CasperJS specific options at the end of the command. See the following lines:

http://cgit.drupalcode.org/casperjs/tree/casperjs.drush.inc?h=7.x-1.x#n126

It is also mentioned at the command description: http://cgit.drupalcode.org/casperjs/tree/casperjs.drush.inc?h=7.x-1.x#n14

And this example uses a CasperJS option at the end http://cgit.drupalcode.org/casperjs/tree/casperjs.drush.inc?h=7.x-1.x#n34

David Hernández’s picture

Title: Implement option to export test results to xml xunit file » Improve documentation for passing parameters to casperjs
Component: Code » Documentation
Assigned: Unassigned » David Hernández
Issue summary: View changes
Status: Needs review » Needs work

Talked with juampy over IRC about this, as the command already has a way to pass the parameters to casperjs, he suggested to improve the documentation, doing something similar to rsync: https://github.com/drush-ops/drush/blob/master/commands/core/core.drush....

David Hernández’s picture

Assigned: David Hernández » Unassigned
Status: Needs work » Needs review
FileSize
1.83 KB

New patch attached.

juampynr’s picture

Status: Needs review » Needs work
+++ b/casperjs.drush.inc
@@ -24,6 +24,7 @@ function casperjs_drush_command() {
+      '{casperjs-option-name}' => 'Any option that can be handled by the casperjs command can be used too. For example: --xunit, --engine...',

Can you set the option value like in the example below? The ellipsis may create confusion.

  1. +++ b/casperjs.drush.inc
    @@ -24,6 +24,7 @@ function casperjs_drush_command() {
    +      '{casperjs-option-name}' => 'Any option that can be handled by the casperjs command can be used too. For example: --xunit, --engine...',
    

    Can we reword this to "Any option supported by the native casperjs command. For example..."

  2. +++ b/casperjs.drush.inc
    @@ -33,6 +34,7 @@ function casperjs_drush_command() {
    +      'drush casperjs --url=drupal.local --xunit=test-resutlts.xml --engine=slimerjs' => 'Runs all the tests against http://drupal.local using the slimerjs engine and exporting the results to a xunit xml file called test-results.xml',
    

    The other examples have a protocol in the urls. For consistency, add it here too please. There is also a typo at the --xunit option value. Also, it's "exports", not "exporting"

David Hernández’s picture

Status: Needs work » Needs review
FileSize
1.84 KB

New patch attached to solve issues reported at #5

David Hernández’s picture

Ok, one more patch

juampynr’s picture

Status: Needs review » Fixed

Reviewed and merged. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.