Cucumber is a tool that can execute
plain-text functional descriptions. And also it’s
BDD(Behaviour Driven Development)
automated tests. It is written by
Ruby, and now it supports more than 40 languages, such as
Firstly, we need to install
RubyGems, to check whether the installation of Ruby and RubyGems is successful. You can inputx the commands to terminal, just like as below:
1 2 3 4
And then we can run the command below to install
After this, put below command to see how to use it.
Gherkin is a language that can be understand by
Cucumber. It’s a
Domain Specific Language. Very easy to understand what the functional want to do.
Gherkin has two purpose, documention and automated test. The structure is Treetop grammer than is part of Cucumber codebase and use indentation to format it.
Gherkin has two conventions:
Gherkin source file contains a description of single feature.
+ The source file is feature extention file(
YAML(Yet Another Markup Language), Gherkin is a line-oriented language that uses indentation to define structure. Most lines start with keyword. And you can start with a hash sign(#) to comment the text.
A Gherkin source file usually looks like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Above the codes, It’s very similar with
Then all are keywords of