-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
Enables adding `restartBrowserBetweenTests: true` to your configuration file. Note that this will slow down test suites considerably. Closes #1435
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,9 @@ exports.run = function(runner, specs) { | |
this.startTime = new Date(); | ||
}; | ||
RunnerReporter.prototype.reportSpecResults = function(spec) { | ||
if (spec.results().passed()) { | ||
if (spec.results().passedCount) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
hankduan
Author
Contributor
|
||
this.emitter.emit('testPass'); | ||
} else { | ||
} else if (spec.results().failedCount) { | ||
this.emitter.emit('testFail'); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var env = require('../environment.js'); | ||
|
||
describe('pages with login', function() { | ||
it('should set a cookie', function() { | ||
browser.get(env.baseUrl+'/index.html'); | ||
|
||
browser.manage().addCookie('testcookie', 'Jane-1234'); | ||
|
||
// Make sure the cookie is set. | ||
browser.manage().getCookie('testcookie').then(function(cookie) { | ||
expect(cookie.value).toEqual('Jane-1234'); | ||
}); | ||
}); | ||
|
||
it('should check the cookie is gone', function() { | ||
browser.get(env.baseUrl+'/index.html'); | ||
|
||
// Make sure the cookie is gone. | ||
browser.manage().getCookie('testcookie').then(function(cookie) { | ||
expect(cookie).toEqual(null); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var env = require('./environment.js'); | ||
|
||
// The main suite of Protractor tests. | ||
exports.config = { | ||
seleniumAddress: env.seleniumAddress, | ||
|
||
// Spec patterns are relative to this directory. | ||
specs: [ | ||
'restartBrowserBetweenTests/*_spec.js' | ||
], | ||
|
||
capabilities: env.capabilities, | ||
|
||
baseUrl: env.baseUrl, | ||
|
||
jasmineNodeOpts: { | ||
isVerbose: true, | ||
realtimeFailure: true | ||
}, | ||
|
||
restartBrowserBetweenTests: true, | ||
}; |
Do you remember why you made this change? I'm finding that neither
testPass
nortestFail
are being emitted in jasmine 1.3