k3po / k3po.js

K3PO for JavaScript (Mocha)
Apache License 2.0
1 stars 3 forks source link

Custom mocha reporter to update SauceLabs build status #5

Open AdrianCozma opened 8 years ago

AdrianCozma commented 8 years ago

Right now the test failures are reported in the command line output and the Sauce Labs builds do not have a success/failed status.

In order to report JavaScript test results to Sauce Labs a custom reporter will need to be implemented.

Some useful links:

dpwspoon commented 8 years ago

@AdrianCozma I would expect that in the afterAll part of mocha-k3po.js we could add logic to report the results in the webdriver browser. Feel free to try if you are interested. You will need to get the test results from the mocha context, which is the object executing the tasks. To see what fields are available you could set a break point in webstorm there. After that you could pass in the test results into the context.browserConfig.terminate() and have the browser runner report the results via webdriver.

AdrianCozma commented 8 years ago

@dpwspoon I added two commits to the k3po.js PR in order to get the results set in Travis.

I went a different way, by using a node.js wrapper for the Sauce Labs REST API and updating the job result in the afterAll part of mocha-k3po.js please let me know what you think