(Migrated) Unexpected test failure using apitest

(This message has been automatically imported from the retired mailing list)

Running apitest demo results in all passes, so apitest and zato are working
correctly.

I’m new to Gherkin, so this is almost certainly end user error. I have a
test that’s failing but should pass (checking against an empty string for
the /response/data JSON pointer). Could you let me know where I’m going
wrong?

=============
curl response from zato on invoking the service -

GET /testtest
{
response: {
status: {
info: null,
code: 200,
ver: 1,
cid: “K044CS2QC06AKKT9ZKQKM3EN916R”,
error: null,
msg: “OK”
},
data: “”
}
}

=============
here’s the execution run - all text is green in the output, but i think
checking for the empty string is what’s blowing up:

vagrant@zato:~/zato$ apitest run tests/
Using defaults:
logging_format %(levelname)s:%(name)s:%(message)s
dry_run False
color True
show_timings True
stdout_capture True
junit False
log_capture True
summary True
show_skipped True
show_snippets True
default_format pretty
stderr_capture True
logging_level 20
show_source True
Supplied path: "/vagrant/zatodev/tests/features"
Trying base directory: /vagrant/zatodev/tests/features
Feature: zato-apitest testing

Scenario: *** Get corpus list - empty ***
Given address "http://localhost:11223"
Given URL path "/testtest"
Given HTTP method "GET"
Given format "JSON"
Given request is "{}"
When the URL is invoked
Then status is "200"
And JSON Pointer “/response/data” is “”

Failing scenarios:
tests/features/cte.feature:3 *** Get empty data test ***

0 features passed, 1 failed, 0 skipped
0 scenarios passed, 1 failed, 0 skipped
7 steps passed, 0 failed, 0 skipped, 1 undefined
Took 0m0.035s

Sorry. I did not rename consistently. The content is the same. Just edited
the test name before sending to the list.

here’s an unedited gist:
https://gist.github.com/grenzi/21d9c0450bcbf5b48d3b0dee171786ea

On Fri, Jun 17, 2016 at 10:29 AM Rafa=C5=82 Krysiak rafal@zato.io wrote:

Hello Gage,

According to the output you’ve posted, the failing scenario is ‘Get
empty data test’, and not ‘Get corpus list - empty’.

What’s the content of ‘Get empty data test’ scenario?

On 17.06.2016 16:21, Gage Renzi wrote:

Feature: zato-apitest testing

Scenario: *** Get corpus list - empty ***
Given address "http://localhost:11223"
Given URL path "/testtest"
Given HTTP method "GET"
Given format "JSON"
Given request is "{}"
When the URL is invoked
Then status is "200"
And JSON Pointer “/response/data” is “”

Failing scenarios:
tests/features/cte.feature:3 *** Get empty data test ***

0 features passed, 1 failed, 0 skipped
0 scenarios passed, 1 failed, 0 skipped
7 steps passed, 0 failed, 0 skipped, 1 undefined
Took 0m0.035s


Rafa=C5=82 Krysiak

https://zato.io
ESB, SOA, REST, APIs and Cloud Integrations in Python

it works perfectly. on to real test implementation now =3D)

I’m just getting started with zato, but really finding a lot of value in
it so far.

thanks very much!

On Fri, Jun 17, 2016 at 11:07 AM Rafa=C5=82 Krysiak rafal@zato.io wrote:

How about replacing:

And JSON Pointer “/response/data” is “”

with:

And JSON Pointer “/response/data” is empty

Does that work?

On 17.06.2016 17:42, Gage Renzi wrote:

Sorry. I did not rename consistently. The content is the same. Just
edited the test name before sending to the list.

here’s an unedited
gist: https://gist.github.com/grenzi/21d9c0450bcbf5b48d3b0dee171786ea


Rafa=C5=82 Krysiak

https://zato.io
ESB, SOA, REST, APIs and Cloud Integrations in Python