Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm committed Nov 19, 2021
1 parent d453a7c commit f23acfe
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ Feature: Get Item
`^I should have(?: a)? (?:GRPC|grpc) response with payload:?$`
- Check for error code and error message <br/>
`^I should have(?: a)? (?:GRPC|grpc) response with error (?:message )?"([^"]*)"$` <br/>
`^I should have(?: a)? (?:GRPC|grpc) response with code "([^"]*)" and error (?:message )?"([^"]*)"$`
`^I should have(?: a)? (?:GRPC|grpc) response with code "([^"]*)" and error (?:message )?"([^"]*)"$`<br/>
<br/>
If your error message contains quotes `"`, better use these with a doc string<br/>
`^I should have(?: a)? (?:GRPC|grpc) response with error (?:message )?:$` <br/>
`^I should have(?: a)? (?:GRPC|grpc) response with code "([^"]*)" and error (?:message )?:$`<br/>

For example:

Expand Down Expand Up @@ -194,3 +198,29 @@ Feature: Create Items
}
"""
```

or

```gherkin
Feature: Create Items
Scenario: Create items
When I request a GRPC method "/grpctest.ItemService/CreateItems" with payload:
"""
[
{
"id": 42,
"name": "Item #42"
},
{
"id": 43,
"name": "Item #42"
}
]
"""
Then I should have a GRPC response with error:
"""
invalid "id"
"""
```
7 changes: 6 additions & 1 deletion features/NoServer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ Feature:
"""
And The GRPC request timeout is "1ms"

Then I should have a GRPC response with code "DEADLINE_EXCEEDED"
# Then I should have a GRPC response with code "DEADLINE_EXCEEDED"

Then I should have a GRPC response with error message:
"""
context deadline exceeded
"""

0 comments on commit f23acfe

Please sign in to comment.