-
Notifications
You must be signed in to change notification settings - Fork 40
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
Not able to create a dynamic reporting path(which will include browser name ,Date time etc) for multi-capabilities #26
Comments
Maybe you can find a solution here: angular/protractor#1938 |
browser.browserName = caps.get('browserName'); returns a promise so in order to use this information You need to unwrap it...
|
Hi Evilweed, Please find the below onPrepare function _onPrepare: function() {
Expected Result: Generate a dynamic reporting path based on browser name Many Thanks in Advance |
Observation:
In the onPrepare() function when we define path for report in the baseDirectory , i am not able get the value of browser name . Refer the below code
onPrepare: function() {
browser.getCapabilities().then(function(caps){
console.log('THe browser name '+ browser.browserName);
browser.browserName= caps.get('browserName');
});
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: '../../../../../../Test/'+browser.browserName,
pathBuilder: function pathBuilder(spec, descriptions, results) {
// Return '/' as path for screenshots:
// Example: 'firefox/list-should work'.
return path.join( descriptions) ;},
screenshotsSubfolder: 'ScreenShots',
jsonsSubfolder: 'Jsons',
docTitle: 'Report',
docName: 'Report.html',
preserveDirectory: false
}).getJasmine2Reporter());
}
We require to create a dynamic path because multicapabilities launches on different browser . So different browser will require different path .
In the above code ,
"browser.browserName" in console log is returning a promise .
"browser.browserName" in the baseDirectory is returning a string "undefined".
tried using path builder property , but this property builds path only for screen shot .
Expected Result :
Generate a dynamic reporting path based on browser name
So that when we use this plugin for multi-capabilities , different browser will have different report
Thanks in Advance :)
The text was updated successfully, but these errors were encountered: