I'm trying to setup some Codeception tests to test an API that I'm building but I seem to be doing something wrong.
Following a tutorial* I have run php codecept.phar generate:suite api
which creates the ./tests/api.suite.yml file which looks like this:
class_name: ApiTester
modules:
enabled:
- \Helper\Api
I modified this file to be the same as the one in the tutorial (adding my URL) like this:
class_name: ApiTester
modules:
enabled:
- REST:
url: http://serviceapp/api/v1/
depends: PhpBrowser
And then generate a test script generate:cept api ReadUser
and add my tests such as
<?php
$I = new ApiTester($scenario);
$I->wantTo('perform actions and see result');
$I->sendGet('/user/1');
However when I run the test I get the error Call to undefined method ApiTester::sendGet
What do I need to add to have methods like sendGet, sendPost and all the others available?
The Codeception version is 2.1.5
Aucun commentaire:
Enregistrer un commentaire