Skip to content

Commit 97179d8

Browse files
committed
2 parents 7dcbfb0 + deb8c13 commit 97179d8

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ You can use the specified properties using the following sintax.
176176

177177
```Gherkin
178178
@user1
179-
Scenario: As a kjkhdkjds
179+
Scenario: As a user
180180
Given I wait
181181
Then I see the text "<PASSWORD>"
182182
```
@@ -187,6 +187,40 @@ Scenario: As a kjkhdkjds
187187
kraken-mobile run <apk> --properties=<kraken_mobile_properties_path>
188188
```
189189

190+
# Use fake strings in tests
191+
192+
Kraken offers a Fake string generator thanks to the Ruby gem [Faker](https://github.com/faker-ruby/faker), the list of supported faker types are listed as follows:
193+
194+
* Name
195+
* Number
196+
* Email
197+
* String
198+
* String Date
199+
200+
### Use a faker in a test
201+
202+
Kraken keeps a record of every Fake string generated, thats why each string will have an id associated. To generate a Faker string you need to follow the structure "$FAKERNAME_ID".
203+
204+
```Gherkin
205+
@user1
206+
Scenario: As a user
207+
Given I wait
208+
Then I enter text "$name_1" into field with id "view"
209+
```
210+
211+
### Reusing a fake string
212+
213+
As mentioned before, Kraken keeps record of every string generated with an id given to each string, this gives you the possibility of reusing this string later in your scenario. To reuse a string you can you need to append a $ character to the fake string as follows:
214+
215+
```Gherkin
216+
@user1
217+
Scenario: As a user
218+
Given I wait
219+
Then I enter text "$name_1" into field with id "view"
220+
Then I press "add_button"
221+
Then I should see "$$name_1"
222+
```
223+
190224
# Examples
191225

192226
| Application | Video | Feature File | Properties file | Settings File | Report Link |

0 commit comments

Comments
 (0)