Posts

Showing posts with the label protractor

Protractor non angular tests do not obey waits and sleeps until there is an error in the code

Image
Clash Royale CLAN TAG #URR8PPP Protractor non angular tests do not obey waits and sleeps until there is an error in the code I am using Protractor and cucumber for automation tests on some non angular pages. I have set browser.ignoreSynchronization to true. When I run a scenario only the first line which is browser.get(...) is executed correctly. I can see the URL loads fine. All following steps are not executed (as I don't see them run in browser) but I see all green and all passed in the results. None of the waits and sleeps in the code have any effect on execution. However if there is an error somewhere in the code, lets say in the last step of scenario/stepdef I have wrong code browser.blah.something(); then I can see all sleeps and waits being obeyed. I don't understand what is going on! Why does this erroneous code cause Protractor to obey timeouts? Why this weird behavior? Any idea? Also just wondering why browser.blah.something() doesn't cause compile time error (...

How to get spec name to be used as output file name in protractor-html-reporter-2?

Image
Clash Royale CLAN TAG #URR8PPP How to get spec name to be used as output file name in protractor-html-reporter-2? I'm using protractor html reporter 2 for my reporting. I need to get spec name as html report output file name. i'm using the below code in my config file. var today = new Date(), timeStamp = today.getMonth() + 1 + '-' + today.getDate() + '-' + today.getFullYear(); onPrepare: function () { browser.driver.manage().window().maximize(); var fs = require('fs-extra'); scriptName=function(){ return browser.getProcessedConfig().then(function(config){ return config.specs; }); }; fs.emptyDir('./target/htmlReports/'+scriptName+'-'+timeStamp+'/screenShots/', function (err) { console.log(err); }); jasmine.getEnv().addReporter({ specDone: function(result) { //if (result.status == 'failed' || result.status == 'passed') { ...