Codeception: When SOAP and REST modules are loaded the results gets mixed in Codeception 2.1

Created on 13 May 2016  路  4Comments  路  Source: Codeception/Codeception

In my API tests I have SOAP and REST files:

screen shot 2016-05-13 at 12 47 38

I run my API suite that contains SOAP tests and REST tests

One of my REST tests fails:

screen shot 2016-05-13 at 12 48 40

Notice that the error said, that soap response failed, when actually my test is REST.

The issue is that REST and SOAP have got mixed in the generated file ApiTesterActions.php. See:

screen shot 2016-05-13 at 12 50 02

In previous image you can see that some methods use the SOAP module and some others REST module

Most helpful comment

The solution is to mark REST and SOAP modules as incompatible.

All 4 comments

"mixed" is probably the wrong word.

Both SOAP and REST implement the method seeResponseCodeIs(), when the TesterActions get generated, the suite.yml gets parsed and adds all methods of the modules to it. so seeResponseCodeIs() will be used from the last module which implemented it.

in your case: seeResponseEquals comes from REST module (and there is no equal method in the SOAP module), while seeResponseCodeIs() is in both modules.

I guess if you switch REST with SOAP in your suite.yml the error would come from the REST module. but i feel thats not the solution here.

hmmm.. it seems like soap and rest are not compatible.

The solution is to mark REST and SOAP modules as incompatible.

Yes, just don't use them together and be happy )

@DavertMik or @javigomez

So what is the good method to test SOAP and REST API ? for example in one test I need to create user with SOAP API and authenticate with REST API ...

Was this page helpful?
0 / 5 - 0 ratings