Automated test cucumber

Source: Internet
Author: User

Cucumber is an automated testing tool that can understand test cases described in common languages and support behavior-driven development (BDD). It is written in Ruby and supports multiple development languages such as Java and. net.

 

Cucumber:

  1. Features
  2. Step_definitions
  3. Cucumber command

Feature is described in a simple natural language. A feature consists of the following parts:

  • One title
  • A description statement in any format
  • Any number of scenarios
  • Each scenario can contain any number of steps.
  • The step definition must start with the keyword given, when, then, and
  • The feature file must be suffixed with. feature.

Step_definitions writes the corresponding test code based on the step defined in the feature file. The programming language used can be consistent with the tested application programming language.

Cucumber command. When you run the cucumber command, cucumber analyzes the step defined in the feature file and then goes to step_definitions to find the matching step. if it finds the matching step, it executes the code in the step. Run the command and enter the cucumber project directory \ Features \ file name. feature in the command line.

 

Cucumber development process (from http://cukes.info /):

1: Describe behaviour in plain text2: Write a step definition in ruby3: run and watch it fail4. write code to make the step pass5. run again and see the step pass6. Repeat 2-5 until green like a cuke7. repeat 1-6 until the money runs out

Automated test cucumber

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.