In the (now deprecated) angular scenario test runner, there was an option to create a runner.html page that would run the tests in an iFrame while reporting the progress, step-by-step, in the main page.
Is there any way to get a similar step-by-step log for protractor tests? It does not need to be in an html page (console or log file would be fine).
log(timeText); // outputs the actual text console. log(pageTitleInnerHtml); //outputs the text of the Inner html });
The development team behind Protractor decided that more modern testing software can better serve their users. This is mainly because, in order for Protractor to update to its fullest potential, users would have to rewrite all their tests.
describe('Login page', function() { beforeEach(function() { browser. ignoreSynchronization = true; ptor = protractor. getInstance(); }); it('should contain navigation items', function(){ //test case code here }); it('should login the user successfully', function(){ //test case code here }) });
What is Spec File in Protractor? Spec File contains the specs or automated test cases commonly termed as a Test Scripts File. Protractor tests are written using the syntax of the test framework. In this tutorial, we will be using Jasmine Test Framework. It is simple and easy to understand and most widely used.
For that you can use the jasmine-spec-reporter for protractor. You'll have a visual feedback of all your passing and non-passing tests :
Easy to configure and looks really good in the console.
Hope this helps.
Since v1.0.0-rc2 you can see failures in real time:
In your protractor config, add a jasmineNodeOpts
object with realtimeFailure
option to true
:
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
specs: [
'e2e/**/*.js'
],
multiCapabilities: [
{'browserName': 'firefox'},
{'browserName': 'chrome'}
],
baseUrl: 'http://localhost:8000',
onPrepare: function() {},
jasmineNodeOpts: {
realtimeFailure: true
}
};
The full list of jasmine options is here: minijasminenode
And the well detailed reference config file for protractor here: referenceConf.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With