youvegotnigel / the-dog-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

THE DOG API PROJECT AUTOMATION

This project is created to show how we can leverage Cucumber BDD framework in Cypress. Steps involved in configuring your project are following:

Pre-Requisites

Set Up

  • Clone repository
  • Run npm i to install all dependencies.

Cypress Help

npx cypress run --help

Dependencies

  • cypress - v10.10
  • multiple-cucumber-html-reporter - v1.21.4
  • cucumber-json-report-formatter - v0.0.9
  • cypress-xpath - v2.0.1
  • moment - v2.29.4
  • moment-timezone - v0.5.37
  • @badeball/cypress-cucumber-preprocessor - v12.1.0
  • @bahmutov/cypress-esbuild-preprocessor - v2.1.3
  • @shelex/cypress-allure-plugin - v2.29.0

Configure VS Code

Use ctrl + shift + p and search for Preferences: Open Settings (JSON) and open VS Codes settings. Add the following in settings.json

 "[feature]":{
        "editor.formatOnSave": true,
    },
    "cucumberautocomplete.strictGherkinCompletion": true,
    "cucumberautocomplete.steps": [
        "cypress/integration/**/*.js",
        "cypress/e2e/**/*.js",
    ]

Features

  • BDD Framework
  • Page Object Model
  • Cucumber HTML Report
  • Allure Report

Documentation

How to Run and Generate Report

GUI Mode

npx cypress open
or
npx cypress open --config-file config/qa.config.js

CLI Mode

Run All Features and Generate Allure Report

npm run allure:clear
npm run cy:run
npm run allure:report

Run Specific Feature

npx cypress run --browser "chrome" --config-file config/qa.config.js
or
npx cypress run --browser "chrome" --spec "cypress/e2e/features/breadList.feature"
or
npx cypress run --browser "chrome" --spec 'cypress/e2e/features/breadList.feature' --config-file config/qa.config.js
and
npm run allure:report

Run Specific Feature with Percy Visual Testing

npm run allure:clear
npx cypress run --browser "chrome" --spec 'cypress/e2e/features/breadList.feature' --config-file config/qa.config.js
npm run cy:report
npm run allure:report

Install Allure

Open Windows PowerShell and Enter following commands
  1. Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
  2. irm get.scoop.sh | iex
  3. scoop install allure

Using Cypress-cucumber-preprocessor with cucumber tags:

@testID("id_of_test_for_testops")
@parentSuite("someParentSuite")
@suite("someSuite")
@subSuite("someSubSuite")
@epic("thisisepic")
@feature("nice")
@story("cool")
@owner("IAMOwner")
@issue("jira","JIRA-1234")
@tms("tms","TC-1234")
@link("other","url")
@someOtherTagsWillBeAddedAlso
@severity("blocker")
@severity("critical")
@severity("minor")
@severity("trivial")
Scenario: Here is scenario
...

Author

  • Nigel Mulholland - Email
  • If you're a non-reader watch

Happy Automation 😊 ✨

About

License:MIT License


Languages

Language:JavaScript 87.5%Language:Gherkin 12.5%