You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/packages/integration-tests/features/assetlibraryhistory/deviceHistory.feature
+68-44Lines changed: 68 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,18 @@ Feature: Device History
23
23
# We store the time the test started so that we can filter out history records that may have been saved for this device prior to the test:
24
24
And I store the time the test started
25
25
When I create device "TEST-deviceHistory-device001" with attributes
26
-
| templateId | TEST-deviceHistory-device-type |
27
-
| description | Description1 |
28
-
| attributes | {"firmwareVersion":"1"} |
29
-
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
30
-
And pause for 2000ms
26
+
| templateId | TEST-deviceHistory-device-type |
27
+
| description | Description1 |
28
+
| attributes | {"firmwareVersion":"1"} |
29
+
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
30
+
# Allow Kinesis batch window to complete
31
+
And pause for 32seconds
31
32
Then 1 history records exist since the test started for device "TEST-deviceHistory-device001"
32
33
And history record 1 contains attributes
33
-
| objectId | test-devicehistory-device001 |
34
-
| event | create |
35
-
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
When I update device "TEST-deviceHistory-device001" with attributes
44
45
| attributes | {"firmwareVersion":"2"} |
45
-
And pause for 2000ms
46
+
And pause for 32seconds
46
47
Then 1 history records exist since the test started for device "TEST-deviceHistory-device001"
47
48
And history record 1 contains attributes
48
-
| objectId | test-devicehistory-device001 |
49
-
| event | modify |
50
-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
51
-
| type | devices |
49
+
| objectId | test-devicehistory-device001 |
50
+
| event | modify |
51
+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
52
+
| type | devices |
53
+
54
+
55
+
Scenario: Multiple events are in a single batch are captured
56
+
Given device "TEST-deviceHistory-device002" does not exist
57
+
And device "TEST-deviceHistory-device003" does not exist
58
+
And I store the time the test started
59
+
When I create device "TEST-deviceHistory-device002" with attributes
60
+
| templateId | TEST-deviceHistory-device-type |
61
+
| description | Description1 |
62
+
| attributes | {"firmwareVersion":"1"} |
63
+
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
64
+
And I create device "TEST-deviceHistory-device003" with attributes
65
+
| templateId | TEST-deviceHistory-device-type |
66
+
| description | Description1 |
67
+
| attributes | {"firmwareVersion":"1"} |
68
+
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
69
+
And I update device "TEST-deviceHistory-device002" with attributes
70
+
| attributes | {"firmwareVersion":"2"} |
71
+
And I update device "TEST-deviceHistory-device003" with attributes
72
+
| attributes | {"firmwareVersion":"2"} |
73
+
And pause for 32seconds
74
+
Then 2 history records exist since the test started for device "TEST-deviceHistory-device002"
75
+
And 2 history records exist since the test started for device "TEST-deviceHistory-device003"
52
76
53
77
54
78
Scenario: Deleting a device logs a delete event
55
79
Given device "TEST-deviceHistory-device001" exists
56
80
# We store the time the test started so that we can filter out history records that may have been saved for this device prior to the test:
57
81
And I store the time the test started
58
82
When I delete device "TEST-deviceHistory-device001"
59
-
And pause for 500ms
83
+
And pause for 31seconds
60
84
Then 1 history records exist since the test started for device "TEST-deviceHistory-device001"
61
85
And history record 1 contains attributes
62
-
| objectId | test-devicehistory-device001 |
63
-
| event | delete |
64
-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
Scenario: Retrieve all events relating to this test
69
93
When I retrieve 3 history records for device "TEST-deviceHistory-device001"
70
94
Then history record 1 contains attributes
71
-
| objectId | test-devicehistory-device001 |
72
-
| event | delete |
73
-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
Scenario: Paginate all events relating to this test
88
112
When I retrieve 3 history records for device "TEST-deviceHistory-device001"
89
113
Then history record 1 contains attributes
90
-
| objectId | test-devicehistory-device001 |
91
-
| event | delete |
92
-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
0 commit comments