* Step Name
Our core elements
* Check "product" exists
Steps arguments
"Static Arg"
* Step that takes a table
| id | name |
|-----|---------|
| 123 | John |
| 456 | Mcclain |
|Table Parameter|
<prefix:value>
* Check if <file:/work/content.txt> is visible
file
Used as:
* Check if the users exist <table:/Users/john/work/users.csv>
table
Scenario name
-------------
## Scenario name
Or
# Specification name
Specification name
==================
Or
Im a comment!!!
Comment has no syntax. Any normal line of text is treated as a comment.
Specification Level
===================
Tags: mvp, mission critical
Scenario Level
--------------
Tags: mission critical, fast
Enable cross-scenario or cross-specification grouping
Logging In
=====================
This describes what is required from a **logging in** action.
* Goto page "/login".
Successful login is refered to home
---------------------------
tags: mvp
* Insert into field "user" the value "boaz".
* Insert into field "passowrd" the value "******".
* Press button "Let me in."
* Validate page is "/home".
Wrong credentials result in an alert
-----------------------------
* Insert into field "user" the value "not-boaz".
* Insert into field "passowrd" the value "!******".
* Press button "Let me in."
* Validate alert is shown with the text: "Wrong credentials".
Also applicable:
Go
Python
Ruby
C#
Javascript
public class StepGodClass {
@Step("Goto page <page>.")
public void gotoPage(String page) {
// ... Yada Yada Yada ...
}
@Step("Insert into field <field> the value <value>.")
public void insertToField(String field, String value) {
// ... Yada Yada Yada ...
}
// ... Yada Yada Yada ...
@Step("Validate page is <page>.")
public void validatePage(String page) {
// ... Yada Yada Yada ...
}
@Step("Validate alert is shown with the text: <alertTitle>.")
public void validateAlert(String alertTitle) {
// ... Yada Yada Yada ...
}
}
Thanks!