@@ -9,7 +9,7 @@ Feature: User login
9
9
# Background steps run before each scenario
10
10
Given the login page is open
11
11
12
- # Scenario within the rule
12
+ # Scenario within the rule
13
13
Scenario : Successful login with valid credentials
14
14
Given the user enters a valid username
15
15
And the user enters a valid password
@@ -22,7 +22,7 @@ Feature: User login
22
22
When the user clicks the login button
23
23
Then the user should see an error message "<error_message>"
24
24
25
- # Examples table provides data for the scenario outline
25
+ # Examples table provides data for the scenario outline
26
26
Examples :
27
27
| username | password | error_message |
28
28
| invalidUser | wrongPass | Invalid username or password |
@@ -83,15 +83,32 @@ Feature: User login
83
83
Please check your username and password and try again.
84
84
If the problem persists, contact support.
85
85
"""
86
+ # Tags can also be used on exemples
87
+ @scenario_tag
88
+ Scenario Outline : Test tags on Examples
89
+ Given the user enters "<username>" as username
90
+ And the user enters "<password>" as password
91
+ When the user clicks the login button
92
+ Then the user should see an error message "<error_message>"
93
+
94
+ @example_tag_1
95
+ Examples :
96
+ | username | password | error_message |
97
+ | invalidUser | wrongPass | Invalid username or password |
98
+
99
+ @example_tag_2
100
+ Examples :
101
+ | username | password | error_message |
102
+ | user123 | incorrect | Invalid username or password |
86
103
87
104
@some-tag
88
105
Rule: a sale cannot happen if there is no stock
89
- # Unhappy path
90
- Example: No chocolates left
91
- Given the customer has 100 cents
92
- And there are no chocolate bars in stock
93
- When the customer tries to buy a 1 cent chocolate bar
94
- Then the sale should not happen
106
+ # Unhappy path
107
+ Example: No chocolates left
108
+ Given the customer has 100 cents
109
+ And there are no chocolate bars in stock
110
+ When the customer tries to buy a 1 cent chocolate bar
111
+ Then the sale should not happen
95
112
96
113
Rule: A sale cannot happen if the customer does not have enough money
97
114
# Unhappy path
0 commit comments