Skip to content

Commit 556ff74

Browse files
committed
auto updated documentation
1 parent 5e38909 commit 556ff74

File tree

7 files changed

+152
-29
lines changed

7 files changed

+152
-29
lines changed

changelog.markdown

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,80 @@ title: Codeception Changelog
77

88
# Changelog
99

10+
#### 2.2.10
11+
12+
* Prefer local composer installation if available. Solves issues with incompatibility between locally and globally installed or packaged in phar file Codeception dependencies. Fix by **[Naktibalda](https://github.com/Naktibalda)** See [#3997](https://github.com/Codeception/Codeception/issues/3997)
13+
* Added console completion by **[gdscei](https://github.com/gdscei)**. See [documentation](http://codeception.com/docs/07-AdvancedUsage#Shell-autocompletion)
14+
* **[WebDriver]** Fixed compatibility with `facebook/webdriver` 1.4.0 by **[Naktibalda](https://github.com/Naktibalda)**. See [#4076](https://github.com/Codeception/Codeception/issues/4076) Fixes [#4073](https://github.com/Codeception/Codeception/issues/4073)
15+
* Run a suite by its path [#4079](https://github.com/Codeception/Codeception/issues/4079)
16+
17+
```
18+
codecept run tests/unit
19+
```
20+
Improves recent [PHPStorm integration](https://blog.jetbrains.com/phpstorm/2017/03/codeception-support-comes-to-phpstorm-2017-1/). Codeception tests can be started by running a suite directory.
21+
22+
* **[WebDriver]** Fixed using `performOn` with `ActionSequence`; supporting multiple actions of same kind. [#4066](https://github.com/Codeception/Codeception/issues/4066) by **[davertmik](https://github.com/davertmik)**. Fixes [#4044](https://github.com/Codeception/Codeception/issues/4044)
23+
* **[Laravel5]** Added `haveApplicationHandler` and `clearApplicationHandlers` methods. See [#4068](https://github.com/Codeception/Codeception/issues/4068). By **[janhenkgerritsen](https://github.com/janhenkgerritsen)**
24+
* **[Laravel5]** Close all Laravel DB connections after test execution. Fixes [#4031](https://github.com/Codeception/Codeception/issues/4031) by **[rmblstrp](https://github.com/rmblstrp)**
25+
* **[Laravel5]** Update Laravel5 `database_migrations_path` to by null by default by **[timbroder](https://github.com/timbroder)**. Fixes [#3990](https://github.com/Codeception/Codeception/issues/3990)
26+
* **[DataFactory]** Add `cleanup` option to skip auto cleanup. By **[alexpts](https://github.com/alexpts)**. See [#3996](https://github.com/Codeception/Codeception/issues/3996)
27+
* Fixed printScenarioFail with multiple feature scenarios by **[gimler](https://github.com/gimler)**. See [#3868](https://github.com/Codeception/Codeception/issues/3868)
28+
* Fixed generating JUnit XML when Selenium server can’t be connected. Closes [#3653](https://github.com/Codeception/Codeception/issues/3653) by **[Naktibalda](https://github.com/Naktibalda)**
29+
* Fixes running local suites (under tests folder) and included suite mixed (via include path). See [#4063](https://github.com/Codeception/Codeception/issues/4063)
30+
* **[Db]** Run the last statement in dump file even if it doesn't end with delimiter. [#4071](https://github.com/Codeception/Codeception/issues/4071) by **[Naktibalda](https://github.com/Naktibalda)**. Fixes [#4059](https://github.com/Codeception/Codeception/issues/4059)
31+
* **[Memcache]** Fixed calling flush on null by **[Jurigag](https://github.com/Jurigag)**. See [#4074](https://github.com/Codeception/Codeception/issues/4074)
32+
* **[Yii2]** Fixtures behavior compatibility with `yii2-codeception` by **[leandrogehlen](https://github.com/leandrogehlen)**. See [#4016](https://github.com/Codeception/Codeception/issues/4016)
33+
* `g:suite` allows generate suites with uppercase names. Fixes [#4072](https://github.com/Codeception/Codeception/issues/4072)
34+
* Enabled incomplete/skipped/risky/warning settings for logger. See [#3890](https://github.com/Codeception/Codeception/issues/3890). By **[mario](https://github.com/mario)**-naether
35+
36+
```yaml
37+
settings:
38+
report_useless_tests: false
39+
disallow_test_output: false
40+
be_strict_about_changes_to_global_state: false
41+
log_incomplete_skipped: false
42+
```
43+
* **[WebDriver]** Fixed double coverage cookie check by **[boboldehampsink](https://github.com/boboldehampsink)**. See [#2923](https://github.com/Codeception/Codeception/issues/2923) [#4020](https://github.com/Codeception/Codeception/issues/4020)
44+
* **[WebDriver]** Fixed `switchToIframe` regression from 2.2.9 by **[lcobucci](https://github.com/lcobucci)**. PR [#4000](https://github.com/Codeception/Codeception/issues/4000)
45+
* Speed improvement for group lookup by **[pitpit](https://github.com/pitpit)**. See [#4025](https://github.com/Codeception/Codeception/issues/4025)
46+
* Added parse error to `TestParseException` in PHP7 by **[Naktibalda](https://github.com/Naktibalda)**. See [#4007](https://github.com/Codeception/Codeception/issues/4007)
47+
* Auto injection for `Codeception\Test\Unit` format [#4070](https://github.com/Codeception/Codeception/issues/4070). Allows to customize injection of support objects into a testcase:
48+
49+
```php
50+
<?php
51+
public function _inject(UnitTester $unit)
52+
{
53+
$this->i = $unit;
54+
}
55+
```
56+
1057
#### 2.2.9
1158

1259
* **[Laravel5]** **Laravel 5.4 support** by **[janhenkgerritsen](https://github.com/janhenkgerritsen)**
13-
* **[WebDriver]** Added [performOn](http://codeception.com/docs/modules/WebDriver#performOn) method to wait for an element and run sequence of actions inside it. [#3986](https://github.com/Codeception/Codeception/issues/3986)
60+
* **[WebDriver]** Added `performOn` to wait for element, and run actions inside it. See [complete reference](http://codeception.com/docs/modules/WebDriver#performOn). [#3986](https://github.com/Codeception/Codeception/issues/3986)
1461
* **[WebDriver]** Improved error messages for `wait*` methods by **[disc](https://github.com/disc)**. See [#3983](https://github.com/Codeception/Codeception/issues/3983)
1562
* **[REST]** Binary responses support by **[spikyjt](https://github.com/spikyjt)** [#3993](https://github.com/Codeception/Codeception/issues/3993) [#3985](https://github.com/Codeception/Codeception/issues/3985)
16-
* [seeBinaryResponseEquals](http://codeception.com/docs/modules/REST#seeBinaryResponseEquals) assert that binary response matches a hash
17-
* [dontSeeBinaryResponseEquals](http://codeception.com/docs/modules/REST#dontSeeBinaryResponseEquals) assert that binary response doesn't match a hash
63+
* `seeBinaryResponseEquals` assert that binary response matches a hash
64+
* `seeBinaryResponseEquals` assert that binary response doesn't match a hash
1865
* hide binary response on debug
1966
* **[Laravel5]** module fix error for applications that do not use a database. See [#3954](https://github.com/Codeception/Codeception/issues/3954) by **[janhenkgerritsen](https://github.com/janhenkgerritsen)**. Fixed [#3942](https://github.com/Codeception/Codeception/issues/3942)
2067
* **[Laravel5]** database seeders to be executed inside a transaction. See [#3954](https://github.com/Codeception/Codeception/issues/3954) by **[janhenkgerritsen](https://github.com/janhenkgerritsen)**. Fixed [#3948](https://github.com/Codeception/Codeception/issues/3948) by **[janhenkgerritsen](https://github.com/janhenkgerritsen)**
2168
* **[Yii2]** reverted [#3834](https://github.com/Codeception/Codeception/issues/3834), closing transaction after each request. [#3973](https://github.com/Codeception/Codeception/issues/3973) by **[iRipVanWinkle](https://github.com/iRipVanWinkle)**. Fixes [#3961](https://github.com/Codeception/Codeception/issues/3961)
2269
* Added crap4j report support. Use `--coverage-crap4j` option and `codeception/c3` 2.0.10
2370
* [PhpBrowser][Frameworks] If form has no id, use action attribute as identifier by **[Naktibalda](https://github.com/Naktibalda)**. Fixes [#3953](https://github.com/Codeception/Codeception/issues/3953)
2471
* Fixed test coloring output when a Feature title has some special chars in it like `/` or `-`
25-
* **[REST]** Added missing part `json` and `xml` to `deleteHeader` by **[freezy](https://github.com/freezy)**-sk
26-
* **[AMQP]** added `declareExchange`, `declareQueue`, `bindQueueToExchange` methods by **[erikverheij](https://github.com/erikverheij)**. See [#3988](https://github.com/Codeception/Codeception/issues/3988)
72+
* **[REST]** Added missing **[part](https://github.com/part)** `json` and `xml` to `deleteHeader` by **[freezy](https://github.com/freezy)**-sk
2773

2874
#### 2.2.8
2975

3076
* **[WebDriver]** Added tab actions (not supported in PhantomJS):
31-
* [openNewTab](http://codeception.com/docs/modules/WebDriver#openNewTab) opens a new tab and switches to it
32-
* [closeTab](http://codeception.com/docs/modules/WebDriver#closeTab) closes a tab and switches to previous
33-
* [switchToNextTab](http://codeception.com/docs/modules/WebDriver#switchToNextTab) switches to next tab
34-
* [switchToPreviousTab](http://codeception.com/docs/modules/WebDriver#switchToPreviousTab) switches to previous tab
77+
* `openNewTab` opens a new tab and switches to it
78+
* `closeTab` closes a tab and switches to previous
79+
* `switchToNextTab` switches to next tab
80+
* `switchToPreviousTab` switches to previous tab
3581
* **[WebDriver]** Added actions to click element by coordinates. Via **[gimler](https://github.com/gimler)**
36-
* [clickWithLeftButton](http://codeception.com/docs/modules/WebDriver#clickWithLeftButton) clicks element with offset
37-
* [clickWithRightButton](http://codeception.com/docs/modules/WebDriver#clickWithRightButton) right clicks on element with offset
82+
* `clickWithLeftButton` clicks element with offset
83+
* `clickWithRightButton` right clicks on element with offset
3884
* **[WebDriver]** Added `js_error_logging` option to print JS logs in console and in HTML report by **[ngraf](https://github.com/ngraf)**. See [#3821](https://github.com/Codeception/Codeception/issues/3821)
3985
* **[WebDriver]** Improvements to `seeInField` by **[gimler](https://github.com/gimler)**. See [#3905](https://github.com/Codeception/Codeception/issues/3905)
4086
* support option text in seeInField not only value
@@ -310,7 +356,6 @@ extensions:
310356
* **[Sequence]** Changed the prefix value. Generated sequences to include id inside a prefix: `sq('user1') => 'user1_876asd8as87a'. Added `prefix` config option.
311357
* Deprecation errors won't fail tests but will be printed.
312358
* Official [Docker image](https://hub.docker.com/r/codeception/codeception/) introduced by **[schmunk42](https://github.com/schmunk42)**
313-
314359
#### 2.1.11
315360

316361
* **[Yii1]** Improved Yii connector. AR metadata is cleaned up between requests. `regenerateId` of session is disabled.
@@ -566,9 +611,7 @@ extensions:
566611
* Official extensions moved to `ext` dir; Base Extension class renamed to `Codeception\Extension`
567612
* Duplicate environment options won't cause Codeception to run environment tests twice
568613
* **[Phalcon1]** `haveServiceInDi` method implemented by **[sergeyklay](https://github.com/sergeyklay)**
569-
* **[Db]** `seeNumRecords` method added by **[sergeyklay](https://github.com/sergeyklay)**
570-
571-
#### 2.0.15
614+
* **[Db]** `seeNumRecords` method added by **[sergeyklay](https://github.com/sergeyklay)**#### 2.0.15
572615

573616
* **[Phalcon1]** Fixed getting has more than one field by **[sergeyklay](https://github.com/sergeyklay)** [#2010](https://github.com/Codeception/Codeception/issues/2010).
574617
* [PhpBrowser][Frameworks] Compute relative URIs against the effective request URI when there is a redirect. [#2058](https://github.com/Codeception/Codeception/issues/2058) [#2057](https://github.com/Codeception/Codeception/issues/2057)

docs/07-AdvancedUsage.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,33 @@ groups:
742742
This will load all found `p*` files in `tests/_data` as groups. Group names will be as follows p1,p2,...,pN.
743743

744744

745+
## Shell autocompletion
746+
For bash and zsh shells, you can use autocompletion for your Codeception projects by executing the following in your shell (or add it to your .bashrc/.zshrc):
747+
`{% highlight bash %}
748+
749+
# BASH ~4.x, ZSH
750+
source <([codecept location] _completion --generate-hook --program codecept --use-vendor-bin)
751+
752+
# BASH ~3.x, ZSH
753+
[codecept location] _completion --generate-hook --program codecept --use-vendor-bin | source /dev/stdin
754+
755+
# BASH (any version)
756+
eval $([codecept location] _completion --generate-hook --program codecept --use-vendor-bin)
757+
758+
{% endhighlight %}`
759+
760+
### Explanation
761+
By using the above code in your shell, Codeception will try to autocomplete the following:
762+
* Commands
763+
* Suites
764+
* Test paths
765+
766+
Usage of `-use-vendor-bin` is optional. This option will work for most Codeception projects, where Codeception is located in your `vendor/bin` folder.
767+
But in case you are using a global Codeception installation for example, you wouldn't use this option.
768+
769+
Note that with the `-use-vendor-bin` option, your commands will be completed using the Codeception binary located in your project's root.
770+
Without the option, it will use whatever Codeception binary you originally used to generate the completion script ('codecept location' in the above examples)
771+
745772
## Conclusion
746773

747774
Codeception is a framework which may look simple at first glance

docs/modules/Laravel5.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ at <https://laravel.com/docs/master/upgrade>.
4040
* cleanup: `boolean`, default `true` - all database queries will be run in a transaction,
4141
which will be rolled back at the end of each test.
4242
* run_database_migrations: `boolean`, default `false` - run database migrations before each test.
43-
* database_migrations_path: `string`, default `` - path to the database migrations, relative to the root of the application.
43+
* database_migrations_path: `string`, default `null` - path to the database migrations, relative to the root of the application.
4444
* run_database_seeder: `boolean`, default `false` - run database seeder before each test.
4545
* database_seeder_class: `string`, default `` - database seeder class name.
4646
* environment_file: `string`, default `.env` - the environment file to load for the tests.
@@ -344,6 +344,20 @@ $I->checkOption('#agree');
344344
* `param` $option
345345

346346

347+
#### clearApplicationHandlers
348+
349+
Clear the registered application handlers.
350+
351+
{% highlight php %}
352+
353+
<?php
354+
$I->clearApplicationHandlers();
355+
?>
356+
357+
{% endhighlight %}
358+
359+
360+
347361
#### click
348362

349363
Perform a click on a link or a button, given by a locator.
@@ -1013,6 +1027,24 @@ $I->have('App\User', [], 'admin');
10131027
* `[Part]` orm
10141028

10151029

1030+
#### haveApplicationHandler
1031+
1032+
Register a handler than can be used to modify the Laravel application object after it is initialized.
1033+
The Laravel application object will be passed as an argument to the handler.
1034+
1035+
{% highlight php %}
1036+
1037+
<?php
1038+
$I->haveApplicationHandler(function($app) {
1039+
$app->make('config')->set(['test_value' => '10']);
1040+
});
1041+
?>
1042+
1043+
{% endhighlight %}
1044+
1045+
* `param` $handler
1046+
1047+
10161048
#### haveBinding
10171049

10181050
Add a binding to the Laravel service container.

docs/modules/Redis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ $I->haveInRedis('list', ['riri', 'fifi', 'loulou']);
199199
$I->haveInRedis('set', ['riri', 'fifi', 'loulou']);
200200

201201
// ZSets: $value must be an associative array with scores
202-
$I->haveInRedis('set', ['riri' => 1, 'fifi' => 2, 'loulou' => 3]);
202+
$I->haveInRedis('zset', ['riri' => 1, 'fifi' => 2, 'loulou' => 3]);
203203

204204
// Hashes: $value must be an associative array
205205
$I->haveInRedis('hash', ['obladi' => 'oblada']);

docs/reference/Commands.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ codecept gherkin:steps acceptance
299299

300300

301301

302+
## Completion
303+
304+
305+
302306
## GenerateCest
303307

304308
Generates Cest (scenario-driven object-oriented test) file:

docs/reference/Configuration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ settings:
7171
# This value controls whether PHPUnit attempts to backup global variables
7272
# See https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.backupGlobals
7373
backup_globals: true
74+
75+
# PHPUnit can be strict about tests that do not test anything
76+
# See https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.useless-tests
77+
report_useless_tests: false
78+
79+
# PHPUnit can be strict about output during tests.
80+
# See https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.output-during-test-execution
81+
disallow_test_output: false
82+
83+
# PHPUnit can be strict about tests that manipulate global state.
84+
# See https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.global-state-manipulation
85+
be_strict_about_changes_to_global_state: false
86+
87+
# Log the incomplete and skipped tests into junit report
88+
# See https://phpunit.de/manual/current/en/appendixes.configuration.html
89+
# Section logging > junit
90+
log_incomplete_skipped: false
7491

7592
{% endhighlight %}
7693

docs/reference/Locator.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ As a result the Locator will produce a mixed XPath value that will be used in fi
5050
* `throws` \Exception
5151
* `return` string
5252

53-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L49)
53+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L50)
5454

5555
#### contains()
5656

@@ -95,8 +95,8 @@ Locator::elementAt('table#grind>tr', -2); // previous than last row
9595

9696
{% endhighlight %}
9797

98-
* `param` $element CSS or XPath locator
99-
* `param` $position xpath index
98+
* `param string` $element CSS or XPath locator
99+
* `param int` $position xpath index
100100
* `return` mixed
101101

102102
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L283)
@@ -120,7 +120,7 @@ $I->seeElement(Locator::find('img', ['title' => 'diagram']));
120120
* `param` $attributes
121121
* `return` string
122122

123-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L158)
123+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L159)
124124

125125
#### firstElement()
126126

@@ -163,7 +163,7 @@ $I->see('Log In', Locator::href('/login.php'));
163163
* `param` $url
164164
* `return` string
165165

166-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L78)
166+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L79)
167167

168168
#### humanReadableString()
169169

@@ -194,15 +194,15 @@ Locator::isCSS('//body/p/user') => false
194194
* `param` $selector
195195
* `return` bool
196196

197-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L185)
197+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L186)
198198

199199
#### isClass()
200200

201201
*public static* isClass($class)
202202

203203
Checks that a string is valid CSS class
204204

205-
* `param` $id
205+
* `param` $class
206206
* `return` bool
207207

208208
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L235)
@@ -216,7 +216,7 @@ Checks that a string is valid CSS ID
216216
* `param` $id
217217
* `return` bool
218218

219-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L223)
219+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L224)
220220

221221
#### isXPath()
222222

@@ -236,7 +236,7 @@ Locator::isCSS('//body/p/user') => true
236236
* `param` $locator
237237
* `return` bool
238238

239-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L209)
239+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L210)
240240

241241
#### lastElement()
242242

@@ -278,7 +278,7 @@ $I->seeElement(Locator::option('Male'), '#select-gender');
278278
* `param` $value
279279
* `return` string
280280

281-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L123)
281+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L124)
282282

283283
#### tabIndex()
284284

@@ -303,12 +303,12 @@ $I->click('Login');
303303
* `param` $index
304304
* `return` string
305305

306-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L104)
306+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L105)
307307

308308
#### toXPath()
309309

310310
*protected static* toXPath($selector)
311311

312-
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L128)
312+
[See source](https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Util/Locator.php#L129)
313313

314314
<p>&nbsp;</p><div class="alert alert-warning">Reference is taken from the source code. <a href="https://github.com/Codeception/Codeception/blob/2.2/src//Codeception/Util/Locator.php">Help us to improve documentation. Edit module reference</a></div>

0 commit comments

Comments
 (0)