GithubHelp home page GithubHelp logo

Comments (12)

larrymyers avatar larrymyers commented on August 28, 2024

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.

jitendrasbhati avatar jitendrasbhati commented on August 28, 2024

I havnt tried running those test cases from commandline

from jasmine-reporters.

jitendrasbhati avatar jitendrasbhati commented on August 28, 2024

but yes they run successfully from eclipse.But i dont find any xml file being created.

from jasmine-reporters.

mgol avatar mgol commented on August 28, 2024

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.

mgol avatar mgol commented on August 28, 2024

It works for me in jasmine-reporters 0.2.1, doesn't work in any newer version.

from jasmine-reporters.

putermancer avatar putermancer commented on August 28, 2024

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.

mgol avatar mgol commented on August 28, 2024

@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.

putermancer avatar putermancer commented on August 28, 2024

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.

mgol avatar mgol commented on August 28, 2024

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.

putermancer avatar putermancer commented on August 28, 2024

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.

mgol avatar mgol commented on August 28, 2024

@bloveridge Great, thanks!

from jasmine-reporters.

putermancer avatar putermancer commented on August 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.