-
Notifications
You must be signed in to change notification settings - Fork 40
Run only specified tests
Ondřej Machulda edited this page Nov 9, 2017
·
3 revisions
You often don't want to run whole test suite - especially when debugging tests and running them locally.
There are several ways to define which tests you want to run by Steward.
Use --pattern
option and specify whole file name:
vendor/bin/steward run staging chrome --pattern ProductDetailTest.php -vvv
Combine --pattern
with --filter
to run only one method of one file:
vendor/bin/steward run staging chrome --pattern ProductDetailTest.php --filter shouldAddProductsToCart -vvv
This will run only testcase classes having @group
annotation like this:
/**
* @group login
* @group foo
*/
class LoginTest extends AbstractTestCase
{
...
}
vendor/bin/steward run staging chrome --group login -vvv
Multiple groups could be selected to be run:
vendor/bin/steward run staging chrome --group login --group checkout -vvv
You can use --exclude-group
option to exclude specific group of tests:
vendor/bin/steward run staging chrome --exclude-group login -vvv
Also note --exclude-group
and --group
options could be combined:
vendor/bin/steward run staging chrome --group account --group checkout --exclude-group login -vvv