Skip to content

Commit ad480cf

Browse files
committed
name to title
n
1 parent 2675236 commit ad480cf

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

Examples/realworld.tk.yaml

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: Register
1+
- title: Register
22
POST: $.env.APIURL/users
33
headers:
44
Content-Type: application/json
@@ -11,7 +11,7 @@
1111
exists: $.resp.json.user.bio
1212
exists: $.resp.json.user.image
1313
exists: $.resp.json.user.token
14-
- name: Login
14+
- title: Login
1515
POST: '$.env.APIURL/users/login'
1616
headers:
1717
Content-Type: application/json
@@ -24,7 +24,7 @@
2424
exists: $.resp.body.json.user.bio
2525
exists: $.resp.body.json.user.image
2626
exists: $.resp.body.json.user.token
27-
- name: Login and Remember Token
27+
- title: Login and Remember Token
2828
POST: '$.env.APIURL/users/login'
2929
headers:
3030
Content-Type: application/json
@@ -37,7 +37,7 @@
3737
exists: $.resp.body.json.user.bio
3838
exists: $.resp.body.json.user.image
3939
exists: $.resp.body.json.user.token
40-
- name: Current User
40+
- title: Current User
4141
GET: '$.env.APIURL/user'
4242
headers:
4343
Content-Type: application/json
@@ -50,7 +50,7 @@
5050
exists: $.resp.json.user.bio
5151
exists: $.resp.json.user.image
5252
exists: $.resp.json.user.token
53-
- name: Update User
53+
- title: Update User
5454
PUT: '$.env.APIURL/user'
5555
headers:
5656
Content-Type: application/json
@@ -64,7 +64,7 @@
6464
exists: $.resp.json.user.bio
6565
exists: $.resp.json.user.image
6666
exists: $.resp.json.user.token
67-
- name: Get All Articles
67+
- title: Get All Articles
6868
GET: '$.env.APIURL/articles'
6969
headers:
7070
Content-Type: application/json
@@ -89,7 +89,7 @@
8989
exists: $.resp.body.json.articles[0].favorited
9090
exists: $.resp.body.json.articles[0].favoritesCount
9191
number: $.resp.body.json.articles[0].favoritesCount
92-
- name: Get Articles by Author
92+
- title: Get Articles by Author
9393
GET: $.env.APIURL/articles?author=johnjacob
9494
headers:
9595
Content-Type: application/json
@@ -116,7 +116,7 @@
116116
exists: $.resp.body.json.articles[0].favoritesCount
117117
number: $.resp.body.json.articles[0].favoritesCount
118118
ok: $.resp.body.json.articlesCount == $.resp.body.json.articles.length()
119-
- name: Get Articles Favorited by Username
119+
- title: Get Articles Favorited by Username
120120
GET: $.envn.APIURL/articles?favorited=$.envn.USERNAME
121121
headers:
122122
Content-Type: application/json
@@ -142,7 +142,7 @@
142142
exists: $.resp.body.json.articles[0].favoritesCount
143143
number: $.resp.body.json.articles[0].favoritesCount
144144
ok: $.resp.body.json.articlesCount == $.resp.body.json.articles.length()
145-
- name: Get Articles by Tag
145+
- title: Get Articles by Tag
146146
GET: $.env.APIURL/articles?tag=dragons
147147
headers:
148148
Content-Type: application/json
@@ -168,7 +168,7 @@
168168
exists: $.resp.body.json.articles[0].favoritesCount
169169
number: $.resp.body.json.articles[0].favoritesCount
170170
ok: $.resp.body.json.articlesCount == $.resp.body.json.articles.length()
171-
- name: Create an Article
171+
- title: Create an Article
172172
POST: $.env.APIURL/articles
173173
headers:
174174
Content-Type: application/json
@@ -187,7 +187,7 @@
187187
exists: $.resp.body.json.article.author
188188
ok: $.resp.body.json.article.favorited == false
189189
ok: $.resp.body.json.article.favoritesCount == 0
190-
- name: Get Feed Articles
190+
- title: Get Feed Articles
191191
GET: $.env.APIURL/articles/feed
192192
headers:
193193
Content-Type: application/json
@@ -215,7 +215,7 @@
215215
exists: $.resp.body.json.articles[0].favorited
216216
exists: $.resp.body.json.articles[0].favoritesCount
217217
number: $.resp.body.json.articles[0].favoritesCount
218-
- name: Get Articles by Author
218+
- title: Get Articles by Author
219219
GET: '$.envn.APIURL/articles?author=$.envn.USERNAME'
220220
headers:
221221
Content-Type: application/json
@@ -244,7 +244,7 @@
244244
number: $.resp.body.json.articles[0].favoritesCount
245245
exports:
246246
slug: $.resp.body.json.articles[0].slug
247-
- name: Get Single Article by Slug
247+
- title: Get Single Article by Slug
248248
GET: $.envn.APIURL/articles/$.stages[-1].slug'
249249
headers:
250250
Content-Type: application/json
@@ -267,7 +267,7 @@
267267
exists: $.resp.body.json.article.favorited
268268
exists: $.resp.body.json.article.favoritesCount
269269
number: $.resp.body.json.article.favoritesCount
270-
- name: Articles by Tag
270+
- title: Articles by Tag
271271
GET: '$.env.APIURL/articles?tag=dragons'
272272
headers:
273273
Content-Type: application/json
@@ -297,7 +297,7 @@
297297
number: $.resp.body.json.articles[0].favoritesCount
298298
exports:
299299
slug: $.resp.body.json.articles[0].slug
300-
- name: Update Article
300+
- title: Update Article
301301
PUT: '$.env.APIURL/articles/$.stages[-1].outputs.slug'
302302
headers:
303303
Content-Type: application/json
@@ -323,7 +323,7 @@
323323
number: $.resp.body.json.article.favoritesCount
324324
exports:
325325
slug: $.resp.body.json.articles[0].slug
326-
- name: Favorite Article
326+
- title: Favorite Article
327327
POST: '$.env.APIURL/articles/$.stages[-1].outputs.slug/favorite'
328328
headers:
329329
Content-Type: application/json
@@ -348,7 +348,7 @@
348348
exists: $.resp.body.json.article.favoritesCount
349349
number: $.resp.body.json.article.favoritesCount
350350
ok: $.resp.body.json.article.favoritesCount > 0
351-
- name: Articles Favorited by Username
351+
- title: Articles Favorited by Username
352352
GET: '$.env.APIURL/articles?favorited=$.env.USERNAME'
353353
headers:
354354
Content-Type: application/json
@@ -378,7 +378,7 @@
378378
ok: $.resp.body.json.articles[0].favoritesCount == 1
379379
exports:
380380
slug: $.resp.body.json.articles[0].slug
381-
- name: Unfavorite Article
381+
- title: Unfavorite Article
382382
DELETE: $.env.APIURL/articles/$.stages[-1].outputs.slug/favorite
383383
headers:
384384
Content-Type: application/json
@@ -404,7 +404,7 @@
404404
number: $.resp.body.json.article.favoritesCount
405405
exports:
406406
slug: $.resp.body.json.articles[0].slug
407-
- name: Create Comment for Article
407+
- title: Create Comment for Article
408408
POST: $.env.APIURL/articles/$.stages[-1].outputs.slug/comments
409409
headers:
410410
Content-Type: application/json
@@ -423,7 +423,7 @@
423423
exists: $.resp.body.json.comment.author
424424
exports:
425425
slug: $.resp.body.json.articles[0].slug
426-
- name: All Comments for Article
426+
- title: All Comments for Article
427427
GET: '$.env.APIURL/articles/$.stages[-1].outputs.slug/comments'
428428
headers:
429429
Content-Type: application/json
@@ -441,7 +441,7 @@
441441
exists: $.resp.body.json.comments[0].author
442442
exports:
443443
slug: $.resp.body.json.articles[0].slug
444-
- name: All Comments for Article without login
444+
- title: All Comments for Article without login
445445
GET: '$.env.APIURL/articles/$.stages[-1].outputs.slug/comments'
446446
headers:
447447
Content-Type: application/json
@@ -458,7 +458,7 @@
458458
exists: $.resp.body.json.comments[0].author
459459
exports:
460460
slug: $.resp.body.json.articles[0].slug
461-
- name: Delete Comment for Article
461+
- title: Delete Comment for Article
462462
DELETE: '$.env.APIURL/articles/$.stages[-1].outputs.slug/comments/{{commentId}}'
463463
headers:
464464
Content-Type: application/json
@@ -476,15 +476,15 @@
476476
exists: $.resp.body.json.comment.author
477477
exports:
478478
slug: $.resp.body.json.articles[0].slug
479-
- name: Delete Article
479+
- title: Delete Article
480480
DELETE: '$.env.APIURL/articles/$.stages[-1].outputs.slug'
481481
headers:
482482
Content-Type: application/json
483483
X-Requested-With: XMLHttpRequest
484484
Authorization: Token $.env.TOKEN
485485
asserts:
486486
ok: $.resp.status == 200
487-
- name: Profile
487+
- title: Profile
488488
GET: '$.env.APIURL/profiles/celeb_$.env.USERNAME'
489489
headers:
490490
Content-Type: application/json
@@ -497,7 +497,7 @@
497497
exists: $.resp.body.json.profile.bio
498498
exists: $.resp.body.json.profile.image
499499
exists: $.resp.body.json.profile.following
500-
- name: Follow Profile
500+
- title: Follow Profile
501501
POST: '$.env.APIURL/profiles/celeb_$.env.USERNAME/follow'
502502
headers:
503503
Content-Type: application/json
@@ -512,7 +512,7 @@
512512
exists: $.resp.body.json.profile.image
513513
exists: $.resp.body.json.profile.following
514514
ok: $.resp.body.json.profile.following == true
515-
- name: Unfollow Profile
515+
- title: Unfollow Profile
516516
DELETE: '$.env.APIURL/profiles/celeb_$.env.USERNAME/follow'
517517
headers:
518518
Content-Type: application/json
@@ -525,7 +525,7 @@
525525
exists: $.resp.body.json.profile.image
526526
exists: $.resp.body.json.profile.following
527527
ok: $.resp.body.json.profile.following == false
528-
- name: All Tags
528+
- title: All Tags
529529
GET: '$.env.APIURL/tags'
530530
headers:
531531
Content-Type: application/json

src/base_request.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use thiserror::Error;
1414
#[serde_as]
1515
#[derive(Debug, Serialize, Deserialize)]
1616
pub struct TestItem {
17-
name: Option<String>,
17+
title: Option<String>,
1818
dump: Option<bool>,
1919
#[serde(flatten)]
2020
request: RequestConfig,
@@ -158,8 +158,8 @@ pub async fn base_request(
158158

159159
for (i, test_item) in test_items.iter().enumerate() {
160160
let mut ctx = ctx.clone();
161-
ctx.plan = test_item.name.clone();
162-
ctx.stage = test_item.name.clone();
161+
ctx.plan = test_item.title.clone();
162+
ctx.stage = test_item.title.clone();
163163
ctx.stage_index = i as u32;
164164
log::info!(target:"testkit",
165165
"{:?} ⬅ {}/{}",
@@ -265,7 +265,7 @@ pub async fn base_request(
265265
}
266266
}
267267
results.push(RequestResult {
268-
stage_name: test_item.name.clone(),
268+
stage_name: test_item.title.clone(),
269269
stage_index: i as u32,
270270
assert_results,
271271
});
@@ -699,7 +699,7 @@ mod tests {
699699
let yaml_str = format!(
700700
r#"
701701
---
702-
- name: stage1
702+
- title: stage1
703703
POST: {}
704704
headers:
705705
Content-Type: application/json

0 commit comments

Comments
 (0)