I use Codeception
framework and Netbeans
IDE for my test automation using PHP
.
I would like to run 2 tests one after another in a group, where the API test will run first and after the successful run of the API test, next the Acceptance test should run as the Acceptance test depends on the success of the API test.
Here is what I did to get that work:
The API test is created here in my project:
FT/tests/api/MyAPITestCest.php
The Acceptance test is created here in my project:
FT/tests/acceptance/MyAcceptanceTestCest.php
My codeception.yml file is defined here:
FT/codeception.yml
And in the codeption.yml file I defined my group which would run the api test & the acceptance test one after another.
actor: Tester
paths:
tests: tests
groups:
myGroup: [tests/api/MyAPITestCest.php, tests/acceptance/MyAcceptanceTestCest.php]
This is the command I used to run my group of tests:
sudo docker-compose run -e ENVVARIABLE=abc.my.env.com tests vendor/bin/codecept run -g myGroup -vvv --html results.html
Issue
Acceptance test is always running as the first test in the test group although the API test has been defined as the first one in the group
That’s why Acceptance test is never getting the input which would get generated by the API test and thus it’s always failing.
Not sure what is going wrong; appreciate your valuable input so that I can successfully run my API test before the Acceptance test in the same sequence defined in my test group.
thanks in advance!
Here is what I did to get that work:
The API test is created here in my project:
FT/tests/api/MyAPITestCest.php
The Acceptance test is created here in my project:
FT/tests/acceptance/MyAcceptanceTestCest.php
My codeception.yml file is defined here:
FT/codeception.yml
And in the codeption.yml file I defined my group which would run the api test & the acceptance test one after another.
`actor: Tester
paths:
tests: tests
groups:
myGroup: [tests/api/MyAPITestCest.php, tests/acceptance/MyAcceptanceTestCest.php]`
This is the command I used to run my group of tests:
sudo docker-compose run -e ENVVARIABLE=abc.my.env.com tests vendor/bin/codecept run -g myGroup -vvv --html results.html
Issue
Acceptance test is always running as the first test in the test group although the API test has been defined as the first one in the group
That’s why Acceptance test is never getting the input which would get generated by the API test and thus it’s always failing.
Not sure what is going wrong; appreciate your valuable input so that I can successfully run my API test before the Acceptance test in the same sequence defined in my test group.
thanks in advance!