Cypress.IO Project using Javascript and Cucumber to start automating E2E tests just cloning it and installing dependencies.

  • By Joan Esquivel
  • Last update: Dec 25, 2022
  • Comments: 5

cypress-cucumber-boilerplate-for-e2e-testing

exemplo imagem

Cypress 10+ with Cucumber boilerplate project.

💻 Topics

Integrated with:

(+ bundlers: https://github.com/badeball/cypress-cucumber-preprocessor/tree/master/examples)

  • 💻 Pre-requisites

Before you use this project you only need to have Node Js installed in your computer.

https://nodejs.org/es/download/

Also, download and install the JSON fomatter depending on your OS

https://github.com/cucumber/json-formatter

🚀 Install the project

Install project dependencies with: npm i

🚀 Run the demo:

Open the terminal and run: npm run cypress:execution

Github

https://github.com/JoanEsquivel/cypress-cucumber-boilerplate

Comments(5)

  • 1

    Getting spawn error

    npm run cypress:execution Getting error Error: spawn Unknown system error -86 at ChildProcess.spawn (node:internal/child_process:413:11) at Object.spawn (node:child_process:743:9) at afterRunHandler (/Users/jlair3/cypress-cucumber-api/node_modules/@badeball/cypress-cucumber-preprocessor/lib/add-cucumber-preprocessor-plugin.js:88:55) I am using node 18. I didn't make any change yet but straight npm i and then npm run cypress:execution

  • 2

    Run example with multiple tags

    Hello @JoanEsquivel !

    Thank you for providing this nice boilerplate! Is there any option to run by using the same command multiple tags? (let's say @mobile and @desktop)

    I've had a look over the package.json but couldn't find any example, but only with one tag: "cypress:execution-tags": "cypress run --env [email protected]",

    Thanks

  • 3

    Error after mp4 created

    I installed all prerequisites. Verified the standalone formatter was working properly. I get this error after the run:

    (Video)

    • Started processing: Compressing to 32 CRF
    • Finished processing: /Users/chunter/source/Cypress10Cuke/cypress-cucumber-boiler (0 seconds) plate/cypress/videos/login.feature.mp4

    An error was thrown in your plugins file while executing the handler for the after:run event.

    The error we received was:

    Error: spawn cucumber-json-formatter.exe ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19) at onErrorNT (internal/child_process.js:467:16) at processTicksAndRejections (internal/process/task_queues.js:82:21) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] cypress:execution: cypress run npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] cypress:execution script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in: npm ERR! /Users/chunter/.npm/_logs/2022-09-10T00_04_57_720Z-debug.log

  • 4

    Repo changes

    Changes

    • and in step definitions has been deprecated. Check the issue at: https://github.com/badeball/cypress-cucumber-preprocessor/issues/821
    • Turned off html reports to run them in GH Actions
    • Turning on github actions to check everything works correctly.
  • 5

    Yaml / read data in our tests

    Hi, JoanEsquivel , how to read yaml data in cypress cucumber framework, I need to read value of yml by node and key in my tests please help me to find solution it will be very much help full @JoanEsquivel ☺