Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include tests from different folders #319

Closed
DavertMik opened this issue May 14, 2013 · 8 comments

Comments

Projects
None yet
5 participants
@DavertMik
Copy link
Member

commented May 14, 2013

It's proposed to have an additional config parameter to include tests from other directories, not only for current suite.

includes:
  - src/*Bundle/Tests
  - tests/additional

In this case we can provide more natural testing for Symfony2 bundles.
And execute same tests inside of different suites, discussed here: #154

Pretty simple, yet very helpul feature.

@DavertMik

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2013

Not that simple as I thought but it will be available in next release.

@DavertMik DavertMik closed this Jun 23, 2013

@subdee subdee referenced this issue Mar 4, 2014

Closed

Gii extension generator enhancements #2555

0 of 5 tasks complete
@brodkin

This comment has been minimized.

Copy link
Contributor

commented Oct 16, 2014

Did this ever get implemented? I can't find any documentation for including other test files--just test suites.

@DavertMik

This comment has been minimized.

Copy link
Member Author

commented Oct 16, 2014

@DavertMik

This comment has been minimized.

Copy link
Member Author

commented Oct 16, 2014

Tests can't be included this way, because they depend on actor objects. If tests exists somewhere out of the original scope, it can't get access to FunctionalTester or AcceptanceTester class it uses. Thus, such tests are broken when they are isolated from the suite.

@brodkin

This comment has been minimized.

Copy link
Contributor

commented Oct 16, 2014

Darn, I don't think that solves my problem. I'm trying to run WebDriver with multiple browsers. It was suggested in some other ticket that this could be accomplished once this issue was resolved. I guess that's not going to happen.

@alexbonhomme

This comment has been minimized.

Copy link

commented Dec 31, 2014

Hi,

I think I have a problem with this feature. My structure looks like this :

codeception.yml
app\
  codeception.yml
  tests\
    _bootstrap.php
  utils\
  modules\
    Core\
      codeception.yml
      tests\
        _bootstrap.php

The codeception.yml file in the root looks like :

include:
    - app
    - app/modules/Core
paths:
    log: tests/_output
settings:
    colors: true
    memory_limit: 1024M

If I run each suite of tests separately it works (eg. codecept run -c app/modules/Core).

But if I run it from the root (ie. codecept run) it looks like the _bootstrap.php files of each module isn't execute (ie. my dependences aren't load).

Ideas ?

@nrobles92

This comment has been minimized.

Copy link

commented Jan 3, 2017

So I'm trying to run tests but also trying to keep them separated according to their own module, and in the spirit of full integration actually place them within the php code that its testing. is it possible to run a test with an include statement from the cept or cest file in the suite. To be clear the test code is NOT in the suite only the cept.php file that is using the include statement to get the test.

@vercotux

This comment has been minimized.

Copy link

commented Feb 23, 2018

I'm having a similar issue with Yii2 modules. I want to run the module tests along the main Yii2 app tests (all at once). The first step is simple:

include:
    - frontend
    - backend
    - common
    - vendor/vercotux/yii2-module

This works beautifully for modules that do not require database access. However everything comes crashing down when a module needs database access. The module obviously cannot include its own db config, so it has to somehow get it from the main app. I've tried many configurations in an attempt to do this but no luck so far. Is this even supported by Codeception or am I just doing it wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.