-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_flow_tw.hurl
executable file
·170 lines (150 loc) · 4.46 KB
/
post_flow_tw.hurl
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# /post POST -------------
POST {{BASE_URL}}/post
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
{
"randomPost": true,
"platforms": [
"twitter"
],
"randomMediaUrl": true
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.errors" count == 0
jsonpath "$.postIds[0].status" == "success"
jsonpath "$.postIds[0].id" exists
jsonpath "$.postIds[0].postUrl" exists
jsonpath "$.postIds[0].platform" == "twitter"
jsonpath "$.id" exists
jsonpath "$.refId" exists
jsonpath "$.post" exists
[Captures]
id: jsonpath "$['id']"
tw_id: jsonpath "$.postIds[0].id"
# -----------------------
# /comments POST
POST {{BASE_URL}}/comments
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
[Options]
delay: 15000
{
"id": "{{id}}",
"platforms": ["twitter"],
"randomComment": true
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.id" == "{{id}}"
jsonpath "$.twitter" exists
jsonpath "$.twitter.status" == "success"
# jsonpath "$.twitter.comment" == "hurl"
[Captures]
tw_comment_id: jsonpath "$.twitter.commentId"
tw_comment: jsonpath "$.twitter.comment"
tw_comment_top_id: jsonpath "$.commentId"
# -----------------------
# /comments GET
GET {{BASE_URL}}/comments?id={{id}}
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
[Options]
delay: 15000
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.id" == "{{id}}"
jsonpath "$.twitter" isCollection
jsonpath "$.twitter[0].commentId" == "{{tw_comment_id}}"
jsonpath "$.twitter[0].comment" == "{{tw_comment}}"
# -----------------------
# /comments/reply POST
POST {{BASE_URL}}/comments/reply
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
{
"commentId": "{{tw_comment_top_id}}",
"platforms": [
"twitter"
],
"randomComment": true
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.id" == "{{id}}"
jsonpath "$.commentId" exists
jsonpath "$.twitter" exists
jsonpath "$.twitter.status" == "success"
jsonpath "$.twitter.commentId" exists
jsonpath "$.twitter.sourceCommentId" exists
jsonpath "$.twitter.comment" exists
jsonpath "$.twitter.platform" == "twitter"
# -----------------------
# /comments DELETE
DELETE {{BASE_URL}}/comments/{{id}}
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
[Options]
delay: 10000
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.twitter" exists
# -----------------------
# /analytics/post -------
POST {{BASE_URL}}/analytics/post
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
{
"id": "{{id}}"
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.id" == "{{id}}"
jsonpath "$.twitter" exists
jsonpath "$.twitter.id" == "{{tw_id}}"
jsonpath "$.twitter.postUrl" exists
jsonpath "$.twitter.analytics.created" exists
jsonpath "$.twitter.analytics.name" exists
jsonpath "$.twitter.analytics.nonPublicMetrics" exists
jsonpath "$.twitter.analytics.nonPublicMetrics.userProfileClicks" exists
jsonpath "$.twitter.analytics.nonPublicMetrics.impressionCount" exists
jsonpath "$.twitter.analytics.organicMetrics" exists
jsonpath "$.twitter.analytics.organicMetrics.likeCount" exists
jsonpath "$.twitter.analytics.organicMetrics.impressionCount" exists
jsonpath "$.twitter.analytics.organicMetrics.replyCount" exists
jsonpath "$.twitter.analytics.organicMetrics.retweetCount" exists
jsonpath "$.twitter.analytics.organicMetrics.userProfileClicks" exists
jsonpath "$.twitter.analytics.post" exists
jsonpath "$.twitter.analytics.publicMetrics" exists
jsonpath "$.twitter.analytics.publicMetrics.likeCount" exists
jsonpath "$.twitter.analytics.publicMetrics.quoteCount" exists
jsonpath "$.twitter.analytics.publicMetrics.replyCount" exists
jsonpath "$.twitter.analytics.publicMetrics.retweetCount" exists
jsonpath "$.twitter.analytics.username" exists
# -----------------------
# /post DELETE ---------
DELETE {{BASE_URL}}/post
Content-Type: application/json
Authorization: Bearer {{API_KEY}}
{
"id": "{{id}}"
}
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8"
jsonpath "$.status" == "success"
jsonpath "$.id" == "{{id}}"
jsonpath "$.code" == 200
# -----------------------