eykrehbein / strest

⚡️ CI-ready tests for REST APIs configured in YAML
MIT License
1.74k stars 59 forks source link

Support BDD test #90

Open augustine-tran opened 6 years ago

augustine-tran commented 6 years ago

Hi guys,

With Postman, I follow BDD style Given...When...Then for naming request in a flow. Example:

Given user has a balance 
When user topup +$10
Then user balance will be increased by $10

I suggest adding a new field to describe the above style.

If could, please let me know which is the fastest way to add a new field I can help to contribute a PR.

Thanks for your awesome efforts.

jgroom33 commented 6 years ago

What would be all the expected behaviors of the new field?

augustine-tran commented 6 years ago

@jgroom33 just for printing out on test result. Example:

[v] Given use has a banace
[v] When user topup +$10
[v] Then user balance will be increased by $10
augustine-tran commented 6 years ago

I don't prefer the current request name field is because it will be too long for use as a value in later requests.

jgroom33 commented 6 years ago

Implementation:

version: 1

requests:
  userRequest:
    description: This is a description of the request that will be printed during the output
    url: https://postman-echo.com/get
    method: GET

result:

[ Strest ] Found 1 test file(s)
[ Strest ] Schema validation: 1 of 1 file(s) passed

✔ Testing userRequest succeeded (0.1s)
     This is a description of the request that will be printed during the output

[ Strest ] ✨  Done in 0.62s
augustine-tran commented 6 years ago

+1 thanks @jgroom33