Coder Social home page Coder Social logo

cucumber_examples's Introduction

Cucumber Examples

Cucumber is a tool that is useful for those who practice Behavior Driven Development.

The behavior is specified as a set of features, which are implemented as step definitions. The step definitions then exercise and inspect the system under test.

Cucumber Overview

This repository is useful for someone looking to learn a bit of cucumber by example:

  • The ruby directory has an example that is the result of following the 10 minute tutorial on the Cucumber site, with the production code and test code put into separate files.
  • The java directory is a similar example, but with step definitions written in Java and features executed with Maven.
  • The google example shows how you can use WebDriver and its API to do a very simple test against a Google search.
  • The sinatra example demonstrates a minimal ruby web app being exercised with the Rack::Test driver and Capybara gem.
  • The dadjoke example is a more complete sinatra example that includes several features. It also shows how the VCR gem can be used to isolate running the test from the icanhazdadjoke API used for content.
  • The full example is an extension of dadjoke.

Setup

In order to get these examples working, you may need to install some things onto your local machine.

The java example presumes you have Java Standard Edition as well as the Maven build tool. Within the hellocucumber directory of the java sample, running mvnw test from the command line will execute the cucumber features.

The other examples use Ruby and Bundler as a foundation. Inside each directory, you'll first want to run bundle install to ensure any ruby gems are installed. From there rake features will run the execute the acceptance tests.

Finally, a few of the examples make use of Selenium WebDriver for automating your browser. In the full example, the automation exercises Chrome via ChromeDriver. In the google example, Safari is used via the Apple provided version of SafariDriver. Depending on your local environment, you may want or need to change the driver instance used.

cucumber_examples's People

Contributors

dependabot[bot] avatar mdoel avatar

Watchers

 avatar  avatar

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.