Git Product home page Git Product logo

cucumber-boilerplate's Introduction

Stand With Ukraine

WebdriverIO

Next-gen browser and mobile automation test framework for Node.js.

Build Status Package Health OpenSSF Best Practices
Support Channel Issue Resolution time Open issues


Homepage | Developer Guide | API Reference | Contribute | Changelog | Roadmap


WebdriverIO is a test automation framework, for e2e as well as unit and component testing in the browser, that allows you to run tests based on the WebDriver and WebDriver BiDi as well as Appium automation technology. It provides support for your favorite BDD/TDD test framework and will run your tests locally or in the cloud using Sauce Labs, BrowserStack, TestingBot or LambdaTest.

πŸ‘©β€πŸ’» πŸ‘¨β€πŸ’» Contributing

Do you like WebdriverIO and want to help make it better? Awesome! Have a look into our Contributor Documentation to get started and find out what contributions can be and how to make them.

Getting started with GitHub Codespaces

To get started, create a codespace for this repository by clicking this πŸ‘‡

Open in GitHub Codespaces

A codespace will open in a web-based version of Visual Studio Code. The dev container is fully configured with the software needed for this project.

Note: Dev containers are an open spec that is supported by GitHub Codespaces and other tools.

Getting started with Gitpod

You can also just click on:

Open in Gitpod

to get a ready-to-use development environment for you to start working on this code base.

If you're looking for issues to help out with, check out the issues labeled "good first pick". You can also reach out to our Matrix Channel if you have questions on where to start contributing.

🏒 WebdriverIO for Enterprise

Available as part of the Tidelift Subscription.

The maintainers of WebdriverIO and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open-source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

πŸ“¦ Packages

This repository contains some of the core packages of the WebdriverIO project. There are many wonderful curated resources the WebdriverIO community has put together.

Did you build a WebdriverIO service or reporter? That's awesome! Please add it to our configuration wizard and docs (e.g. like in this example commit) as well as to our awesome-webdriverio list. Thank you! πŸ™ ❀️

Core

  • webdriver - A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol
  • webdriverio - Next-gen browser and mobile automation test framework for Node.js
  • @wdio/cli - A WebdriverIO testrunner command line interface

Helper

  • @wdio/config - A helper utility to parse and validate WebdriverIO options
  • @wdio/logger - A helper utility for logging WebdriverIO packages
  • @wdio/protocols - Utility package providing information about automation protocols
  • @wdio/repl - A WDIO helper utility to provide a repl interface for WebdriverIO
  • @wdio/reporter - A WebdriverIO utility to help report all events
  • @wdio/runner - A WebdriverIO service that runs tests in arbitrary environments
  • @wdio/utils - A WDIO helper utility to provide several utility functions used across the project
  • @wdio/globals - A WDIO helper utility for importing global variables directly

Reporter

Services

  • @wdio/appium-service - A WebdriverIO service to start & stop Appium Server
  • @wdio/browserstack-service - A WebdriverIO service that can be used to use BrowserStack Test Observability which is a reporting, debugging, and test suite quality tracking tool for any test running anywhere. The service also helps for a better integration with the BrowserStack grid if you're running tests on the grid.
  • @wdio/lighthouse-service - A WebdriverIO service that integrates Google Lighthouse commands to use it for automate tests
  • @wdio/firefox-profile-service - A WebdriverIO service that lets you define your Firefox profile in your wdio.conf.js
  • @wdio/sauce-service - A WebdriverIO service that provides a better integration into Sauce Labs
  • @wdio/shared-store-service - A WebdriverIO service to exchange data across processes
  • @wdio/testingbot-service - A WebdriverIO service that provides a better integration into TestingBot

Runner

Framework Adapters

Others

Infrastructure Packages

These packages are not released to NPM and used to work on this codebase.

  • @wdio/compiler - Esbuild script to compile the source code all of all packages
  • @wdio/lerna-patch - This sub-package is being used to patch Lerna to not run pnpm install after it prepared all packages for release

🀝 Project Governance

This project is maintained by awesome people following a common set of rules and treating each other with respect and appreciation.

πŸ‘¨β€πŸ³ πŸ‘©β€πŸ³ Backers

Become a backer and show your support for our open-source project.

πŸ’Έ Sponsors

Does your company use WebdriverIO? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time to maintenance and new features for everyone. Also, your company's logo will show on GitHub - who doesn't want a little extra exposure? Here's the info.

πŸ’Ž Premium Sponsor

We are immensely grateful to our exclusive Premium Sponsor for their invaluable support in the development of this project:

BrowserStack Β  Β  Β  Sauce Labs

πŸ₯‡ Gold Sponsor

Route4Me

πŸ₯ˆ Silver Sponsor

TestingBot Β  Β  Β  Lambdatest

πŸ₯‰ Bronze Sponsor

Eslint

πŸ“„ License

MIT

FOSSA Status

πŸ”° Badge

Show the world you're using webdriver.io β†’ tested with webdriverio

GitHub markup
[![tested with webdriver.io](https://img.shields.io/badge/tested%20with-webdriver.io-%23ea5906)](https://webdriver.io/)
HTML
<a href="https://webdriver.io/">
    <img alt="WebdriverIO" src="https://img.shields.io/badge/tested%20with-webdriver.io-%23ea5906">
</a>

πŸ‘ Supporters

Stargazers repo roster for WebdriverIO Forkers repo roster for WebdriverIO

Animated footer bars


Back to top

cucumber-boilerplate's People

Contributors

alexcason avatar amarnathk1547 avatar avocadoslab avatar canvaspixels avatar cbou avatar chrismcmahon avatar christian-bromann avatar dandv avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar harsha509 avatar lrochewb avatar marketionist avatar matthewb531 avatar mgrybyk avatar ns-mnawaz avatar nwwells avatar piersroberts avatar rorymckinley avatar rvdbogerd avatar santius avatar saranyaeaswaran avatar scg82 avatar seanpoulter avatar shubhit7 avatar simonbcky avatar tejasv02 avatar wswebcreation avatar wvankuipers 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber-boilerplate's Issues

After following the steps I cannot run tests - 'SupportCode' of undefined

Issue description

When following the steps provided in the cucumber readme I cannot run even your default feature tests successfully.

Steps to reproduce

Pre-requisites - [email protected], npm

  1. git clone https://github.com/webdriverio/cucumber-boilerplate.git
  2. cd cucumber-boilerplate
  3. npm install

Additional step, not included in readme, because this file is missing from package.json:
4) npm install cucumber --save

  1. npm run-script local-webserver
  2. open new cmd dialog - enter - node_modules.bin\wdio
    to trigger wdio

Expected behavior

I guess for the tests to run.

Actual behavior

browsers open, then suddently it crashes with this:
ERROR: Cannot read property 'SupportCode' of undefined

Issue occurred on browser/platform

windows 10.

An in-range update of jest is breaking the build 🚨

Version 20.0.4 of jest just got published.

Branch Build failing 🚨
Dependency jest
Current Version 20.0.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As jest is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Using junit reporter with cucumber-boilerplate seems to not work

Using cucumber-boilerplate with junit reporter, I get an error:
This is inside my wdio.conf:

    reporters: ['spec','junit'],
    reporterOptions: {
        junit: {
            outputDir: './reports/'
        }
    },  

This is are my package.json dependencies:

    "babel-polyfill": "~6.20.0",
    "babel-preset-es2015": "~6.18.0",
    "babel-register": "~6.18.0",
    "chai": "~3.5.0",
    "cucumber": "^1.3.1",
    "eslint": "~3.13.1",
    "eslint-config-airbnb-base": "~11.0.1",
    "gulp": "^3.9.1",
    "gulp-util": "^3.0.8",
    "gutil": "^1.6.4",
    "lodash": "^4.17.4",
    "node-notifier": "^5.1.2",
    "wdio-cucumber-framework": "~0.2.15",
    "wdio-junit-reporter": "^0.3.0",
    "wdio-phantomjs-service": "~0.2.2",
    "wdio-selenium-standalone-service": "~0.0.7",
    "wdio-spec-reporter": "~0.0.5",
    "webdriverio": "~4.6.1"

This is my gulp task which triggers the test:

gulp.task('webdriverTest', ['selenium'], function() {
  var creatLauncherWithConfig = function(env){
    var strFile = path.join(__dirname, 'wdio.conf.js');
	  var wdio = new Launcher(strFile);	  
    return wdio;
  }
  var wdio = creatLauncherWithConfig(gutil.env);
  wdio.run().then(function (code) {
      process.exit(code);
    }, function (error) {
      console.error('Launcher failed to start the test', error.stacktrace);
      process.exit(1);
  });
});

This is the error:

cucumber_boilerplate_prototype\node_modules\webdriverio\build\lib\utils\BaseReporter.js:336
                        throw _iteratorError;
                        ^

TypeError: Cannot read property 'toLowerCase' of undefined
    at JunitReporter.prepareName (c:\projects\cucumber_boilerplate_prototype\node_modules\wdio-junit-reporter\build\reporter.js:98:24)
    at JunitReporter.prepareXml (c:\projects\cucumber_boilerplate_prototype\node_modules\wdio-junit-reporter\build\reporter.js:147:57)
    at JunitReporter.onEnd (c:\projects\cucumber_boilerplate_prototype\node_modules\wdio-junit-reporter\build\reporter.js:75:36)
    at emitOne (events.js:77:13)
    at JunitReporter.emit (events.js:169:7)
    at BaseReporter.handleEvent (c:\projects\cucumber_boilerplate_prototype\node_modules\webdriverio\build\lib\utils\BaseReporter.js:324:35)
    at Launcher.endHandler (c:\projects\cucumber_boilerplate_prototype\node_modules\webdriverio\build\lib\launcher.js:637:28)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Incorrect order in checkUrl helper & missing this. in isExisting helper

Hello,

I found to issues in the test templates.

The first is a incorrect order of element in the checkUrl helper:

result.value.should.equal(url, 'expected url to be "<result>"  but found "<expected>');

This should be:

result.value.should.equal(url, 'expected url to be "<expected>"  but found "<result>');

The other issue is with the isExisting helper on line 6:

browser.elements(selector, function (err, elements) {

The this. reference is missing:

this.browser.elements(selector, function (err, elements) {

I created a pull request that will correct both issues.

Is Windows supported?

Following the instruction on my Windows 7 (with all the necessary packages installed), I struggled to get the run.js to work with Node or Mocha.

Is windows supported and if so, what commands should I use?

Under which exact circumstances are multiple browser instances created?

Not sure if this issue is only related to the boilerplate, or also to the webdriverIO multiremote mode:

When I have set options for my browser instances in my default config.js:

...,
options: {
    browser1: {
        logLevel: 'silent'
    },
    browser2: {
        logLevel: 'silent'
    }
},
...

but I want to execute a test with only one browser instance, I use the ENV_NODE variable and write a file config.myCustomTest.js containing:

...,
capabilities: {
    browser1: {
        platform: "WINDOWS",
        browserName: "chrome"
        }
    }
},
...

This leads to the execution of the tests with two browsers (where the capabilities of browser2 are undefined and change on every execution). It seems that the options, which are set in config.js are enough to trigger the execution in multiple browsers. It would be much nicer, if I could set my default for the options without having to overwrite them every time, if I need less browsers than I have options for, because I'm usually not changing the options from test to test and would love to set these values as default.

clearInputField Not Working

Issue description

Please provide a brief description of the problem you are experiencing

I wish to clear a text input field of its text, but it does not remove the tet.

Steps to reproduce

How can you reproduce the issue you are facing?

I open a url that contains a text input field containing text. I issue the gherkin command When I clear the inputfield "//textarea[@id='description']". Never clears the text.

Expected behavior

I expected the text in the input field to be cleared.

Actual behavior

Field sort of, I think, blinks but does not clear the text.

Issue occurred on browser/platform

Chrome Version 58.0.3029.96 (64-bit)/ MacBook Pro, OS X Yosemite, version 10.10.5

Block comments do not seem to work properly

Example:

Feature: Valuation slide user journey - pre-reqisite
    As a developer
    I want to open the url /valuation/

    Scenario: Background - load url valuation
        Given I open the url "/valuation/"
        Then I expect the url to contain "/valuation/"

"""
 anything here...

"""        

For the above I get an error -

  1. Background - load url valuation6 I expect the url to contain "/valuation/":
    [chrome #0-0] done is not a function

I think the problem is, that cucumber doesn't recognise that it has completed all it's scenarios. The done() method doesn't seem to exist.

TypeError: Cannot read property 'tests' of undefined

Issue description

Got a nodeJS exception when running test

Steps to reproduce

  1. Clone project
  2. npm install
  3. Run an external selenium
  4. Run web app
  5. Run test: ./node_modules/.bin/wdio --host localhost --port 4444

Expected behavior

This should work ^^

Actual behavior

/Volumes/Data/tom/www/cucumber-boilerplate/node_modules/webdriverio/build/lib/utils/ReporterStats.js:318
            this.getSuiteStats(runner, runner.parent).tests[runner.title] = new TestStats(runner);
                                                     ^

TypeError: Cannot read property 'tests' of undefined
    at ReporterStats.testStart (/Volumes/Data/tom/www/cucumber-boilerplate/node_modules/webdriverio/build/lib/utils/ReporterStats.js:318:54)
    at BaseReporter.<anonymous> (/Volumes/Data/tom/www/cucumber-boilerplate/node_modules/webdriverio/build/lib/utils/BaseReporter.js:151:25)
    at emitOne (events.js:96:13)
    at BaseReporter.emit (events.js:188:7)
    at BaseReporter.handleEvent (/Volumes/Data/tom/www/cucumber-boilerplate/node_modules/webdriverio/build/lib/utils/BaseReporter.js:300:27)
    at Launcher.messageHandler (/Volumes/Data/tom/www/cucumber-boilerplate/node_modules/webdriverio/build/lib/launcher.js:594:28)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at process.nextTick (internal/child_process.js:752:12)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)

Issue occurred on browser/platform

node v7.2.0

Making config data available to step helpers/snippets

At the moment, based on reading the code, the config object that is created in init.js is not available to steps or their helpers/snippets.

I have some complicated orchestration which requires access to the config data, and I am wondering which would be the recommended approach?

  1. Make the config object globally available
    or
  2. Require configure.js wherever it is required.

can't make 'cucumberOpts' work on webdriverIO runner

Hi,
our automation team are using "cucumber-boilerplate" and I have successfully run it as part of my CI in Jenkins. I'm trying to generate a json report to be read by Jenkins at the end of the run.
problem is it seems that the 'cucumberOpts' in conf.js file do not take any effect. is there another way to make them work?
or even better - another way to generate reports?
my conf.js file is this:

exports.config = {

    /**
     * language of your feature files
     * options: french, spanish, norwegian, polish, german, russian
     */
    language: 'english',

    /**
     * set selenium host and port
     */
    selenium: {
        host: '127.0.0.1',
        port: 5555
    },

    /**
     * webdriverio options
     *
     * - logLevel: stdout log level
     *   Options: *verbose* | *silent* | *command* | *data* | *result*
     *
     * - coloredLogs: Enables colors for log output
     *   default: true
     *
     * - singleton: Set to true if you always want to reuse the same remote
     *   default: false
     *
     * - waitforTimeout: Default timeout for all waitForXXX commands
     *   default: 500
     */
    options: {
        logLevel: 'verbose'
    },


    reporters: ['xunit'],
        cucumberOpts: {
            out:'../',
            failFast:true,
            require: [],        // <string[]> (file/dir) require files before executing features
            backtrace: false,   // <boolean> show full backtrace for errors
            compiler: [],       // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
            dryRun: false,      // <boolean> invoke formatters without executing steps
            failFast: false,    // <boolean> abort the run on first failure
            format: ['json:../result.json','pretty'], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
            colors: false,       // <boolean> disable colors in formatter output
            snippets: true,     // <boolean> hide step definition snippets for pending steps
            source: true,       // <boolean> hide source uris
            profile: [],        // <string[]> (name) specify the profile to use
            require: [],        // <string[]> (file/dir) require files before executing features
            strict: true,      // <boolean> fail if there are any undefined or pending steps
            tags: [],           // <string[]> (expression) only execute the features or scenarios with tags matching the expression
            timeout: 20000,      // <number> timeout for step definitions
            ignoreUndefinedDefinitions: false // <boolean> Enable this config to treat undefined definitions as warnings.
        },
    /**
     * desired capabilities
     */
    capabilities: {
        browserName: 'firefox'
    },

    /**
     * location of feature files
     */
    featureFiles: [
       'test/features/automation/Registration/Registration.feature'
    ],


    env: {
        baseUrl: '<our app site>'
    }


};

my indication for the 'cucumberOpts' is the "failFast:true" which doesnot take any effect, also no json is being generated.

Improve documentation around command support for desktop vs. mobile

this is my feature

Feature: Admin login
Scenario: Login successful
     When I set "lixun" to the inputfield "//android.widget.EditText[@resource-id="com.lilun.passionlife:id/et_username"]"
     And I set "lixun" to the inputfield "//android.widget.EditText[@resource-id="com.lilun.passionlife:id/et_pwd"]"
     And I click on the element "//android.widget.Button[@resource-id="com.lilun.passionlife:id/login"]"
     Then I expect that the title is "//android.widget.TextView[@resource-id="com.lilun.passionlife:id/home_title"]" 

there is some error

Admin login Login successful Then I expect that the title is "//android.widget.TextView[@resource-id="com.lilun.passionlife:id/home_title"]":
     Uncaught RuntimeError: Method has not yet been implemented
      at getTitle() - E:\cucumber\cucumber-boilerplate\test\support\check\checkTitle.js:7:10
      at touchClick("3") - E:\cucumber\cucumber-boilerplate\node_modules\webdriverio\lib\commands\click.js:30:33

i'm just a new beginner,i hope you can tell something for me, thanks very much

Scenario Outline not working

I started using your boiletplate recently and it's bee great so far.

I was trying to use a Scenario Outline to cut down on cucumber test file bulk. It was just passing the tests even when I set them to fail by using the wrong information in the table.

I thought cucumber had all this setup by default.

jest.json: "testPathDirs" is deprecated, ==> "roots"

First of all, thanks for this! it's one of the few things that "just worked" on initial download!

Issue description

Please provide a brief description of the problem you are experiencing

Ran npm test and got

  Option "testPathDirs" was replaced by "roots".

  Jest now treats your current configuration as:
  {
    "roots": ["test/"]
  }

  Please update your configuration.


  Configuration Documentation:
  https://facebook.github.io/jest/docs/configuration.html

Steps to reproduce

How can you reproduce the issue you are facing?

  1. Download the boilerplate
  2. npm install
  3. npm test

Expected behavior

What did you expect to happen?

I expected no warnings for deprecated config variables

Actual behavior

What did happen?

I got a warning for a deprecated config variable

Issue occurred on browser/platform

What platform did you experience this issue on? If you tested multiple browsers/platforms please add them, if you did not experience the issue on other tested browsers or platforms note it as well.

not in a browser. Mac OSX, zsh. looks like [email protected] was installed.

To keep scenarios smaller, we need a beforeAll scenarios solution

Issue description

I have a slideshow that has complicated functionality between each slide, but is all within the same url.
Slide 2 will not display until slide 1 has been clicked Next and so forth. If I were to use "Background" to open the url, then each slide I have reached with each scenario would then go back to the start which I don't want.
"Background" runs everytime a scenario is run.

I need a "beforeAll" method that only every runs once, and then all the scenarios are run, so that I can open a url in my "beforeAll" suite, and all my subsequent scenarios of this feature are within the same url.

Error: done() invoked with non-Error:

 Test feature to log into wordpress admin
    add value to an inputs element
      √ Given I open the site "/wp-admin/" (2456ms)
      √ And   I clear the inputfield "#user_login" (135ms)
      √ And   I clear the inputfield "#user_pass" (87ms)
      √ And   the inputfield "#user_login" does not contain any text (78ms)
      √ And   I add "value" to the inputfield "#user_login" (122ms)
      √ And   I add "value" to the inputfield "#user_pass" (146ms)
      √ When  I click on the button "#wp-submit" (2745ms)
      √ Then  I expect that element "#wpadminbar" is visible (83ms)
    1) "after all" hook


  8 passing (9s)
  1 failing

  1) Test feature to log into wordpress admin "after all" hook:
     Error: done() invoked with non-Error: {"state":"success","sessionId":"c6f88ee4-f886-4818-8a6d-259386535b8d","hCode":960784190,"value":null,"class":"org.openqa.selenium.remote.Response","status":0}

the code in hooks

var AfterHook = module.exports = function (done) {
    this.browser.end().then(done);
};

A few questions

Hi, it s not issue, just want to ask you.
Can i write smth like this if it was by jquery.

I expect that $('.my_class').text() == $('body').data('myparam')
And the second one is how to parse urls by class i mean i need check www.site.com?param=1000
If $('body').data('myparam') == ?param

Thanks.

An in-range update of wdio-selenium-standalone-service is breaking the build 🚨

Version 0.0.9 of wdio-selenium-standalone-service just got published.

Branch Build failing 🚨
Dependency wdio-selenium-standalone-service
Current Version 0.0.8
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

wdio-selenium-standalone-service is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 3 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Cannot run features using tags

I've added some tags to my feature files and but they seem to be ignored by the CLI

Steps: add a @tag to a feature file and then run it (wdio --tags=@auth) using the CLI

Expected: I expect that the feature file containing @tag to run

Actual: Browser opened, url did not load, it looked like @pending tags are running

Windows 10 / Chrome

Method checkoutContainsText is not contain but equal

Issue description

This method by name implies that an element contains text, but it is actually testing that it is equal to.

then.js

this.Then(
        /^I expect that (element|inputfield) "([^"]*)?"( not)* contains the text "([^"]*)?"$/,
        checkContainsText
    );

checkContainsText.js

    if (boolFalseCase) {
        expect(text).to.not.equal(stringExpectedText);
    } else {
        expect(text).to.equal(stringExpectedText);
    }

How to debug?

I have been experimenting with this boilerplate and find it as a very sane collection of tools and practice. I would like to be able to use node inspector and place breakpoints and debugger in my tests.

Is there a recommended way to achieve this?

Is it possible so that the browser closes after each test

I just want to say great work on this frame work, from a non coder here learning JS it's an amazing piece of work!

I just have 2 questions though..

  1. Is there anyway to ensure the browser quits after each test has complete?
  2. Also is there a way that the selenium standalone server could start up prior to a test commencing?

Thanks in advance!

Use "merge" instead of "deepmerge"

I would suggest to use "merge" rather than the "deepmerge" module when merging config.js and config.whatever.js in test/support/configure.js, since deepmerge combines arrays instead of replacing them.

This leads to an array consisting of 'test/features/**/*.feature' from the default file + 'test/features/whatever1.feature', 'test/features/whatever2.feature', 'test/features/whatever3.feature', ... that you add in the specific configuration file.

I guess this is never what you want.

Is there any drawback in not using the "deepmerge" module?

Installing cucumber-boilerplate as an NPM package?

I am afraid I am a javascript/NPM noob, but is there any reason why cucumber-boilerplate is not available as an NPM module? I have a client who is considering using cucumber-boilerplate and it would make management easier if we could install it via NPM.

If the reason is simply that it is just not a priority (as opposed to technical reasons) I am happy to do the legwork, if somebody can point me in the right direction in terms of getting started.

Add release tags

The README says

and checkout the tagged release you'd like to use

An in-range update of webdriverio is breaking the build 🚨

Version 4.7.1 of webdriverio just got published.

Branch Build failing 🚨
Dependency webdriverio
Current Version 4.7.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As webdriverio is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 4 commits .

  • a611b80 4.7.1
  • cf56b07 updated Changelog
  • 10adef3 don't fail lazyloading for isVisible and isExisting - closes #2003
  • 1ae50f1 Update index.js with current github url

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

is empty gives wrong result

contains any text and empty are sharing the same support function, checkContainsAnyText. In reality, they should be opposite.

this.Then(
        /^I expect that (element|inputfield) "([^"]*)?"( not)* contains any text$/,
        checkContainsAnyText
    );

    this.Then(
        /^I expect that (element|inputfield) "([^"]*)?" is( not)* empty$/,
        checkContainsAnyText
    );

Right now, is empty is given the wrong result.

Multi mode for features

Hi. Your project very like me.
But, i wish to run my features in multi mode(parallel).
I saw in README your have planned - "Easy to run tests in parallel (coming soon)" - it is very needed feature πŸ‘

I think it can be like it is code for example

@Multi
Feature: Some feature

or

@Multi
Scenario: Some scenario

Naming conflict in custom given / when steps

Issue description

When having the same name within a Given or When step the corresponding step no longer gets executed and the end result will be pending.

Steps to reproduce

Create a custom step with the same name for Given and When.

Within given.js:

this.Given(
    /^foobar$/,
    (done) => { done(); }
);

Within when.js:

this.When(
    /^foobar$/,
    (done) => { done(); }
);

Expected behavior

I expect the custom rule the get executed. Like:

[chrome #0-0]   My scenario
[chrome #0-0]       βœ“ I open the site "/"
[chrome #0-0]       βœ“ foobar
[chrome #0-0] 2 passing

Actual behavior

The custom rule returns pending and does not get executed. Like:

[chrome #0-0]   My scenario
[chrome #0-0]       βœ“ I open the site "/"
[chrome #0-0]       - foobar
[chrome #0-0] 1 passing
[chrome #0-0] 1 pending

Issue occurred on browser/platform

  • NodeJS v5.6.0
  • The latest master branch with the changes from #60
  • Chrome

Check for element existing on page is to slow

Currently the tests that contain the rule

there is no element "$string" on the page

all fail the default test because this rule takes longer than the timer set on the demo page:

wait for element
[22:52:08]:  COMMAND    POST     "/wd/hub/session/4daa3f64-b4c9-4f6c-874a-dc21d926544e/url"
[22:52:08]:  DATA        {"url":"http://webdriverjs.christian-bromann.com/"}
[22:52:08]:  RESULT      null
  βœ“ Given I open the site "/" (75ms)
[22:52:08]:  COMMAND    POST     "/wd/hub/session/4daa3f64-b4c9-4f6c-874a-dc21d926544e/elements"
[22:52:08]:  DATA        {"using":"css selector","value":".lateElem"}
[22:52:10]:  RESULT      [{"ELEMENT":"24"}]
  1) And   there is no element ".lateElem" on the page
  - When  I wait on element ".lateElem" for 5000ms
  - Then  I expect that element ".lateElem" is visible

I tested with a custom test page and the turnaround seems to be at 5000 ms ( so letting the element appear after 6000ms and then testing for existence @ 8000ms)

This makes me think that these tests should be altered to have an element added after a button click or something similar.

An in-range update of babel-jest is breaking the build 🚨

Version 20.0.1 of babel-jest just got published.

Branch Build failing 🚨
Dependency babel-jest
Current Version 20.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-jest is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Syntax error on running npm clean

Issue description

Unable to run npm clean with follow errors

mondwan@mondwan-All-Series:~/Documents/codeTest/cucumber-boilerplate$ npm run clean

> [email protected] clean /home/mondwan/Documents/codeTest/cucumber-boilerplate
> read -p "Are you sure you want to clean the project? [y/n] " -n 1 -r; if [[ $REPLY =~ ^[Yy]$ ]]; then sudo rm -R .git .github demo-app test .codeclimate.yml .travis.yml jest.json wdio.BUILD.conf.js src/features/**; fi

sh: 1: read: Illegal option -n
sh: 1: [[: not found

However, it works in this way

mondwan@mondwan-All-Series:~/Documents/codeTest/cucumber-boilerplate$ read -p "Are you sure you want to clean the project? [y/n] " -n 1 -r
Are you sure you want to clean the project? [y/n] ^C

Steps to reproduce

$> npm run clean

Expected behavior

No ERROR expected

Actual behavior

As stated above

Issue occurred on browser/platform

# Commit number
mondwan@mondwan-All-Series:~/Documents/codeTest/cucumber-boilerplate$ git log -1 --oneline
d243717 (HEAD -> master, origin/master, origin/HEAD) fix(package): update wdio-cucumber-framework to version 0.3.0

# npm version
mondwan@mondwan-All-Series:~/Documents/codeTest/cucumber-boilerplate$ npm --version
4.6.1

# OS version
mondwan@mondwan-All-Series:~/Documents/codeTest/cucumber-boilerplate$ lsb_release -a
LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

# node version
mondwan@mondwan-All-Series:~/Documents/codeTest/cucumber-boilerplate$ node --version
v6.10.1

How to run a test in isolation?

Is there any way to run a test in isolation while developing? I see "Pending" but not "Isolate".
If is not a feature yet, is there a better way then looping on the file looking for the isolation tag and run if found, otherwise run all?

How to end session and start again in scenario?

I have some problem, I have ane Feature with all login actions.
First Scenario checks correct login, second incorrect, but problem, if first scenario pass, i still loggined. How to clear session?

unable to run test

Hi all!
I am trying to run test from my os,
I added all dep but still non of test arent working,
the errors:

/usr/local/bin/node run.js
child_process: customFds option is deprecated, use stdio instead.

Github test
1) "before all" hook

Pending scenario
do somethimg
- Given I open the site "/"

Sample Snippets test
open URL
2) Given the page url is not "http://webdriverjs.christian-bromann.com/"
- And I open the url "http://webdriverjs.christian-bromann.com/"
- Then I expect that the url is "http://webdriverjs.christian-bromann.com/"
- And I expect that the url is not "http://google.com"

Add tag configuration

Hi.
Does this solution allows adding a "tags" configuration parameter so that we can specify the test to run? (e.g run only the test with the @example annotation).

I'm trying to find it but so far no luck...

npm run clean requires sudo

Running npm run clean requires sudo which is completely unnecessary. It is better to change the command to:

read -p \"Are you sure you want to clean the project? [y/n] \" -n 1 -r; if [[ $REPLY =~ ^[Yy]$ ]]; then rm -Rf .git .github demo-app test .codeclimate.yml .travis.yml jest.json wdio.BUILD.conf.js src/features/**; fi

Can not test web site write with react.

Hi,

I change the browserName in this boilerplate from 'chrome' to 'phantomjs' to test a web site written in React which means html page rendered with js.

It ends with element not found.(goto the page and assert title of the page is working, but not the element in render with react)

It works when I change browserName back to chrome.

Is there any solution for testing js rendered web site with phantomjs?

Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.

Hello,

There is an error in fresh setup:


 COMMAND    POST     "/wd/hub/session"
[14:14:32]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.0.9","name":"webdriverio"}}}
[14:14:33]  INFO    SET SESSION ID a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e
[14:14:33]  RESULT      {"applicationCacheEnabled":false,"rotatable":false,"mobileEmulationEnabled":false,"chrome":{"chromedriverVersion":"2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a)","userDataDir":"/tmp/.com.google.Chrome.A8VkqP"},"takesHeapSnapshot":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"version":"50.0.2661.86","platform":"LINUX","browserConnectionEnabled":false,"nativeEvents":true,"acceptSslCerts":true,"webdriver.remote.sessionid":"a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e","locationContextEnabled":true,"webStorageEnabled":true,"browserName":"chrome","takesScreenshot":true,"javascriptEnabled":true,"cssSelectorsEnabled":true}
    check default root page title
[14:14:33]  COMMAND POST     "/wd/hub/session/a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e/url"
[14:14:33]  DATA        {"url":"http://192.168.64.1:4000/"}
[14:14:33]  RESULT      null
      βœ“ Given I open the site "/" (404ms)
[14:14:33]  COMMAND GET      "/wd/hub/session/a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e/title"
[14:14:33]  DATA        {}
[14:14:33]  RESULT      "Hello Ave88!"
      βœ“ Then I expect that the title is "Hello Ave88!" (72ms)
[14:14:33]  COMMAND DELETE   "/wd/hub/session/a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e"
[14:14:33]  DATA        {}
[14:14:33]  RESULT      null
    1) "after all" hook for "Then I expect that the title is "Hello Ave88!""


  2 passing (12s)
  1 failing

  1) Test the page title "after all" hook for "Then I expect that the title is "Hello Ave88!"":
     Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.

Selenium log:

selenium_1       | 00:14:18.326 INFO - Executing: [new session: Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@4d773871, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.0.9, url=http://webdriver.io}}]])
selenium_1       | 00:14:18.336 INFO - Creating a new session for Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@4d773871, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.0.9, url=http://webdriver.io}}]
selenium_1       | Starting ChromeDriver 2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a) on port 9985
selenium_1       | Only local connections are allowed.
selenium_1       | 00:14:19.376 INFO - Done: [new session: Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@4d773871, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.0.9, url=http://webdriver.io}}]]
selenium_1       | 00:14:19.426 INFO - Executing: [get: http://192.168.64.1:4000/])
selenium_1       | 00:14:19.786 INFO - Done: [get: http://192.168.64.1:4000/]
selenium_1       | 00:14:19.826 INFO - Executing: [get title])
selenium_1       | 00:14:19.866 INFO - Done: [get title]
selenium_1       | 00:14:19.886 INFO - Executing: [delete session: a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e])
selenium_1       | 00:14:19.956 INFO - Done: [delete session: a5e84d1c-cc3e-44fc-8275-8dad3bc2a67e]

Running using tag causes opening empty tabs

Issue description

I have few features and glob in specs option like: specs: [ './src/features/**/*.feature' ]
When I try to run tests through wdio cli with tags parameter I see that cli executes for each feature, but for features without specified tag it just open browser and close it immediately.

Issue occurred on browser/platform

"wdio-cucumber-framework": "^0.2.15",
"webdriverio": "^4.6.2"

npm run-script local-webserver Unhandled 'error' event

Issue description

Please provide a brief description of the problem you are experiencing

Steps to reproduce

How can you reproduce the issue you are facing?
npm run-script local-webserver

Expected behavior

What did you expect to happen?
it would start a webserver

Actual behavior

What did happen?
threw an error

Issue occurred on browser/platform

mac osx
node v7.2.1
npm 3.10.10

What platform did you experience this issue on? If you tested multiple browsers/platforms please add them, if you did not experience the issue on other tested browsers or platforms note it as well.

events.js:160
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 0.0.0.0:8080
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1262:14)
at listen (net.js:1298:10)
at doListening (net.js:1397:7)
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run-script" "local-webserver"
npm ERR! node v7.2.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] local-webserver: http-server ./demo-app -s
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] local-webserver script 'http-server ./demo-app -s'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cucumber-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server ./demo-app -s
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs cucumber-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls cucumber-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/andrewjones/Documents/codePen/did/darkdiner/integrationTests/cucumber-boilerplate/npm-debug.log

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.