Giter Club home page Giter Club logo

bdd-test-gherkin-js-cucumber-selenium's Introduction

Test BDD (Behavior Driven Development)

What are BDD tests and Gherkin language?

BDD, or Behavior-Driven Development, is a software development methodology that focuses on understanding the behavior of a system before writing code. The goal is to build software that meets the requirements of stakeholders and can be easily tested.

Gherkin is a plain-text language used to write BDD tests. It's designed to be simple and easy to understand for everyone involved in the development process, including non-technical stakeholders. Gherkin tests are written in a structured format, following the keywords "Given", "When", and "Then".

For example, a Gherkin test might look like this:

Given the user is on the login page

When the user enters their credentials

Then the user should be directed to the home page.

By using Gherkin and BDD, teams can ensure that they are building software that meets the needs of stakeholders and can be easily tested. The structured format of Gherkin tests makes it easy to create, modify, and maintain tests, even as requirements change.

What is cumcumber.js?

Cucumber.js is a JavaScript implementation of the Cucumber testing framework. It provides a way to write tests in a way that is easily understandable by both technical and non-technical people.
Cucumber.js works by matching the test scenarios written in Gherkin with JavaScript code that implements those scenarios.
This allows for the tests to be easily maintainable and understandable by the entire team, including stakeholders and business representatives. Additionally, cucumber.js integrates well with other testing tools, making it a popular choice for Behavior Driven Development (BDD) in JavaScript projects.

What the project does ?

This project is a simple test that allows you to validate the login functionality of the website ShareAspace.

Installation and test execution

Installation

  1. Install Node.js and npm if you haven't already. You can download them from https://nodejs.org/en/. You can check if you have them installed by running the following commands in your terminal:

node -v

  1. Make sure you have installed git on your machine. You can download it from https://git-scm.com/downloads.

  2. Put yourself in the folder where you want to clone the project and run the following command with your terminal or download the zip file to your local machine :

    (Make sure you install the project on your machine and not on the cloud)

git clone https://github.com/kevinrss01/BDD-test-gherkin-JS-cucumber-selenium

  1. Open the project in VS Code or your preferred code editor.
    Open the VS code terminal and if you haven't installed cucumber.js yet, run the following command:

npm install -g cucumber

  1. Run the following command to install the necessary dependencies:

npm install

  1. Once all dependencies have been installed, you can run the test and see the results in the terminal. Run the following command

npm run test, you have to enter your email and password in the console to run the test and test the login functionality.

  1. If you want to see the result of the last test in the HTML report, run the following command (You must execute npm run test first):

npm run report

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.