Replies: 13 comments 1 reply
-
Please could we add something like that? :-) My testing crew would love that feature... |
Beta Was this translation helpful? Give feedback.
-
Yes, this would be a really nice feature to have. I will try to implement this, but I don't know when I will have time for it - it could take a few months. |
Beta Was this translation helpful? Give feedback.
-
Neither beforeSuite() work when running single test |
Beta Was this translation helpful? Give feedback.
-
I'm having issues with this too - in my case I'm running the failed tests, but they're being skipped because the I would like for CodeCeption to either run the dependencies, even if not specified - or in the case of running failed tests (which I realise is hard to differentiate from any other group) to assume dependencies which are not included in the run have passed. |
Beta Was this translation helpful? Give feedback.
-
Maybe adding a |
Beta Was this translation helpful? Give feedback.
-
Ignoring dependencies doesn't help in any way. There is a reason why a test has it and it's a requirement for this test. If your test does not have such a requirement you better don't mark it with dependent tests |
Beta Was this translation helpful? Give feedback.
-
So I have a test that adds X component to a system and tests if it was saved, then I have another test that checks that configures X and stores it, and another one that checks that settings were properly stored. Thing is that I might be back and forth doing changes on the 3rd test but I can't run it alone because it depends on #1 and #2 on a full test, but during development I would really like that dependencies were ignored. |
Beta Was this translation helpful? Give feedback.
-
Here's my use case: my tests are never dependent on another test running. I've got bootstrap code and factories for that. I mostly use test dependencies for saying "This depends on LoginCest" because if LoginCest failed - there's no point running the rest of the tests. Another option (in addition to my previosu suggestion about runnign the dependnecies even if they're not selected) would be to have a new attribute "@Runfirst LoginCest" so it'll always make sure that test has been run before running the current test. |
Beta Was this translation helpful? Give feedback.
-
@marc-mabe For your Try 3, did you try adding all the tests it depends on to that same group as well? I tried that with a really small test and it ran with the correct depends. codecept run <suitename> SpotStatsBuildCest.php Even if that works, having @Depends guarantee that the other tests will run (or something of the sort) would be really nice... |
Beta Was this translation helpful? Give feedback.
-
any news about that? I got stuck on same... would be nice to run single test with dep, once that I'm with a hundred of them :) |
Beta Was this translation helpful? Give feedback.
-
I ask the same, any update? IMHO this is a really nice to have, and a must for those developing with TDD. How do you rerun a specific test or class whilst developing? Waiting for 2 minutes for the whole test suite is no needed when you are focused on the response of a specific request (that may have dependencies when running a full test in a clean environment). Personally, I just add a I would love an @Naktibalda, is there a way that we can help you with that? I haven't dive into the code but I'm open for it if it helps. Thank you very much and let's make Codeception the perfect tool :-) |
Beta Was this translation helpful? Give feedback.
-
I agree with that when the tests run in a pipeline or before pushing, for instance. But, when developing in TDD, we first write a very specific test (typically, for a single endpoint) and we expect different cases of responses. At that moment, we use to have the needed data available in the database, maybe testing data. And we first focus on this endpoint, so we don't need to run dozens of tests on every small change that we do. When we are done with this particular test, then of course will run again all the tests with a clean database and taking into account the dependencies. That's why we need 2 modes of running tests without rewriting them: with and without dependencies. |
Beta Was this translation helpful? Give feedback.
-
Uh oh. i came across this issue/discussion in a search for this functionality. Has there been any development movement on this since the last post in 2021? i just want to debug my code through this test but i need to ensure prerequisite code is unaffected... |
Beta Was this translation helpful? Give feedback.
-
What are you trying to achieve?
We have a bug test suite which takes a lot of time to finish.
There are some tests that depend on each other (e.g. a test for creating an entity requires another test to register a user and verify a new user)
As the hole test suite takes a lot of time I want to run a specific test only (e.g. creating an entity) but everything I tried results in failure as the depend tests don't get executed.
In general Codeception is configured to run everything on
./vendor/bin/codecept run
.So to run only specific
SpotStatsBuildCest
which depends on others I tried the following:Try 1:
./vendor/bin/codecept run SpotStatsBuildCest
Try 2:
./vendor/bin/codecept run --fail-fast ./test/integration/cest/SpotStatsBuildCest.php
Try 3:
Added a
@group SpotStatsBuildCest
to the class and./vendor/bin/codecept run --fail-fast --group SpotStatsBuildCest
How can I run only this specific cest (+ dependencies)?
Beta Was this translation helpful? Give feedback.
All reactions