Coder Social home page Coder Social logo

larrymyers / jasmine-reporters Goto Github PK

View Code? Open in Web Editor NEW
394.0 394.0 180.0 1.38 MB

Reporter classes for the jasmine test framework. Includes JUnitXmlReporter for generating junit xml output for running in CI environments like Jenkins.

License: MIT License

JavaScript 99.16% Shell 0.84%

jasmine-reporters's People

Contributors

arusakov avatar astorije avatar colinbate avatar cscleison avatar decoy31 avatar eeroan avatar fennibay avatar founddrama avatar harsha509 avatar jayharris avatar kraenhansen avatar larrymyers avatar leeight avatar mbest avatar mgol avatar mikeappell avatar millermedeiros avatar mtscout6 avatar musahaidari avatar ondras avatar philbrown avatar putermancer avatar roland-ewald avatar scriby avatar sheile avatar styerk avatar theraven avatar uzikilon avatar zazoomauro avatar zubairov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jasmine-reporters's Issues

JSTestDriver support

This is not really an issue but is there the possibility that this would be expanded to include JSTestDriver as a run environment since PhantomJS is WebKit only? Otherwise any pointers in implementing such would be helpful.
Amazing work updating to Jasmine 2.0 btw.

Cheers.

NUnitXmlReporter needed

I am using jasmine-reporters with Protractor e2e testing framework and JUnit reporting it works perfect.

require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('e2e/test-report/', true, true));

What I need is NUnitXmlReporter which will work in the same way.
This is for TeamCity, but I have got independent test results in xml format which are merged to one common report. That is why I cannot use ready TeamCity reporter.

I have done some research on web and discovered gmusick / jasmine-reporters project, which looks prommising, but I am unable to use it with your reporter.

Would it be possible to create NUnitXmlReporter?

Question/Feature request : JSON

hi all,

I have a little question :
Is it possible to have json output instead of xml or does somebody know on how to convert the xml output to json?

ReferenceError: Can't find variable: jasmine

While trying to setup a hudson project using jasmine, phantomjs and your junit_reporter, I permanently get an error when running your example:
"ReferenceError: Can't find variable: jasmine"

Here some info about my System:

  • Hudson 3.0.0
  • WIndows 7 64bit
  • cygwin
  • phantomjs 1.9 (also tried 1.6.1)

It seems that the included in junit_xml_reporter.html are not loaded (tried a console.log within the jasmine.js) but don't understand why.
I also made the relative paths (../ext) absolute. But that doesn't work either

I suppose that the bug could have to do s.t. with my environment by I don't have any clue.

Does any has an idea what could be the problem?

Here's the full stacktrace:

ReferenceError: Can't find variable: jasmine

phantomjs://webpage.evaluate():3
phantomjs://webpage.evaluate():9

phantomjs://webpage.evaluate():9

Ability to send results to remote server for writing

I have no idea if other run into this problem, but running our test using bootstrap in a browser and then running the tests using phantom or rhino produce different results. The browser is obviously much easier to debug and fix and would like that to be the point of truth in our tests, instead of having things pass fine in browser mode and fail in phantom or rhino. Perhaps node.js would work for this problem, but we have no interest in introducing node.js into the project.

So I have added the ability to have a remote server process the test results for saving and not use phantom, rhino or node.

"fit" doesn't work with jasmine 2.x on protractor

I'm using the [email protected] with [email protected] and using [email protected].

When I set an it as fit, I have the following message:

Running "protractor:smoke" (protractor) task
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.1.3:57112/wd/hub
Spec started

Executed 0 of 10 specs SUCCESS (10 SKIPPED) in 0.002 secs.

0 tests run!

Although, when I use "fdescribe", it works as expected.

I first opened an issue on protractor github project but we concluded that the problem most likely be on jasmine-reporters (angular/protractor#1908)

Can you guys help me with this?

Support Jasmine 2.0

Any plans to support Jasmine 2.0?
I've got a large amount of the work done for jasmine-node to upgrade to Jasmine 2.0, but I can't use these reporters since Pivotal changed the reporter spec.
You can use the Jasmine2.0 branch to test/work with or you can let me know and I'll plug them back in.
https://github.com/mhevery/jasmine-node/tree/Jasmine2.0

strict mode controlled by reporter?

We've run into an odd issue here.
In our dev environment we have two modes for using phantomJS for performing our javascript tests.
When processed locally we're simply running the tests through the jasmine console reporter while when run under our bamboo build system we use the NUnitXmlReporter.

A recently added module test set resulted in a clean test run locally, but when run in bamboo these new tests all resulted in a "TypeError: setting a property that has only a getter" error.
This was a valid error since there was a property in this module that only provided a getter accessor.
Looking into why/when such an error is generated appears to be when use strict mode is used.
We don't explicitly set strict mode so I'm curious why when run under the console reporter we don't see this same result? How/where would strict mode be turned on?

wrong delimiter for jars in envjs.runner.sh

hello,
while trying to use your great peace of code I stumbled upon some problems.
The first (very very small) one:
In row 7 of "envjs.runner.sh" you use a colon instead of a semicolon

../ext/js.jar:../ext/jline.jar
-------------^

for the second issue I will open another ticket.

So long,
Toralion

usage of TeamcityReporter with Protractor

Hi,
I'm wondering how should i configure the team city reporter.
the output shown in the console log but not in the output directory.

i would like the files to be saved to a certain directory, here is what i did:

      onPrepare: function() {
        // The require statement must be down here, since [email protected]
        // 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.TeamcityReporter('xmloutput', true, true)
        );
    },

Can someone tell me what am i doing wrong?

Allow for custom content in xml generated by JUnitXmlReporter

In my specific case I needed to insert a new tag to enable support for the Jenkins plugin https://wiki.jenkins-ci.org/display/JENKINS/Sauce+OnDemand+Plugin

I succeeded in doing this by overriding the JUnitXmlReporter.reportSpecResults function and adding my own implementation.

Doing it that way bears the danger of breaking compatibility in the future.

What about a standardized way to allow for customized junit xml content? For example by passing a callback function that will be called at the end of "reportSpecResults"?

Nested Describes Not Supported by JUnitXmlReporter

I had created a spec hierarchy in this manner:

describe
   describe
      it  
      it
   describe  
      it

The reporter throws an exception in reportSuiteResults due to the fact that spec is undefined. I did not dig deep into the code, but I am able to get around the exception by testing the value of spec in the for loop, in which case, the reporter will generate a separate JUnitXml file for each nested describe, and the top level describe also.

Has anyone documented how to use this module within jasmine-node

I was thinking of getting stuck into some Jasmine BDD for the node.js work I'm doing, but it appears as though what I have outlined in the title isn't something which appears to have been widely attempted.. Do you know of anyone who might provide some pointers?

Cheers

J

junit xmls not created by Node.js

Hi,
i'am using

"jasmine-node --verbose --junitreport --output junit/ --forceexit test/unit"

and after reinstalling via npm install it turns out that xmls are not created using Node.js.
After some debugging, a possible fix for

https://github.com/larrymyers/jasmine-reporters/blob/master/src/jasmine.junit_reporter.js#L187-L193

could be:

// PhantomJS, via a method injected by phantomjs-testrunner.js
try {
  if (window && window.fs_path_separator) {
    // turn filename into a qualified path
    filename = getQualifiedFilename(window.fs_path_separator);
    __phantom_writeFile(filename, text);
    return;
  }
} catch (f) {}

Somehow, the phantomjs case won`t throw an exception in my current setup...
With an older junit reporter version, it is working as well.

try {
  __phantom_writeFile(filename, text);
  return;
} catch (f) {}

Can't find variable: __phantom_writeFile

First of all, thank you for the awesome plugins!

I did find a couple of posts here and there on this issue, but since I am stuck with jasmine 1.3.1 (due to extensive usage of lazy loading in my angular.js application wherein jasmine 2.0 doesn't play nice), upgrading jasmine isn't possible unfortunately.

I am invoking the tests from phantomjs:

page.open('http://localhost:31531/tests/', function () {
    var monitor = setInterval(function () {
        // Capture the document element of the page
        var doc = page.evaluate(function () {
            return document;
        });

        // Execution completed
        if (doc.jasmineCompleted) {
            clearInterval(monitor);
            phantom.exit(returnCode);
        }
    }, 10);
});

And this is how I initialize my reporters:

var jasmineEnv = jasmine.getEnv();
var callback = jasmineEnv.currentRunner().finishCallback;

jasmineEnv.updateInterval = 1000;
jasmineEnv.addReporter(new jasmine.HtmlReporter());
jasmineEnv.addReporter(new jasmine.TapReporter());
jasmineEnv.addReporter(new jasmine.JUnitXmlReporter('.'));

jasmineEnv.currentRunner().finishCallback = function () {
    callback.call(this);
    document.jasmineCompleted = true;
};

jasmineEnv.execute();

The HTML and tap reporters work just fine. However the JUnit reporter throws this message:

Warning: writing junit report failed for 'C:\My\Projects\HudsonCI\TestScripts', 'TEST-layoutControllerTest.xml'. Reasons:
  Rhino attempt: Can't find variable: java
  PhantomJs attempt: Can't find variable: __phantom_writeFile
  NodeJS attempt: Module name "fs" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded

While I understand that jasmine 1.x may not be fully supported, is there anything I can do to get this working on my end? My tests are being run on a windows 7 Hudson build slave.

TeamCityReporter test results only show results from one browser when running multicapabilities

hello i'm running protractor via Grunt on team city and have the protractor config setup like this

onPrepare: function() {
        if (process.env.TEAMCITY_VERSION)
        {
            require('jasmine-reporters');
            jasmine.getEnv().addReporter(new jasmine.TeamcityReporter());
        }
    }

I'm running multi capabilities sequentially like


multiCapabilities: [{
            'browserName': 'firefox'
        }, {
            'browserName': 'chrome',
            'chromeOptions': {
                binary: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
                args: [],
                extensions: [],
            }
        }
    ],
    maxSessions: 1,

the team city reports only show the results from one browser. Is there support for a constructor like there is in the JunitXmlReporter as in here ...http://stackoverflow.com/questions/23081500/jasmine-reporters-option-for-protractors-multicapabilities-option

Or is there a way round this that you know of ?

Protractor "fit"

When using jasmine 2 with protractor the fit causes 0 tests to run.

saveToFile no longer required

saveToFile is no longer required in order to save to files. The plugin has been deprecated in PyPhantomJS (1.3.0) in favor of the new official fs api (also available in regular PhantomJS). Enjoy!

JUnitXmlReporter

JUnitXmlReporter is not generating any output file after the test run.
The test runs successfully.
And i am running my testcases from eclipse
but while debugging i realized that it is not able to interpret the java code to write data to the file.How do i resolve this issue
?

update npm page to 0.3.1

because running npm-check-updates displays

"jasmine-reporters" can be updated from 0.3.1 to 0.2.1 (Installed: 0.3.1, Latest: 0.2.1)

Do XHR CORS requests work with phantomjs-testrunner.js ?

No matter what options and proxy combinations we try, we can't get phantomjs-testrunner.js to even contact an external server. Has anyone tried any of these options sucessfully?

# phantomjs --local-to-remote-url-access=yes --web-security=no tests/libs/jasmine-reporters/test/phantomjs-testrunner.js tests/SpecRunner.html 
# phantomjs --web-security=no tests/libs/jasmine-reporters/test/phantomjs-testrunner.js tests/SpecRunner.html 
# phantomjs --local-to-remote-url-access=yes  tests/libs/jasmine-reporters/test/phantomjs-testrunner.js tests/SpecRunner.html 

# phantomjs --proxy=127.0.0.1:8071 --local-to-remote-url-access=yes --web-security=no tests/libs/jasmine-reporters/test/phantomjs-testrunner.js tests/SpecRunner.html 
# phantomjs --proxy=127.0.0.1:8071 --web-security=no tests/libs/jasmine-reporters/test/phantomjs-testrunner.js tests/SpecRunner.html 
# phantomjs --proxy=127.0.0.1:8071 --local-to-remote-url-access=yes  tests/libs/jasmine-reporters/test/phantomjs-testrunner.js tests/SpecRunner.html 

# phantomjs --proxy=127.0.0.1:8071 --local-to-remote-url-access=yes --web-security=no tests/libs/jasmine-reporters/test/phantomjs-testrunner.js http://127.0.0.1:8071/tests/SpecRunner.html 
# phantomjs --proxy=127.0.0.1:8071 --web-security=no tests/libs/jasmine-reporters/test/phantomjs-testrunner.js http://127.0.0.1:8071/tests/SpecRunner.html 
# phantomjs --proxy=127.0.0.1:8071 --local-to-remote-url-access=yes  tests/libs/jasmine-reporters/test/phantomjs-testrunner.js http://127.0.0.1:8071/tests/SpecRunner.html 

Here is some sample build output (we've tried the kitchen sink):
https://travis-ci.org/OpenSourceFieldlinguistics/FieldDB/builds/7311319

Facing Issues with Jasmine-reporters

Hi Larry

I am Facing some issues with Jasmine-reporters, I am unable to launch test if I placed the following code in conf.js

require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('D:\Protractor\TestResults',true, true)
);

I am getting error
[launcher] Error: Cannot find module 'jasmine-reporters'

As mentioned in your post, I tried to install the jasmine-reporters@`1.0.0, but still I am getting this error
Please look into the attached snapshots.

Thanks

conf
error
npm list

New release

A new release and a new upload to npm would be nice.

patch console-reporter to report 'Skipped' tests

The following patch adds handling for 'Skipped' tests (via specFilter ...):

From e940586b52755c36ddc60b65860e0e5119091620 Mon Sep 17 00:00:00 2001
From: unknown [email protected]
Date: Mon, 17 Feb 2014 12:33:19 -0600
Subject: [PATCH] jasmine.console-reporter: Add 'Skipped' test handling


src/jasmine.console_reporter.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/jasmine.console_reporter.js b/src/jasmine.console_reporter.js
index 7995bd0..ef31095 100644
--- a/src/jasmine.console_reporter.js
+++ b/src/jasmine.console_reporter.js
@@ -61,7 +61,9 @@
if (!this.hasGroupedConsole()) {
var resultText = "Failed.";

  •            if (spec.results().passed()) {
    
  •            if (spec.results().skipped ) {
    
  •                resultText = "Skipped.";
    
  •            } else if (spec.results().passed()) {
                 this.passed_specs++;
                 resultText = "Passed.";
             }
    
    --
    1.8.5.2.msysgit.0

Error on trying to install jasmine reporters

Hello,
On trying to install jasmine reportes using -npm install --save-dev jasmine-reporters@^1.0.0 I get this error
Error: EACCES, open '/Users/sudhamenon/.npm/_locks/jasmine-reporters-879bddd4c5cbab2c.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/sudhamenon/.npm/_locks/jasmine-reporters-879bddd4c5cbab2c.lock failed { [Error: EACCES, open '/Users/sudhamenon/.npm/_locks/jasmine-reporters-879bddd4c5cbab2c.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/sudhamenon/.npm/_locks/jasmine-reporters-879bddd4c5cbab2c.lock' }
npm ERR! Darwin 13.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save-dev" "jasmine-reporters@^1.0.0"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1

npm ERR! Attempt to unlock /Users/sudhamenon/hgauto/node_modules/jasmine-reporters, which hasn't been locked
npm ERR!
What could the reason be ? My jasmine version is "jasminewd": "1.1.0"
I appreciate your time looking in to this.Thanks

Error on jasmine-node side

Hi,

we get this error (TeamCity reporter) :

/home/panda/panda_git/internal/on_demand/automation/jasmine/nodejs/node_modules/jasmine-node/lib/jasmine-node/reporter.js:336
jasmineNode.TeamcityReporter.prototype = new jasmine.TeamcityReporter;
^
TypeError: undefined is not a function
at /home/panda/panda_git/internal/on_demand/automation/jasmine/nodejs/node_modules/jasmine-node/lib/jasmine-node/reporter.js:336:44
at Object. (/home/panda/panda_git/internal/on_demand/automation/jasmine/nodejs/node_modules/jasmine-node/lib/jasmine-node/reporter.js:342:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/panda/panda_git/internal/on_demand/automation/jasmine/nodejs/node_modules/jasmine-node/lib/jasmine-node/index.js:34:21)
at Module._compile (module.js:456:26)
[INFO] ---------------------------------------------

More info here:
http://stackoverflow.com/questions/24553915/jasmine-node-shows-error-when-ran-from-command-prompt

Problem with report for specs containing quotes

Hi, I am using your code to generate JUnit report with protractor. Some of my specs contain quotes and resulting in wrong XML attribute value.

An example: my text contains "quotes" results in my text contains "quotes"

And the reason is that first the " character is replaced with entity " and then on line 38 the & character is replaced again ...

phantomjs-testrunner patch for newer phantomjs builds

Hi!

Here's a patch that fixes __phantom_writefile and eliminates some unnecessary code for newer phantomjs builds that support passing arguments to .evaluate():
https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#wiki-webpage-evaluate

From 50bd3c059e112d3e9e3fb430077e5ef82c9bb328 Mon Sep 17 00:00:00 2001
From: unknown [email protected]
Date: Mon, 17 Feb 2014 11:04:29 -0600
Subject: [PATCH] phatnomjs-testrunner.js patched for newer phantomjs builds


test/phantomjs-testrunner.js | 73 ++++++++++++--------------------------------
1 file changed, 19 insertions(+), 54 deletions(-)

diff --git a/test/phantomjs-testrunner.js b/test/phantomjs-testrunner.js
index 75ad24e..9c211fd 100644
--- a/test/phantomjs-testrunner.js
+++ b/test/phantomjs-testrunner.js
@@ -1,3 +1,4 @@
+// Initially copied from jasmine-reporters project: https://github.com/larrymyers/jasmine-reporters.git
// Verify arguments
if (phantom.args.length === 0) {
console.log("Simple JasmineBDD test runner for phantom.js");
@@ -16,7 +17,7 @@ else {

 var setupPageFn = function(p, k) {
     return function() {
  •        overloadPageEvaluate(p);
    
  •        //overloadPageEvaluate(p);
         setupWriteFileFunction(p, k, fs.separator);
     };
    
    };
    @@ -57,74 +58,35 @@ else {
    }, 100);
    }

-// Thanks to hoisting, these helpers are still available when needed above
+
/**

  • Logs a message. Does not add a line-break for single characters '.' and 'F' or lines ending in ' ...'
    *
  • @param msg
    */
    function logAndWorkAroundDefaultLineBreaking(msg) {
    • var interpretAsWithoutNewline = /(^(\033[\d+m).F$)|( ...$)/;
    • if (navigator.userAgent.indexOf("Windows") < 0 && interpretAsWithoutNewline.test(msg)) {
    •    try {
      
    •        var system = require('system');
      
    •        system.stdout.write(msg);
      
    •    } catch (e) {
      
    •        var fs = require('fs');
      
    •        fs.write('/dev/stdout', msg, 'w');
      
    •    }
      
    • } else {
    •    console.log(msg);
      
    • }
    • console.log( msg );
      }

-/**

  • * Stringifies the function, replacing any %placeholders% with mapped values.
  • * @param {function} fn The function to replace occurrences within.
  • * @param {object} replacements Key => Value object of string replacements.
  • */
    -function replaceFunctionPlaceholders(fn, replacements) {
  • if (replacements && typeof replacements === "object") {
  •    fn = fn.toString();
    
  •    for (var p in replacements) {
    
  •        if (replacements.hasOwnProperty(p)) {
    
  •            var match = new RegExp("%" + p + "%", "g");
    
  •            do {
    
  •                fn = fn.replace(match, replacements[p]);
    
  •            } while(fn.indexOf(match) !== -1);
    
  •        }
    
  •    }
    
  • }
  • return fn;
    -}

-/**

  • * Replaces the "evaluate" method with one we can easily do substitution with.
  • * @param {phantomjs.WebPage} page The WebPage object to overload
  • */
    -function overloadPageEvaluate(page) {
  • page._evaluate = page.evaluate;
  • page.evaluate = function(fn, replacements) { return page._evaluate(replaceFunctionPlaceholders(fn, replacements)); };
  • return page;
    -}

-/* Stubs a fake writeFile function into the test runner.
+/
*

  • * Stubs a fake writeFile function into the test runner.
    *
    • @param {phantomjs.WebPage} page The WebPage object to inject functions into.
    • @param {string} key The name of the global object in which file data should
    •                 be stored for later retrieval.
      
      */
      -// TODO: not bothering with error checking for now (closed environment)
      function setupWriteFileFunction(page, key, path_separator) {
  • page.evaluate(function(){
  •    window["%resultsObj%"] = {};
    
  •    window.fs_path_separator = "%fs_path_separator%";
    
  • page.evaluate(function(key, path_separator){
  •    window[key] = {};
    
  •    window.fs_path_separator = path_separator;
    
  •    console.log( "Registering __phantom_writeFile function with phantomjs runtime for " + key );
     window.__phantom_writeFile = function(filename, text) {
    
  •        window["%resultsObj%"][filename] = text;
    
  •        console.log( "__phantom_writeFile stashing data to " + key + "/" + filename );
    
  •        window[key][filename] = text;
     };
    
  • }, {resultsObj: key, fs_path_separator: path_separator});
  • }, key, path_separator );
    }

/**
@@ -135,9 +97,9 @@ function setupWriteFileFunction(page, key, path_separator) {

  •                 be the same key provided to setupWriteFileFunction.
    
    */
    function getXmlResults(page, key) {
  • return page.evaluate(function(){
  •    return window["%resultsObj%"] || {};
    
  • }, {resultsObj: key});
  • return page.evaluate(function(key){
  •    return window[key] || {};
    
  • }, key );
    }

/**
@@ -178,12 +140,15 @@ function processPage(status, page, resultsKey) {
};
var ival = setInterval(function(){
if (isFinished()) {

  •            console.log( "PhantomJS test finished!  Looking for results at " + resultsKey + "..." );
             // get the results that need to be written to disk
             var fs = require("fs"),
                 xml_results = getXmlResults(page, resultsKey),
                 output;
    
  •            console.log( "Got Jasmine Junit-format results for " + resultsKey );
             for (var filename in xml_results) {
                 if (xml_results.hasOwnProperty(filename) && (output = xml_results[filename]) && typeof(output) === "string") {
    
  •                    console.log( "Writing XML results to: " + filename );
                     fs.write(filename, output, "w");
                 }
             }
    
    --
    1.8.5.2.msysgit.0

HTTP reporter

Thanks for making this!

I'm about to build a reporter that sends an HTTP post request to my API from hundreds of distributed laptops. Have you considered the merit of a reporter that posts results to an arbitrary endpoint? Have you discovered a reporter that already does this?

Undefined is not a function error is coming

Hi
i am using bellow code to generate reports but undefined error is coming
onPrepare: function(){
require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('testresults/' ,true, true));
}

Thanks,
OmPrakash

Update saveToFile plugin

The saveToFile plugin has been updated a bit since the version you guys have in your repository. 0.4.1 is the latest.

http://dev.umaclan.com/projects/pyphantomjs/wiki/Plugins#Save-to-File

  • Please note that the plugin is (likely) only working on the latest master (but may still work with earlier ones, not sure yet though). I haven't tested it with any earlier revisions. Since the architecture has changed since our 1.2 changes, it may/may not work with the version you guys want to use. If you need any changes to it, let me know, and I can make the plugin work.

P.S. PyPhantomJS 1.1 was never shipped with the plugin system. It was added a little after the release, and will be available for 1.2, which has new architecture changes. Just thought I'd add this in here for fyi.

HTML Reporter?

First thanks for the code!
This issue is half question / half issue and I would be happy to contribute a PR to close the issue depending on the answer I get.

In summary I have 3 questions:
Is there a HTML reporter included in jasmine-reporters that I can call from protractor onPrepare() similar to how JUnitXmlReporter is called in the code sample below?
If not, are there suitable alternatives in the open source community?
If not, would adding one to jasmine-reporters be a worthwhile and likely to be accepted PR ?

Details:
I am looking for a HTML reporter similar to karma's HTML reporter [1] that I can use to generate HTML formatted test reports when testing an angular app with protactor+jasmine.

My app currently uses protractor and jasmine-reporters as follows:

onPrepare: function() {
  ...
  jasmine.getEnv().addReporter(
    new jasmine.JUnitXmlReporter('test/reports/behavioural-xml', false, true)
  );
  ...
}

I have been looking around for a suitable HTML reporter to add, but have not yet found one.
I am successfully using 'protractor-html-screenshot-reporter' [2] , but I don't actually want the screen shots and it is adding about 1 second overhead per test.

In leiu of an existing solution the two options I am considering at the moment:

1. submit PR to 'protractor-html-screenshot-reporter' disable screenshots
2. submit PR to 'jasmine-reporters' to add HTML reporter

[1] https://github.com/dtabuenc/karma-html-reporter
[2] https://github.com/jintoppy/protractor-html-screenshot-reporter

thanks for your time and advice
Kyle Zeeuwen

Console report is incorrect when running subset

When I pass a url to the spec-runner that makes jasmine execute just a subset of a the tests (e.g. localhost/JasmineSpecRunner.html?spec=SomeSpec),

Then the report says:
SUCCESS: 235 specs, 0 failures, 0 skipped, 0 disabled in 0.196s.

Which is incorrect, the total specs are 235, but I ran just a few of them... so I expected there were either less specs, or X skipped/disabled.

I'm using jasmine-reporters 2.0.3 and jasmine 2.0.2 with phantomjs

savePath in jasmine.junit_reporter.js does not account for a value without a path delimiter

When I call jasmine-node from the terminal with the following command:

jasmine-node --forceexit --noColor --junitreport --output junit-reports test

A directory called ./junit-reports reports is created and all test result files are created in the current directory (./) with the following naming scheme:

junit-reportsTEST-{test name}.xml

The expected result of the above command should be:

  • ./junit-reports gets created
  • Test result files are created under the ./junit-reports directory with the naming scheme of TEST-{test name}.xml

Looking at jasmine.junit_reporter.js, it looks like the problematic code is on lines 128 and 132:

this.writeFile(this.savePath + fileName, output);

Unable to sequentially load files via envjs.bootstrap.js

I am calling envjs.bootstrap.js with multiple test files. I have confirmed that it works correctly for a single test file. From inspection of the bootstrap file, it appears that this should be possible:

java -jar ./html/assets/js/jasmine/env/js.jar -opt -1 ./html/assets/js/jasmine/env/envjs.bootstrap.js ./html/tests/test1/test.html ./html/tests/test2/test.html

However, when I run this, I receive a failure to load error on the second file.

JavaException: java.io.FileNotFoundException: /home/~fullpath-here~/html/tests/test1/html/tests/test2/test.html

I've tried several approaches to fix this, with absolute paths, file:// paths, and several other options. None seem successful. In fact, it appears that if I use absolute paths that the entire system hangs on the window.location call.

Does the envjs.bootstrap.js file support processing multiple tests?

Thanks for this library - it really is very useful. We've got a phpunit reporter that we'd like to contribute back to the project in the near future.

No output from Console Reporter [OS X]

I'm using

$ ./envjs.runner.sh console_reporter.html

which doesn't generate any output on the console. Isn't it supposed to be? Am I missing sth?

JUnit XML reporter works fine btw.

Any ideas?

Submodule versus npm

I'm pretty new to node, but was wondering why jasmine-reporters uses a submodule instead of package dependency? Makes the library difficult if you need to bring the source code in house for code-reproducibility issues. Submodules force a hard link to an external resource, which may or may not be available.

Thanks,
Sean

Wrong escaping order

Had escaping problem, when name of my test contained double quots - they were escaped like this: &quot;. Jenkins did not accept this report. When ampersand was escaped (&amp;quot;) - everything worked well. Changing escaping order (i. e., esaping ampersand in the last) should solve this issue.

protractor 2.0 fails with `Cannot read property '_failures' of undefined`

I want to use the jasmine-reports with the protractor 2.0, but I'm getting an error:

/Dev/project/node_modules/jasmine-reporters/src/junit_reporter.js:154
            if (isFailed(spec)) { spec._suite._failures++; }
                                             ^
TypeError: Cannot read property '_failures' of undefined

I checked the 'spec' object, it's like this currently (no _suite property)

{ id: 'spec0',
  description: 'should contain basic identifiers',
  fullName: 'episode: TC14235 required fields should contain basic identifiers',
  failedExpectations: 
   [ { matcherName: '',
       message: 'Failed: undefined is not a function',
       stack: 'Error: Failed: undefined is not a function\n    at stack (/Dev/project/node_modules/protractor/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1441:17)\n    ...
       passed: false,
       expected: '',
       actual: '' } ],
  passedExpectations: [],
  status: 'failed',
  _endTime: Thu Apr 16 2015 10:42:18 GMT-0400 (EDT) }

May be I'm doing something not supported in the 2.0?

Thanks

Result counts are incorrect with beforeEach and afterEach declarations.

Given this spec hierarchy:

describe
   beforeEach
   afterEach
   it
   it
   it
   it
   it

The reporter tells me that 8 tests had passed, while really only 5 were executed. If I remove the beforeEach and afterEach declarations, the correct result count is given.

Minor, especially considering that the end results, the JUnit xml is correct, but may be confusing to some.

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.