Skip to content

Commit

Permalink
chore: improve examples/realworld
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Jun 6, 2021
1 parent 135dc6b commit 47cb464
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 38 deletions.
87 changes: 51 additions & 36 deletions examples/realworld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,61 @@
Take a moment to familiarize yourself with [RealWorld API Spec](https://github.com/gothinkster/realworld/tree/master/api)

```
apitest examples/realworld
module main
main
prepare ✔
module auth
Register (0.869) ✔
Login (0.644) ✔
Current User (0.578) ✔
Update User (0.598) ✔
module article1
All Articles (0.762) ✔
Articles by Author (0.507) ✔
Articles Favorited by Username (0.490) ✔
Articles by Tag (0.832) ✔
module article2
Create Article (0.625) ✔
Feed (0.591) ✔
All Articles with auth (1.193) ✔
Articles by Author with auth (0.573) ✔
Articles Favorited by Username with auth (0.569) ✔
Single Article by slug (0.623) ✔
Articles by Tag (0.879) ✔
Update Article (0.739) ✔
Favorite Article (0.619) ✔
Unfavorite Article (0.617) ✔
Create Comment for Article (0.618) ✔
All Comments for Article (0.594) ✔
All Comments for Article without auth (0.616) ✔
Delete Comment for Article (0.602) ✔
Delete Article (0.635) ✔
module profile
Register Celeb (0.659) ✔
Profile (0.552) ✔
Follow Profile (0.606) ✔
Unfollow Profile (0.526) ✘
module tag
All Tags (1.561) ✔
{
"req": {
"username": "eddie554",
"email": "eddie554@gmail.com",
"password": "9Ot(zG(2Kq%9"
},
"res": {
"username": "eddie554",
"email": "eddie554@gmail.com",
"password": "9Ot(zG(2Kq%9"
},
"run": {
"dump": true
}
}
auth
Register (0.736) ✔
Login (0.680) ✔
Current User (0.612) ✔
Update User (0.595) ✔
article1
All Articles (1.080) ✔
Articles by Author (0.640) ✔
Articles Favorited by Username (0.618) ✔
Articles by Tag (0.940) ✔
article2
Create Article (0.692) ✔
Feed (0.635) ✔
All Articles with auth (1.732) ✔
Articles by Author with auth (1.003) ✔
Articles Favorited by Username with auth (0.610) ✔
Single Article by slug (0.707) ✔
Articles by Tag (1.156) ✔
Update Article (0.714) ✔
Favorite Article (0.700) ✔
Unfavorite Article (1.441) ✔
Create Comment for Article (0.714) ✔
All Comments for Article (0.683) ✔
All Comments for Article without auth (0.682) ✔
Delete Comment for Article (0.664) ✔
Delete Article (0.628) ✔
profile
Register Celeb (0.707) ✔
Profile (0.638) ✔
Follow Profile (1.112) ✔
Unfollow Profile (0.613) ✘
tag
All Tags (1.600) ✔
1. Unfollow Profile(profile.unfollowProfile)
profile.unfollowProfile.res.body.profile.following: true ≠ false
error Command failed with exit code 1.
```

Apites will execute the test cases in sequence and print the test results.
7 changes: 5 additions & 2 deletions examples/realworld/main.jsona
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

variables: { @describe("prepare") @client("echo")
req: {
username: 'username(true)', @mock
email: 'email', @mock
username: 'username(3)', @mock
email: `req.username + "@gmail.com"`, @eval
password: 'string(12)', @mock
},
run: {
dump: true,
}
}
}

0 comments on commit 47cb464

Please sign in to comment.