/base-cypress-cucumber-typescript

BDD base project: Cypress + Cucumber + Typescript

Primary LanguageTypeScriptMIT LicenseMIT

code style: prettier

BDD base project: Cypress + Cucumber + Typescript

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
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔  web/Duckduckgo.feature                  00:10        3        3        -        -        -  │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
  ✔  All specs passed!                       00:10        3        3        -        -        -

HTML report:

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

How to run the tools

Run ESLint and TypeScript Compiler (without compilation)

npm run lint

ESLint

Find Problems

ESLint statically analyzes the code to find problems.

npm run lint:eslint

Fix Automatically

Many problems ESLint finds can be automatically fixed.

npm run lint:eslint:fix

TypeScript Compiler

Checking code without compilation

Check the types and validate the code using TypeScript without compilation.

npm run lint:tsc

License

MIT