Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a negative test on the Endpoint #1656

Closed
bltemrah opened this issue Jun 21, 2021 · 1 comment
Closed

How to make a negative test on the Endpoint #1656

bltemrah opened this issue Jun 21, 2021 · 1 comment
Labels

Comments

@bltemrah
Copy link

Hi there,

Please, can you let me know how I make a negative test as displayed below that I need to put nothing for "productKey" inside the path parameter in the Examples. Once I put "" or '' or just space, they do not work. In the Postman, it works when I delete only the part of the product key in the path parameter. FYI, space works in payload, not as in path parameter. Thanks in advance.

Feature: User should Get Account with ProductKey and Agent Token

Background:
.
.
.
# negative
Scenario Outline: Get Product with invalid ProductKey and Agent Token Negative Test
And header Authorization =
And path '/v1/products/agent/'++'/account'
When method GET
Then status

And match response..description contains ""

Examples:
  | number | Authorization | productKey            | status | error                             |
  | 1      | agentToken    | ""                    | 400    | must not be blank                 |
  | 2      | agentToken    | invalidProductKey     | 400    | Product key must be 36 characters |
  | 3      | agentToken    | productKeyNotIncluded | 404    | No account found for product key. |
@ptrthomas
Copy link
Member

@bltemrah follow this process. there are good reasons: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

there was some discussion around path parameters here, see if that makes sense: #1561

and I recommend if you have a "special case" PLEASE write a new Scenario and DON'T mix it with Examples etc, it just lands you in trouble. take some time and read this please, maybe that is your solution: https://stackoverflow.com/a/54126724/143475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants