 Let’s start #### First, Let’s check if we have curl package installed ```bash curl -V ``` #### Preparation and start of the test In the API for steem documentation, we can find examples of API calls using the curl program. e.g. ```bash curl -s --data '{"jsonrpc":"2.0", "method":"database_api.find_accounts", "params": {"accounts":["steemit", "grzesiekb"]}, "id":1}' https://api.steemit.com ``` I assume the API works properly if it returns a result containing 'about' ```bash curl -s --data '{"jsonrpc":"2.0", "method":"database_api.find_accounts", "params": {"accounts":["steemit", "grzesiekb"]}, "id":1}' https://api.steemit.com | grep about -q && echo ‘find_accounts works’ || echo ‘find_accounts is not work’ ``` I passed the result to the grep program, in which I check if it contains an 'about' string of characters. If the test is positive, grep returns 'find_accounts works'. If the test is negative, grep returns 'find_accounts is not work'. #### In the near future, I'm going to present my idea for * Authentication test (session) using the curl program. * Authentication test (token) using the curl program. * Reporting test results written using bash script. * Keeping (supporting) the tests written with bash scripts. * Summary (test in bash)
author | grzesiekb |
---|---|
permlink | bash-script-challenge-writing-api-tests-using-the-curl-program |
category | utopian-io |
json_metadata | {"tags":["utopian-io","bash","test","curl"],"image":["https://cdn.steemitimages.com/DQmZfJRTeApQmawAPeER4nDgBszXAtJeWUJ96TtWxrPnEDC/20229352_122422448376375_8167359585774756489_n.jpg"],"app":"steemit/0.1","format":"markdown"} |
created | 2019-09-11 08:50:03 |
last_update | 2019-09-11 13:31:57 |
depth | 0 |
children | 2 |
last_payout | 2019-09-18 08:50:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.071 HBD |
curator_payout_value | 0.068 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,454 |
author_reputation | 2,800,305,353,550 |
root_title | "Bash script - challenge. Writing API tests using the curl program" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 90,467,984 |
net_rshares | 616,847,350,996 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
arcange | 0 | 41,023,019,490 | 3% | ||
raphaelle | 0 | 1,171,620,201 | 3% | ||
jamzed | 0 | 114,867,258,533 | 100% | ||
steemitboard | 0 | 15,955,794,374 | 1% | ||
mys | 0 | 10,125,135,747 | 5% | ||
whd | 0 | 5,651,021,163 | 5% | ||
rafalski | 0 | 3,562,971,402 | 4.75% | ||
loshcat | 0 | 2,656,556,978 | 100% | ||
greenorange | 0 | 577,540,557 | 100% | ||
grzesiekb | 0 | 233,354,166,502 | 100% | ||
remizer | 0 | 337,817,791 | 50% | ||
steem-hikers | 0 | 116,547,161 | 5% | ||
marcon | 0 | 90,661,933,550 | 100% | ||
properfraction | 0 | 3,459,020,236 | 100% | ||
beleg | 0 | 1,855,510,594 | 5% | ||
camillesteemer | 0 | -7,905,962 | -10% | ||
mysia | 0 | 1,896,279,053 | 100% | ||
lecongdoo3 | 0 | 367,870,176 | 100% | ||
laissez-faire | 0 | 144,952,459 | 100% | ||
steemscan | 0 | 1,689,164,210 | 33.33% | ||
liuzhixiang | 0 | 1,646,358,970 | 40% | ||
liucixin | 0 | 1,669,049,042 | 19.04% | ||
sbi9 | 0 | 68,604,176,147 | 78.47% | ||
steemexpress | 0 | 2,309,872,614 | 3.77% | ||
hankreirden | 0 | 114,893,654 | 5% | ||
myslnarodowa | 0 | 4,243,296,687 | 100% | ||
narodowcy.net | 0 | 8,793,429,667 | 100% |
Congratulations @grzesiekb! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) : <table><tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@grzesiekb/posts.png?201909110934"></td><td>You published more than 20 posts. Your next target is to reach 30 posts.</td></tr> </table> <sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@grzesiekb) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=grzesiekb)_</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> To support your work, I also upvoted your post! ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
author | steemitboard |
---|---|
permlink | steemitboard-notify-grzesiekb-20190911t101308000z |
category | utopian-io |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2019-09-11 10:13:06 |
last_update | 2019-09-11 10:13:06 |
depth | 1 |
children | 0 |
last_payout | 2019-09-18 10:13:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 891 |
author_reputation | 38,975,615,169,260 |
root_title | "Bash script - challenge. Writing API tests using the curl program" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 90,469,885 |
net_rshares | 0 |
Congratulations @grzesiekb! You received a personal award! <table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@grzesiekb/birthday2.png</td><td>Happy Birthday! - You are on the Steem blockchain for 2 years!</td></tr></table> <sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@grzesiekb) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=grzesiekb)_</sub> ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
author | steemitboard |
---|---|
permlink | steemitboard-notify-grzesiekb-20191212t182933000z |
category | utopian-io |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2019-12-12 18:29:33 |
last_update | 2019-12-12 18:29:33 |
depth | 1 |
children | 0 |
last_payout | 2019-12-19 18:29:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 624 |
author_reputation | 38,975,615,169,260 |
root_title | "Bash script - challenge. Writing API tests using the curl program" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 93,354,560 |
net_rshares | 0 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
grzesiekb | 0 | 0 | 36% |