-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add callback for after completion of test #135
Comments
what about using |
Is there a way to tell if the test passed or failed? On April 10, 2014 at 2:35:00 AM, Andrei Rusu ([email protected]) wrote: what about using tearDown? — |
No, but I can pass in the results and errors, which is probably even better. On Thu, Apr 10, 2014 at 4:33 PM, disciplezero [email protected]:
|
That would make you my favorite person ever! Seriously though, it looks like thats why I rejected using teardown, because it didn’t have test information. -- On April 10, 2014 at 9:33:20 AM, Chris Egner ([email protected]) wrote: Is there a way to tell if the test passed or failed? On April 10, 2014 at 2:35:00 AM, Andrei Rusu ([email protected]) wrote: what about using tearDown? — |
It's a bit tricky though. Here's why: With this new addition that logic will become more complex because it needs to handle now 0, 1, 2 or 3 arguments. Consider all these cases: tearDown : function() {}
tearDown : function(results, errors) {}
tearDown : function(callback) {}
tearDown : function(callback, results, errors) {} But it would be a valuable addition. I'll look into it but I'm not sure how quickly it will be added. |
You’re currently doing the equivalent of: tearDown.call(client.api), right? As an alternative can we expose the results through the client/api? -- On April 10, 2014 at 10:16:04 AM, Andrei Rusu ([email protected]) wrote: It's a bit tricky though. Here's why: tearDown accepts an optional callback parameter to allow you to do a final async operation before closing the session. It sounds like you need this callback. At the same time it won't complain or it won't hang if you don't pass a callback. It does this by looking at the number of arguments you pass to tearDown - 0 or 1. With this new addition that logic will become more complex because it needs to handle now 0, 1, 2 or 3 arguments. Consider all these cases: tearDown : function() {} — |
So inside your {
passed: 1,
failed: 0,
errors: 0,
skipped: 0,
tests: [ {
message: 'test message',
stacktrace: '',
failure: false
}]
} The |
* 'master' of github.com:beatfactor/nightwatch: added results and errors properties on the test object available from inside tearDown to satisfy #135 updated tests for waitForElementPresent added waitForConditionPollInterval also, changed the set milliseconds logic a bit and updated the api doc Fixed an issue where the set locateStrategy wasn't used correctly in the case of xpath Fixed an issue when the selenium server wasn't being stopped after a session create error added <no such element> to array of DO_NOT_LOG_ERRORS add missing semicolon add global timeout for waitFor commands. Fixes #129 Standardize return - important for callbacks.
Make sure to use this.results as tearDown won't accept anything but the callback parameter. tearDown : function(callback) { |
Hi, Thank You :) |
Hi Michael- Try the following: var https = require('http'); after : function(browser) { require('./lib/saucelabs.js').update_saucelabs(this.results.failed, Here's what the include file (./lib/saucelabs.js) looks like: function update_saucelabs(failed, tags, client, https, callback) var requestPath = '/rest/v1/'+ client.options.username +'/jobs/' +
} catch (err) { On Tue, Apr 7, 2015 at 10:13 AM, MichaelCheck [email protected]
Gleb Popoff |
You should actually use |
Very cool ! Now i got it. |
We want to be able to run additional commands after the completion of a test.
In our case, we are informing browserStack that a test has failed.
I've implemented a rudimentary solution here: disciplezero@26c83d4
I think using a queue would be smarter and more robust, but this is sufficient for what we need. 😄
The text was updated successfully, but these errors were encountered: