Giter Site home page Giter Site logo

cypress-cucumber's Introduction

Cypress-cucumber

Description

Cypress is a next generation front end testing tool built for the modern web with software tool that supports behavior-driven development cucumber.

Setup

Before using cypress with cucumber, you need to install node.js, install all the dependencies for doing the full operation of the node.js.

Download git repository

git clone https://github.com/Diankavoy19/Cypress-cucumber

and use install node modules.

Dependencies:

You need to add following to package.json

{
  "dependencies": {
    "@badeball/cypress-cucumber-preprocessor": "latest"
  },
  "cypress-cucumber-preprocessor": {
    "json": {
      "enabled": true,
      "output": "jsonlogs/log.json",
      "formater": "cucumber-json-formatter.exe"
    },
    "messages": {
      "enabled": true,
      "output": "jsonlogs/messages.ndjson"
    }
  }

and configure cypress.config.js

const { defineConfig } = require("cypress");
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");

async function setupNodeEvents(on, config) {
  await preprocessor.addCucumberPreprocessorPlugin(on, config);

  on("file:preprocessor", browserify.default(config));

  // Make sure to return the config object as it might have been modified by the plugin.
  return config;
}

module.exports = defineConfig({
  e2e: {
    specPattern: "**/*.feature",
    supportFile: false,
    setupNodeEvents,
  },
});

Also you need to download cucumber-json-formatter according to your OS and rename this file to

cucumber-json-formatter.exe

After that we can run all our tests.

npm run cypress:open 

or

npx cypress:run

or with config file for macbook-15

npm run cypress:config

Also we can generate reports

npm run cypress:report

You must have these result:

cypress-cucumber's People

Contributors

diankavoy19 avatar

Stargazers

Dmytro Smaha avatar

Watchers

 avatar

Forkers

azanir

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.