Comments (12)
Can you successful run your testcases via the command line and get a xml file with the results?
Running from within Eclipse isn't a use case that has been tested.
from jasmine-reporters.
I havnt tried running those test cases from commandline
from jasmine-reporters.
but yes they run successfully from eclipse.But i dont find any xml file being created.
from jasmine-reporters.
I use Protractor with configuration from: https://github.com/angular/protractor/blob/master/spec/junitOutputConf.js
It used to generate the file but it doesn't currently. I'm on newest Protractor & jasmine-reporters.
from jasmine-reporters.
It works for me in jasmine-reporters 0.2.1, doesn't work in any newer version.
from jasmine-reporters.
I just confirmed that. If you take a look at the history of jasmine.junit_reporters.js
, though, you'll see that nothing has changed with the file writing logic since 51a3220 on April 13, 2013. I suspect there may be a change in protractor or jasmine-node which has changed the way file writing works.
The problem seems to be that you don't have a directory named xmloutput
, and the JUnit reporter doesn't try to create directories (never has), it just tries to write new files at specific paths.
If you create an xmloutput
directory, you should start getting output again.
from jasmine-reporters.
@bloveridge Why does it work with jasmine-reporters until 0.2.1 then?
Also, my onPrepare
function is as follows:
function onPrepare() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('test-results.protractor-chrome.xml', true, true));
_onPrepare.apply(this, arguments);
}
which means no directiories are supposed to be created, only the single file.
from jasmine-reporters.
Man, 0.2.1 was released ages ago... two years? Really?
I'll spend some more time looking for what changed since 0.2.1, but you can still work around the issue by creating an xmloutput
directory.
from jasmine-reporters.
OK, then something must have changed in other projects as well since it was working for me a few months ago.
I don't understand why I should create an xmloutput
directory when I don't want any directory to be created, I want the file in the root directory (and it used to work that way).
EDIT: months ago, not years, oops.
EDIT 2: actually, a few months ago 0.2.1 was the newest version so the cause seems to still exist in this project.
EDIT 3: OK, the change seems to be that older versions were just creating a file if I provided a name ending with *.xml
whereas now they expect it always to be a directory.
from jasmine-reporters.
In that case, pass null
for the path. I think I've discovered what is actually happening. (And no, creating an xmloutput
directory wouldn't work for you, I posted that before I saw the changes you'd made to the example config you pushed.)
Previous versions of jasmine-reporters used savePath
differently, and would assume it could be a fully qualified path, including filename. There were issues with the way it was done (see #19) and it was changed.
Now it is treated as a path not including filename. It looks for a directory with that name and tries to write files into that directory with names generated by reading your spec file. If you don't have the directory, it doesn't write the files.
If you use a path of null
it will write to the current directory, again using the filenames generated by running the specs. You can now control the prefix (used to always be TEST-something.xml
, now you can either remove it entirely or change the prefix to something else), but there isn't an option to completely override the filename. If you want that support, please consider adding it creating a pull request.
Here's the protractor config I use which appropriately writes files to the current directory:
new jasmine.JUnitXmlReporter(null, true, true, 'testresults.e2e.'));
The resulting filenames are something like testresults.e2e.home.xml
instead of TEST-home.xml
from jasmine-reporters.
@bloveridge Great, thanks!
from jasmine-reporters.
@jitendrasbhati Please check your configuration for similar issues and let me know if it solves your problem.
Sorry all for this apparently-breaking change (at least in some cases like yours).
from jasmine-reporters.
Related Issues (20)
- Consider a JSON reporter HOT 3
- Consider adding an option to Not Show Skipped Tests
- JUnit xml output fails with Jenkins xUnit plugin HOT 5
- Jenkins xUnit 2.0.2 cannot parse JUnit file HOT 1
- Xml report not generated for failing testcase on compilation error HOT 1
- Time value being returned as NaN for testcases HOT 3
- PLease help me with the add log for this report
- Consolidate tests with same describe in multiple files
- request, files property in testcase element
- Test name should include 'describe' name when publishing protractor results HOT 1
- failure in beforeAll() and afterAll() not present in junit report
- xmloutput folder not getting generated in Azure devops
- Vulnerability: Misinterpretation of malicious XML input HOT 6
- Update needed as mkdirp:0.5.1 Legacy versions of mkdirp are no longer supported.
- JunitXmlReporter: Add ability to captureStdErr
- JUnitXmlReporter in docker container
- Multiple failures in testsuite for failures under single testcase HOT 1
- A new release and a new upload to npm ~2.5.1 would be nice. HOT 8
- Dependency @xmldom/xmldom 0.8.3 has a critical CVE vulnerability
- stack can be undefined on uncaught exceptions causing TerminalReporter to throw
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jasmine-reporters.