/base-cypress-cucumber-javascript

BDD base project: Cypress + Cucumber + Javascript

Primary LanguageJavaScriptMIT LicenseMIT

code style: prettier

BDD base project: Cypress + Cucumber + Javascript

Basic example of using Cypress with Cucumber (BDD). This Gherkin example includes:

  • Basic Scenario
  • Scenario Outline
  • Tagged tests

Table of contents

Get started

Installation

npm install

How to run the tests

Running tests

npm test

output: an output is generated for each .feature file found.

    Spec                                              Tests  Passing  Failing  Pending  Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔  Duckduckgo.feature                      00:10        3        3        -        -        -  │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
  ✔  All specs passed!                       00:10        3        3        -        -        -

Output

Running tagged tests

Running tagged smoke tests

# defined in package.json file
npm run tag:smoke

Running using customized tags

npx cypress run --env tags='@smoke and @duckduckgo'

more details: tags

Running tests manually

Open Cypress and run the tests manually:

npm run cypress:open

Static code analysis tools

ESLint

Find Problems

ESLint statically analyzes the code to find problems.

npm run lint

Fix Automatically

Many problems ESLint finds can be automatically fixed.

npm run lint:fix

License

MIT