-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentities_basic.feature
57 lines (48 loc) · 2.89 KB
/
entities_basic.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@demo
Feature: Entities and assertions examples
This feature shows entity retrieval, validation and manipulation scenarios.
The entities are based on the MetaWeather API (https://www.metaweather.com/api/) and the JSON placeholder API (https://jsonplaceholder.typicode.com/)
Scenario: Basic entity retrieval
Given I work with a location list with fields: name = lond
Then This location list has fields: length = 1
Scenario: Validating list items
Given I work with a location list with fields: name = lond
Then This location list contains an item with fields: title = London
And This location list doesn't contain an item with fields: title = Other city
Scenario: Using entities as references for other entities
Given I work with a location list with fields: name = lond
And From this location list, I work with a location with: title = London
Then This location exists
And from this location, I work with a forecast
Then this forecast exists
Scenario: Checking item order
Given I work with the entire json user list
And from this json user list, I work with the json user with fields: email=${/melissa.tv/}
Then This json user exists
And This json user has fields: #=2
Scenario: Using object properties as separate entities
Given I work with a location list with fields: name = lond
And From this location list, I work with a location with: title = London
And from this location, I work with a forecast
And I work with the .consolidated_weather.0 property from this forecast
Then This property has fields: humidity = ${/\d+/}
Given I work with the entire json user list
And from this json user list, I work with the json user with fields: email=${/melissa.tv/}
And I work with the .company property of this json user
Then This property has fields: name = Deckow-Crist
Scenario: Working with entity ordinals
Given I work with the json user list with fields: username = Antonette
And I work with the json user list with fields: username = Leopoldo_Corkery
Then json user list #1 contains an item with fields: id = 2
And json user list #2 contains an item with fields: id = 6
And json user list #1 has fields: length = ${entities_json_user_list_2.length}
Scenario: Working with entity variables
Given I work with the entire json user list
And from this json user list, I work with the json user with fields: email=${/melissa.tv/}
Then The variable ${this_json_user.name} equals Ervin Howell
Scenario: Mixing systems
Given I work with the entire json user list
And from this json user list, I work with the json user with fields: email=${/melissa.tv/}
And I work with the .address.geo property of this json user
Given I work with a location list with fields: location = ${[${this_property.lat}\, ${this_property.lng}]}
Then This location list contains an item with fields: title = Johannesburg