-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Create outputDir directory in case it doesn't exist #3389
Comments
@nami-varthakavi if the directory doesn't exist it can't put files in there. I would agree however that wdio should create the folder in case it doesn't exit. |
Can you also update |
## Proposed changes [//]: # (Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.) This change adds a check in wdio-reporter that will create the output directory if it's defined but doesn't exist on the system. This addresses #3389 ## Types of changes [//]: # (What types of changes does your code introduce to WebdriverIO?) [//]: # (_Put an `x` in the boxes that apply_) - [ ] Bugfix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist [//]: # (_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._) - [x] I have read the [CONTRIBUTING](https://github.com/webdriverio/webdriverio/blob/master/CONTRIBUTING.md) doc - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) ## Further comments [//]: # (If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...) I don't think this really needs a documentation change, but can add something if preferred. ### Reviewers: @webdriverio/technical-committee
Should this issue be closed since there is a merged PR for it? |
@tendonstrength yes, closing. |
@WillBrock - not working, at least not on Windows. I moved the ensureDirSync-call to before the call to createWriteStream in the constructor and it starts working, which seems reasonable? wdio.conf looks like: reporters: [
'spec',
['junit', {
outputDir: './reports',
outputFileFormat: function(opts) { // optional
return `wdio-${opts.cid}-junit-report.xml`
}
}]
] Options-object looks like: {
logLevel: 'silent',
setLogFile: [Function: NOOP],
outputDir: './reports',
outputFileFormat: [Function: outputFileFormat],
logFile: 'reports\\wdio-0-0-junit-report.xml',
writeStream: {
write: [Function: write]
}
} |
@atti187 That might be OK but not sure why that would change creating the directory. I don't have windows so I don't have a way to test. Mind creating a pr so someone can test with windows? |
Looks like my fix resolved the issue in junit, but not allure... working on an update in #3578 |
Haven't really had time to follow up on your changes. Anyways thanks for checking this out for me :) |
@WillBrock - guess @klamping beat me to it! Anyway, thx. |
…rio#3510) ## Proposed changes [//]: # (Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.) This change adds a check in wdio-reporter that will create the output directory if it's defined but doesn't exist on the system. This addresses webdriverio#3389 ## Types of changes [//]: # (What types of changes does your code introduce to WebdriverIO?) [//]: # (_Put an `x` in the boxes that apply_) - [ ] Bugfix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist [//]: # (_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._) - [x] I have read the [CONTRIBUTING](https://github.com/webdriverio/webdriverio/blob/master/CONTRIBUTING.md) doc - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) ## Further comments [//]: # (If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...) I don't think this really needs a documentation change, but can add something if preferred. ### Reviewers: @webdriverio/technical-committee
…rio#3510) ## Proposed changes [//]: # (Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.) This change adds a check in wdio-reporter that will create the output directory if it's defined but doesn't exist on the system. This addresses webdriverio#3389 ## Types of changes [//]: # (What types of changes does your code introduce to WebdriverIO?) [//]: # (_Put an `x` in the boxes that apply_) - [ ] Bugfix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist [//]: # (_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._) - [x] I have read the [CONTRIBUTING](https://github.com/webdriverio/webdriverio/blob/master/CONTRIBUTING.md) doc - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) ## Further comments [//]: # (If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...) I don't think this really needs a documentation change, but can add something if preferred. ### Reviewers: @webdriverio/technical-committee
On a fresh start of running the tests, we expect the WDIO tester runner will be creating the folder mentioned in the
outputDir
arg forallure
.This is how I provided in the config file,
On running my test I get the following error
I also tried giving the default value like this
but the error persists.
The text was updated successfully, but these errors were encountered: