|
1 | | ---- |
2 | | -layout: page |
3 | | -title: Codeception Commands |
4 | | ---- |
5 | | - |
6 | | -# Commands |
7 | | - |
8 | | -Depending on version run Codeception console uitility in following way: |
9 | | - |
10 | | -* `php codecept.phar run` - for downloaded phar executable. |
11 | | -* `codecept run` - for PEAR installation |
12 | | -* `php vendor/bin/codecept` - for composer installation. |
13 | | - |
14 | | -The commands listed below use PEAR installation as an example. |
15 | | - |
16 | | -### Run |
17 | | - |
18 | | -Executes Tests. |
19 | | - |
20 | | -#### Usage |
21 | | - |
22 | | -* `codecept run` - executes all tests in all suites |
23 | | -* `codecept run suitename` - executes all test from this suite |
24 | | -* `codecept run suitename testnameTest.php` - executes one test of this suite (provide local path for suite directory). |
25 | | - |
26 | | -#### Options |
27 | | - |
28 | | -* `--debug` - additional debug output will be printed. |
29 | | -* `--steps` - all performed actions will be printed to console. |
30 | | -* `--colors` - turn on colors (if disabled) |
31 | | -* `--silent` - don't show the progress output. |
32 | | -* `--report` - format results in report mode. |
33 | | -* `--no-exit` - don't provide exit codes on finish. This option may be useful for using Codeception with some CI servers like Bamboo. |
34 | | -* `--html` - generate html file with results. It will be stored as 'report.html' in tests/_log. |
35 | | -* `--xml` - generate report in JUnit format for CI services. It will be stored as 'report.xml' in tests/_log. |
36 | | -* `--tap` - generate report in TAP format. It will be stored as 'report.tap.log' in tests/_log. |
37 | | -* `--json` - generate report in Json format. It will be stored as 'report.json' in tests/_log. |
38 | | - |
39 | | -### Boostrap |
40 | | - |
41 | | -Creates default config, tests directory and sample suites for current project. |
42 | | -Use this command to start building a test suite. |
43 | | - |
44 | | -#### Usage |
45 | | - |
46 | | -* `codecept bootstrap` |
47 | | - |
48 | | -### Install |
49 | | - |
50 | | -Tries to install Mink, PHPUnit, Symfony Components via PEAR. This command needs to successfully complete PEAR installation. This command may fail due to PEAR issues. We recommend to use phar executable or Composer, if you don't have time and enthusiasm to fight PEAR bugs. |
51 | | - |
52 | | -#### Usage |
53 | | - |
54 | | -* `codecept install` |
55 | | - |
56 | | -### Generate Suite |
57 | | - |
58 | | -Generates a new empty suite. You may generate new suite for integration tests, for testing different part of appications, etc. |
59 | | - |
60 | | -#### Usage |
61 | | - |
62 | | -* `codecept genrate:suite suitename guyname` - provide name of suite and name a Guy who will be used in tests. |
63 | | - |
64 | | -Don't create two guys with the same name! |
65 | | - |
66 | | -### Generate Cept |
67 | | - |
68 | | -Generates new empty test file for acceptance and functional tests. Scenario-based test is called Cept, though. |
69 | | - |
70 | | -#### Usage |
71 | | - |
72 | | -* `codcept generate:cept suitename testname` - generates testnameCept.php inside the suite. |
73 | | -* `codecept generate:cept suitename subdir/subdir/testnameCept.php` - generates file in subdir/subdir of suite dir. |
74 | | - |
75 | | -### Generate Cest |
76 | | - |
77 | | -Generates new empty test file for scenario-based unit tests. This file format is called Cest = Cept + Test. |
78 | | - |
79 | | -#### Usage |
80 | | - |
81 | | -* `codcept generate:cest suitename testname` - generates testnameCest.php inside the suite. |
82 | | -* `codecept generate:cest suitename subdir/subdir/testnameCest.php` - generates file in subdir/subdir of suite dir. |
83 | | - |
84 | | -### Generate Scenarios |
85 | | - |
86 | | -Generates text representation for all tests in suite. They are called scenarios and stored as a text files in the `log` dir. |
87 | | - |
88 | | -#### Usage |
89 | | - |
90 | | -* `codecept generate:scenarios suitename` - generates for this suite. |
91 | | - |
92 | | - |
93 | | - |
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: Codeception Commands |
| 4 | +--- |
| 5 | + |
| 6 | +# Commands |
| 7 | + |
| 8 | +Depending on version run Codeception console uitility in following way: |
| 9 | + |
| 10 | +* `php codecept.phar run` - for downloaded phar executable. |
| 11 | +* `codecept run` - for PEAR installation |
| 12 | +* `php vendor/bin/codecept` - for composer installation. |
| 13 | + |
| 14 | +The commands listed below use PEAR installation as an example. |
| 15 | + |
| 16 | +### Run |
| 17 | + |
| 18 | +Executes Tests. |
| 19 | + |
| 20 | +#### Usage |
| 21 | + |
| 22 | +* `codecept run` - executes all tests in all suites |
| 23 | +* `codecept run suitename` - executes all test from this suite |
| 24 | +* `codecept run suitename testnameTest.php` - executes one test of this suite (provide local path for suite directory). |
| 25 | + |
| 26 | +#### Options |
| 27 | + |
| 28 | +* `--debug` - additional debug output will be printed. |
| 29 | +* `--steps` - all performed actions will be printed to console. |
| 30 | +* `--colors` - turn on colors (if disabled) |
| 31 | +* `--silent` - don't show the progress output. |
| 32 | +* `--report` - format results in report mode. |
| 33 | +* `--no-exit` - don't provide exit codes on finish. This option may be useful for using Codeception with some CI servers like Bamboo. |
| 34 | +* `--html` - generate html file with results. It will be stored as 'report.html' in tests/_log. |
| 35 | +* `--xml` - generate report in JUnit format for CI services. It will be stored as 'report.xml' in tests/_log. |
| 36 | +* `--tap` - generate report in TAP format. It will be stored as 'report.tap.log' in tests/_log. |
| 37 | +* `--json` - generate report in Json format. It will be stored as 'report.json' in tests/_log. |
| 38 | + |
| 39 | +### Boostrap |
| 40 | + |
| 41 | +Creates default config, tests directory and sample suites for current project. |
| 42 | +Use this command to start building a test suite. |
| 43 | + |
| 44 | +#### Usage |
| 45 | + |
| 46 | +* `codecept bootstrap` |
| 47 | + |
| 48 | +### Generate Suite |
| 49 | + |
| 50 | +Generates a new empty suite. You may generate new suite for integration tests, for testing different part of appications, etc. |
| 51 | + |
| 52 | +#### Usage |
| 53 | + |
| 54 | +* `codecept genrate:suite suitename guyname` - provide name of suite and name a Guy who will be used in tests. |
| 55 | + |
| 56 | +Don't create two guys with the same name! |
| 57 | + |
| 58 | +### Generate Cept |
| 59 | + |
| 60 | +Generates new empty test file for acceptance and functional tests. Scenario-based test is called Cept, though. |
| 61 | + |
| 62 | +#### Usage |
| 63 | + |
| 64 | +* `codcept generate:cept suitename testname` - generates testnameCept.php inside the suite. |
| 65 | +* `codecept generate:cept suitename subdir/subdir/testnameCept.php` - generates file in subdir/subdir of suite dir. |
| 66 | + |
| 67 | +### Generate Cest |
| 68 | + |
| 69 | +Generates new empty test file for scenario-based unit tests. This file format is called Cest = Cept + Test. |
| 70 | + |
| 71 | +#### Usage |
| 72 | + |
| 73 | +* `codcept generate:cest suitename testname` - generates testnameCest.php inside the suite. |
| 74 | +* `codecept generate:cest suitename subdir/subdir/testnameCest.php` - generates file in subdir/subdir of suite dir. |
| 75 | + |
| 76 | +### Generate Test |
| 77 | + |
| 78 | +Generates new empty test file for PHPUnit unit test. |
| 79 | + |
| 80 | +#### Usage |
| 81 | + |
| 82 | +* `codcept generate:cest suitename testname` - generates testnameTest.php inside the suite. |
| 83 | +* `codecept generate:cest suitename subdir/subdir/testnameTest.php` - generates file in subdir/subdir of suite dir. |
| 84 | + |
| 85 | +### Generate Scenarios |
| 86 | + |
| 87 | +Generates text representation for all tests in suite. They are called scenarios and stored as a text files in the `log` dir. |
| 88 | + |
| 89 | +#### Usage |
| 90 | + |
| 91 | +* `codecept generate:scenarios suitename` - generates for this suite. |
| 92 | + |
| 93 | + |
| 94 | + |
0 commit comments