GithubHelp home page GithubHelp logo

Comments (11)

lenntt avatar lenntt commented on July 28, 2024

I verified this again from a clean environment. I can't get multiple formats to work in any way.
@gkushang any idea what might be (or might I be doing) wrong?

from grunt-cucumberjs.

gkushang avatar gkushang commented on July 28, 2024

Hi @SirLenz0rlot

Did you try with below options? It works for us. Plus, our cucumber version is "cucumber": "0.9.5", which has multi-formatter support,

    return {
            options: {
                formats: ['html', 'pretty'],
                output: 'test/acceptance/report/cucumber_report.html',

Let us know if it does not work.

from grunt-cucumberjs.

lenntt avatar lenntt commented on July 28, 2024

I was on cucumber 0.9.2, but even upgrading cucumber to 0.10.2 didn't help.

It doesn't throw errors, but it doesn't print any 'pretty' output when running either.

The spawn arguments when spawning cuucmber seem to be ok.
When I do
node_modules/cucumber/bin/cucumber.js -t @signoff -f pretty -f json:reports/cucumber.html.json
I get both a json and the pretty print.

from grunt-cucumberjs.

lenntt avatar lenntt commented on July 28, 2024

I think I found the cause, in processHandler.js, options.isHtml is being used as a flag to
'eat up' console logging.

This makes things bettter for me, but may pollute the terminal for other users (?):

cucumber.stdout.on('data', function(data) {
    grunt.log.write(data);
    if (options.isHtml) {
        if (options.debug) {
            process.stdout.write(data);
        }
        buffer.push(data);
    }
});

The current code:

cucumber.stdout.on('data', function(data) {
    if (options.isHtml) {
        if (options.debug) {
            process.stdout.write(data);
        }
        buffer.push(data);
    } else {
        grunt.log.write(data);
    }
});

from grunt-cucumberjs.

gkushang avatar gkushang commented on July 28, 2024

@SirLenz0rlot Did you try providing multi-formatters in your CucumberJs options as shown below,

    return {
            options: {
                formats: ['html', 'pretty'],

It should pretty print the console when you run the tasks without Parallel executions. Let us know if that does not work for you.

from grunt-cucumberjs.

lenntt avatar lenntt commented on July 28, 2024

Yes, of course I did :), as in the first post.
It doesn't for me.
Op 26 apr. 2016 5:38 PM schreef "Kushang Gajjar" [email protected]:

@SirLenz0rlot https://github.com/SirLenz0rlot Did you try providing
multi-formatters in your CucumberJs options as shown below,

return {
        options: {
            formats: ['html', 'pretty'],

It should pretty print the console when you run the tasks without Parallel
executions. Let us know if that does not work for you.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#62 (comment)

from grunt-cucumberjs.

gkushang avatar gkushang commented on July 28, 2024

@SirLenz0rlot We are able to pretty print with [email protected]. It would be very helpful to debug if you could share any errors you see, the command you use to run tasks and cucumberjs.js options.

from grunt-cucumberjs.

lenntt avatar lenntt commented on July 28, 2024

This is one of the many grunt configurations I tried in my Gruntfile.js.
I call it with grunt cucumberjs:signoff

    cucumberjs: {
        options: {
            tags: [ "~@Pending "],
            formats: ["html", "pretty"],
            templateDir: "template",
            output: "reports/cucumber.html",
            saveJSon: "true"
        },
        features: [],

        signoff: {
            options: {
                tags: [ "~@Pending", "@signoff" ]
            }
        },
  }

As mentioned before, I'm not seeing any errors, it just doesn't print any cucumber output to the terminal.
Oh, and I'm on Ubuntu 14.04.

If you run yourself with formats: ["html", "pretty"]. Does your code hits the callback on cucumber.stdout.on('data', in processHandler.js ??

The code in processHandler.js seems to only log to the terminal (like pretty print) if options.isHtml is not set to true, which is the case, because I use 'html' too as a formatter.

from grunt-cucumberjs.

vidz2 avatar vidz2 commented on July 28, 2024

@SirLenz0rlot I had the same issue as you. As a workaround I added debug: true in the options and it seems to print the output to console log and html report.

cucumberjs: {
        options: {
            tags: [ "~@Pending "],
            formats: ["html", "pretty"],
            debug: "true",
            templateDir: "template",
            output: "reports/cucumber.html",
            saveJSon: "true"
        },
        features: [],

        signoff: {
            options: {
                tags: [ "~@Pending", "@signoff" ]
            }
        },
  }

from grunt-cucumberjs.

lenntt avatar lenntt commented on July 28, 2024

@vidz2 Thanks, I'm glad I'm not the only one struggling.
I'm using the debug flag too, for now.

from grunt-cucumberjs.

gkushang avatar gkushang commented on July 28, 2024

closing the issue since "debug: true" prints the console with pretty formatter

from grunt-cucumberjs.

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.