Code Monkey home page Code Monkey logo

gulp-cucumber's People

Contributors

bitdeli-chef avatar carcer avatar darrinholst avatar dblooman avatar dtinth avatar jimcresswell avatar jpchip avatar mhoyer avatar mrhen avatar pulsar256 avatar rehia avatar rlindgren avatar u9520107 avatar vgamula avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

gulp-cucumber's Issues

Issue when migrating cucumber from 1.0.0 to 1.2.0

Hello,

after cucumber version was updated i run into an issue:

cucumber event handlers attached via registerHandler are now passed the associated object instead of an event
getPayloadItem will be removed in the next major release

C:\dev\Topic Analyst\Frontend\node_modules\cucumber\lib\cucumber\runtime\event_broadcaster.js:30
throw error;
^
function accepts a callback and returns a promise

0 passing (3.30s)

[10:43:31] 'cucumber' errored after 3.51 s
[10:43:31] Error in plugin 'gulp-webdriver'
Message:
wdio exited with code 1

I got an answer from cucumber: cucumber/cucumber-js#601 (comment)

we are hooking to "beforeFeature" - I think gulp-cucumber uses callbacks. If so cna you do cucumber version upgrade and made a fix for this?

gulp-cucumber does not exit when done

Currently we have to use the gulp-exit plugin to get gulp-cucumber to exit when the tests are done:

var gulp = require('gulp'),
    plugins = require('gulp-load-plugins')();

gulp.task('cucumber', ['env-test'], function () {
    return gulp.src('features/*')
        .pipe(plugins.cucumber({
            'steps': 'features/**/*.steps.js',
            'support': 'features/support/*.js',
            'format': 'pretty',
            'tags': '~@ignore'
        }))
        .pipe(plugins.exit());
});

Perhaps for this reason we also do not get exit code 1 when cucumber tests fail. How are others using this plugin?

(Tried both 0.0.14 and 0.0.22)

World constructor issues

Do I need to set the options.support to the location of where I define world.js so that I can use the world abstraction wherever I need to? If I don't do so, I get an error when I run my tests such as field not defined.

Using ES6 code in step definitions not woking

Is it possible to use the Babel transpiler for ES6 code in gulp mocha its possible by passing flag:
compilers: {
js: babel
}

/**
 * Run Unit tests
 */
gulp.task('test:unit', 'Launch Unit Test Runner - Mocha', function () {
    return gulp.src(['test/**/*.test.js'])
        .pipe($.mocha({
            compilers: {
                js: babel
            },
            timeout: 1500,
            reporter: 'min'
        }));
});

/**
 * Run BDD tests
 */
gulp.task('test:bdd', 'Launch BDD Test Runner - Cucumber', function (callback) {
    return gulp.src('test/features/**/*.feature').pipe($.cucumber({
        'steps': 'test/features/**/step_definitions/*.steps.js',
        'support': 'test/features/**/support/*.js',
    })).once('end', function () {
        console.log('stream end!!');
        callback();
    });
});

world-parameters

Would it be possible to add support for world-parameters?

Thanks

gulp-cucumber and gulp-browserstack do not play nicely together

This is my gulpfile:

var gulp = require('gulp');

var cucumber = require('gulp-cucumber')
var browserStack = require('gulp-browserstack');

gulp.task('cucumber', function() {
  return gulp.src('features/my_feature.feature')
    .pipe(browserStack.startTunnel({
      key: '<itsasecret>'
    }))
    .pipe(cucumber({}))
    .pipe(browserStack.stopTunnel());
});

When all the scenarios pass, gulp hangs, and never exits.

gulp-cucumber exits with code 0 although tests are failing

See travis-ci build output here: https://travis-ci.org/joniba/bidding-express-test/jobs/88510330
Source code here: https://github.com/joniba/bidding-express-test

Could it have to do with my BeforeFeatures and AfterFeatures hooks (https://github.com/joniba/bidding-express-test/blob/master/features/support/hooks.js)? I'm trying to start the server before running the BDD tests and shut down the server once they are done. I'm calling process.exit because otherwise running cucumber via gulp-cucumber does not exit.

For comparison, the same concept is working when using mocha: https://travis-ci.org/joniba/bidding-express-test/jobs/88523877 (5 tests failed and gulp-mocha exits with code 1, not 0, causing the build to fail).

plugin version

It seems that there is a difference between the current repository and what is published in npm. But both versions are 0.0.4.
Plugin version might be updated as well as npm repository

Recent change is now hanging our build

Just an FYI for anyone who is experiencing hangs in their build after upgrading to gulp-connect v0.0.19

The change in PR #29 was a breaking change. We had some logic that was listening for the 'end' event and was then shutting down our test servers.

Its fixable by changing your logic from something like:

gulp.task('test:client:integration', function (callback) {
    var options = { ... };
    gulp
        .src(paths.clients.features)
        .pipe($.cucumber(options)).on('end', function () {
          testServer.shutdown(callback)
        });
});

to:

gulp.task('test:client:integration', ['test:client:cucumber'], function (callback) {
    testServer.shutdown(callback);
});
gulp.task('test:client:cucumber', function () {
    var options = { ... };
    return gulp 
        .src(paths.clients.features)
        .pipe($.cucumber(options));
});

emitErrors does not work anymore

Cucumber cli returns following object when

{ shouldExitImmediately: false, success: true }

Due to this update condition is always evaluated to true and does not thorw errors when test fails

  cli.run().then((success) => {
    if (success || !emitErrors) {

I have checked difference between versions and this change was introduced in version 4 of cucumber and it was not working properly since.

Typo in README

I followed your README and perhaps found a typo?

For me, this as shown in the README, didn't work:

gulp.task('cucumber', function() {
    return gulp.src('./test/server/features/foo/*.feature').pipe(cucumber({
        "steps": './test/server/features/definitions/*.js',
        "support": './test/server/features/support/*.js'
    }));
});

but this, without the quoted keys, did work:

gulp.task('cucumber', function() {
    return gulp.src('./test/server/features/foo/*.feature').pipe(cucumber({
        steps: './test/server/features/definitions/*.js',
        support: './test/server/features/support/*.js'
    }));
});

Any ideas?
I'm on OSX 10.10.5, Node v4.3.2, Gulp CLI version 1.1.0, Gulp local version 3.9.1

cucumber.js 4.x no longer has --compiler option

I would like to test my project with cucumber.js, but with Typescript files. This can be achieved by the following command line:
cucumber-js --require-module ts-node/register --require "steps/**/*.ts"

The gulp plugin still uses the older --compiler ts:ts-node/register parameter. It would be very helpful if the plugin would facilitate for the newer command line options of cucumber 4.x

Cucumber upgrading not possible

Since this npm library was developed with old version of Cucumber npm dependency, it is not possible to upgrade the cucumber version since the old library is deprecated and the new library's location has changed.

image

Need to update the Gulp-Cucumber library with the new Cucumber library which is @cucumber/cucumber and not not cucumber only

cucumber-js binary path resolution error

I've been receiving an ENOENT error trying to run gulp-cucumber, even though I have no problems executing the same cucumber-js command from the command line, so I had to look into it some more and I found that this line:

var UnixPath = __dirname + '/node_modules/cucumber/bin/cucumber.js';

was actually binding the path relative to the gulp-cucumber directory:

    '~/appName/node_module/gulp-cucumber/node_modules/cucumber/bin/cucumber.js'

instead of

    '~/appName/node_modules/cucumber/bin/cucumber.js'

Changing the path prefix to process.cwd() fixed it.

    var UnixPath = process.cwd() + '/node_modules/cucumber/bin/cucumber.js';

I am running:
• Mac OSX 10.10
• gulp CLI v3.6.1
• gulp Local v3.8.9

Add a test

a little autoexecutable test with a .travis.yml file for CI would be nicey

Can not use with watch

If I use gulp-cucumber in connection with some sort of watch (e.g. gulp.watch or gulp-watch), cucumber doesn't reload the step files when i kick off the new cucumber execution. Internally, cucumber.js is using require() to load the step files, so they are already cached when gulp-cucumber executes the CLI a second time.

Always looks for 'features' folder

Hi 😄,

My gulp task looks like below:

gulp.task('test:acceptance', function() {
    return gulp.src('test/*').pipe(cucumber({
        'steps': 'test/functional/*.js',
        'support': 'test/functional/support/*.js',
    }));
});

But I keep getting the below error:

fs.js:1574
  return binding.realpath(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOENT: no such file or directory, realpath 'features'
    at Error (native)
    at Object.realpathSync (fs.js:1574:18)
    at Object.expandPathWithExtensions (/Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli/path_expander.js:15:23)
    at /Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli/path_expander.js:9:27
    at Array.map (native)
    at Object.expandPathsWithExtensions (/Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli/path_expander.js:7:31)
    at Object.expandPaths (/Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli/feature_path_expander.js:9:38)
    at Function.Configuration (/Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli/configuration.js:21:63)
    at getConfiguration (/Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli.js:63:38)
    at Object.run (/Users/Marthinus/Code/global-web/sbg-module-generator/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli.js:69:27)

My modules folder structure is:

root 
| ----- test 
            |-----functional 
                      |---folder_with_tests
                      |---another_folder_with_tests
                      |---support

problems with cucumber 3

Hi there,

I am using cucumber-js 3 and having problems running cucumber tests with gulp-cucumber. Same feature files are working with cucumber-js but failing with gulp-cucumber.

Here is the error I am getting:

[21:29:02] Starting 'cucumber'...
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.relative (path.js:1254:5)
    at getDefinitionLineAndUri (/Users/ooo/projects/poc/gulp-cucumber-test/node_modules/cucumber/lib/support_code_library_builder/define_helpers.js:144:28)
    at /Users/ooo/projects/poc/gulp-cucumber-test/node_modules/cucumber/lib/support_code_library_builder/define_helpers.js:108:34
    at /Users/ooo/projects/poc/gulp-cucumber-test/features/step_definitions/browser_steps.js:5:3
    at defineSupportCode (/Users/ooo/projects/poc/gulp-cucumber-test/node_modules/cucumber/lib/support_code_library_builder/index.js:43:9)
    at Object.<anonymous> (/Users/ooo/projects/poc/gulp-cucumber-test/features/step_definitions/browser_steps.js:4:1)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at /Users/ooo/projects/poc/gulp-cucumber-test/node_modules/gulp-cucumber/node_modules/cucumber/lib/cucumber/cli/support_code_loader.js:63:29
    at Array.forEach (<anonymous>)

Any ideas or workarounds?
Cheers

Gulp task finishes after the gulp task finishes

[14:29:52] Using gulpfile \gulpfile.js
[14:29:52] Starting 'unit-test'...
[14:29:52] Finished 'unit-test' after 22 ms

Feature: a
   ....

I think the gulp task should end after the cucumber tests.

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.