Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add multiple codeception suites to different folders in one project?

I have the following folder structure, I want multiple test suites to exist in different directories.

- project
    - app
        - app-A
            - tests
                - (functional tests here)

        - app-B
            - tests
                - (functional tests here)

    - domains
        - domain-A
            - tests
                - (unit tests here)

        - domain-B
            - tests
                - (unit tests here)
like image 802
Mahmoud Zalt Avatar asked Nov 26 '25 20:11

Mahmoud Zalt


1 Answers

1. create codeception.yml file in the root directory of your project

2. past the following in that file:

include:

  - 

paths:

  log: log

settings:

  colors: true

3. generate the some test suites in on their sub directories:

codecept bootstrap /.../src/Domains/User --namespace user

codecept bootstrap /.../src/Application/Cms --namespace cms

4. update the codeception.yml of the root directory by including the path to the test suite under the includes.

include:

  - src/Domains/User

  - src/Application/Cms

5. generate some tests

codecept generate:cept --config src/Domains/User unit testB

codecept generate:cept --config src/Applications/Cms functional testA

6. run the tests

codecept run
like image 87
Mahmoud Zalt Avatar answered Nov 29 '25 12:11

Mahmoud Zalt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!