swagception icon indicating copy to clipboard operation
swagception copied to clipboard

Test generation for dummies

Open Shiriaev opened this issue 7 years ago • 2 comments

Hello! Can you please explain for dummies, how to generate cests, step-by-step? I have installed swagception with composer, enable module in acceptance.suite.uml and copy one of the demo tests, then try to run it.

And have error: Warning: array_merge(): Argument #2 is not an array in C:\os\domains\democept.loc\democept\vendor\codeception\codeception\src\Codeception\Extension.php on line 29

I was try to use online swagger json and then try to copy it to folder with my cest.

Thanks beforehand!

Shiriaev avatar Dec 25 '18 12:12 Shiriaev

Hi Pavel, I'm not with my computer at the moment (doing the best I can with my phone). There are a couple of things I'd like to note.

Firstly, I don't see any array_merge in Extension.php so I'm not too sure which version you're running. 1.0 is the stable release.

I am yet to include an examples folder but to see a working example look at https://github.com/mlambley/swagception/blob/master/tests/acceptance/ValidDataCest.php it is the test which loads up a path handler and tests against dummy json.

The tests should pass on your local machine composer test if they don't then something is not installed properly locally, but if they do pass then look at that test cest and go from there.

If you need further assistance please post your code. Thanks.

mlambley avatar Dec 26 '18 01:12 mlambley

Hello Mark, thanks for your answer! I found problem in codeception uml configs, its need to enable module before other modules with parameters. Thanks for your help and userfull tool!

Shiriaev avatar Dec 26 '18 07:12 Shiriaev