This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(runner): Add support for async onCleanUp functions
If the onCleanUp function returns a promise, the process will allow it to resolve before exiting. This is useful for performing async operations like writing to a file or calling an API at the end of a test run.
- Loading branch information
1 parent
cd575ee
commit 6de2e32
Showing
6 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('onCleanUp function in the config', function() { | ||
it('should not be affected by tests', function() { | ||
expect(true).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var env = require('./environment.js'); | ||
var q = require('q'); | ||
|
||
// The main suite of Protractor tests. | ||
exports.config = { | ||
seleniumAddress: env.seleniumAddress, | ||
|
||
specs: [ | ||
'onCleanUp/*_spec.js' | ||
], | ||
|
||
capabilities: env.capabilities, | ||
|
||
baseUrl: env.baseUrl, | ||
|
||
onCleanUp: function(exitCode) { | ||
var deferred = q.defer(); | ||
setTimeout(function () { | ||
deferred.resolve(exitCode); | ||
}, 500); | ||
return deferred.promise; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var env = require('./environment.js'); | ||
|
||
// The main suite of Protractor tests. | ||
exports.config = { | ||
seleniumAddress: env.seleniumAddress, | ||
|
||
specs: [ | ||
'onCleanUp/*_spec.js' | ||
], | ||
|
||
capabilities: env.capabilities, | ||
|
||
baseUrl: env.baseUrl, | ||
|
||
onCleanUp: function(exitCode) { | ||
// no return | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var env = require('./environment.js'); | ||
|
||
// The main suite of Protractor tests. | ||
exports.config = { | ||
seleniumAddress: env.seleniumAddress, | ||
|
||
specs: [ | ||
'onCleanUp/*_spec.js' | ||
], | ||
|
||
capabilities: env.capabilities, | ||
|
||
baseUrl: env.baseUrl, | ||
|
||
onCleanUp: function(exitCode) { | ||
return exitCode; | ||
} | ||
}; |