Skip to content

Commit fed39e9

Browse files
committed
auto updated documentation
1 parent 1e33583 commit fed39e9

21 files changed

+450
-24
lines changed

changelog.markdown

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ title: Codeception Changelog
77

88
# Changelog
99

10+
#### 2.4.3
11+
12+
* [Create your own test formats](https://codeception.com/docs/07-AdvancedUsage#Formats) (e.g., Cept, Cest, ...); by **[mlambley](https://github.com/mlambley)**
13+
* **[Symfony]** Fixed a bug in order to use multiple Kernels; by **[alefcastelo](https://github.com/alefcastelo)**
14+
* **[Asserts]** Added new methods `assertNotTrue` and `assertNotFalse` methods; by **[johannesschobel](https://github.com/johannesschobel)**
15+
* [REST][PhpBrowser][Frameworks] Added new methods to check for `Http Status Ranges` with nice "wrappers" (e.g., `seeHttpStatusCodeIsSuccessful()` checks the code between 200 and 299); by **[johannesschobel](https://github.com/johannesschobel)**
16+
* Improved the docs; by community
17+
1018
#### 2.4.2
1119

1220
* Added support for `extends` in the `codeception.yml` and `*.suite.yml` files; by **[johannesschobel](https://github.com/johannesschobel)**.
1321
Allows to inherit current config from a provided file. See example for `functional.suite.yml`:
1422

15-
1623
```yml
1724
actor: FunctionalTester
1825
extends: shared.functional.suite.yml

docs/03-AcceptanceTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ and you want to check that the user can log into the site using this password:
336336
{% highlight php %}
337337

338338
<?php
339-
$I->fillField('email', 'miles@davis.com')
339+
$I->fillField('email', 'miles@davis.com');
340340
$I->click('Generate Password');
341341
$password = $I->grabTextFrom('#password');
342342
$I->click('Login');

docs/06-ModulesAndHelpers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ Here is how it is done in the Db module:
397397
class Db extends \Codeception\Module
398398
{
399399
protected $requiredFields = ['dsn', 'user', 'password'];
400+
// ...
401+
}
400402
401403
{% endhighlight %}
402404
@@ -412,6 +414,8 @@ class WebDriver extends \Codeception\Module
412414
{
413415
protected $requiredFields = ['browser', 'url'];
414416
protected $config = ['host' => '127.0.0.1', 'port' => '4444'];
417+
// ...
418+
}
415419

416420
{% endhighlight %}
417421

docs/06-ReusingTestCode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ breaking the [Single Responsibility Principle](http://en.wikipedia.org/wiki/Sing
121121

122122
### Session Snapshot
123123

124-
If you need to authorize a user for each test, you can do so by submiting the login form at the beginning of every test.
124+
If you need to authorize a user for each test, you can do so by submitting the login form at the beginning of every test.
125125
Running those steps takes time, and in the case of Selenium tests (which are slow by themselves)
126126
that time loss can become significant.
127127

@@ -266,7 +266,7 @@ the [PageObject pattern](http://docs.seleniumhq.org/docs/06_test_design_consider
266266
which is widely used by test automation engineers. The PageObject pattern represents a web page as a class
267267
and the DOM elements on that page as its properties, and some basic interactions as its methods.
268268
PageObjects are very important when you are developing a flexible architecture of your tests.
269-
Do not hardcode complex CSS or XPath locators in your tests but rather move them into PageObject classes.
269+
Do not hard-code complex CSS or XPath locators in your tests but rather move them into PageObject classes.
270270

271271
Codeception can generate a PageObject class for you with command:
272272

docs/07-AdvancedUsage.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public function myTest(\AcceptanceTester $I, \Codeception\Scenario $scenario)
548548

549549
{% endhighlight %}
550550

551-
`Codeception\Scenario` is also availble in Actor classes and StepObjects. You can access it with `$this->getScenario()`.
551+
`Codeception\Scenario` is also available in Actor classes and StepObjects. You can access it with `$this->getScenario()`.
552552

553553
### Dependencies
554554

@@ -739,9 +739,57 @@ groups:
739739

740740
This will load all found `p*` files in `tests/_data` as groups. Group names will be as follows p1,p2,...,pN.
741741

742-
## Shell autocompletion
742+
## Formats
743743

744-
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):
744+
In addition to the standard test formats (Cept, Cest, Unit, Gherkin) you can implement your own format classes to customise your test execution.
745+
Specify these in your suite configuration:
746+
747+
{% highlight yaml %}
748+
749+
formats:
750+
- \My\Namespace\MyFormat
751+
752+
{% endhighlight %}
753+
754+
Then define a class which implements the LoaderInterface
755+
756+
{% highlight php %}
757+
758+
namespace My\Namespace;
759+
760+
class MyFormat implements \Codeception\Test\Loader\LoaderInterface
761+
{
762+
protected $tests;
763+
764+
protected $settings;
765+
766+
public function __construct($settings = [])
767+
{
768+
//These are the suite settings
769+
$this->settings = $settings;
770+
}
771+
772+
public function loadTests($filename)
773+
{
774+
//Load file and create tests
775+
}
776+
777+
public function getTests()
778+
{
779+
return $this->tests;
780+
}
781+
782+
public function getPattern()
783+
{
784+
return '~Myformat\.php$~';
785+
}
786+
}
787+
788+
{% endhighlight %}
789+
790+
## Shell auto-completion
791+
792+
For bash and zsh shells, you can use auto-completion for your Codeception projects by executing the following in your shell (or add it to your .bashrc/.zshrc):
745793
{% highlight bash %}
746794

747795
# BASH ~4.x, ZSH

docs/12-ParallelExecution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ $ composer require codeception/codeception
156156

157157
### Preparing Robo
158158

159-
Intitalizes basic RoboFile in the root of your project
159+
Initializes basic RoboFile in the root of your project
160160

161161
{% highlight bash %}
162162

docs/modules/Asserts.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ $I->assertNotEquals($calculator->add(0.1, 0.2), 0.4, 'Calculator should add the
229229
* `param float` $delta
230230

231231

232+
#### assertNotFalse
233+
234+
Checks that the condition is NOT false (everything but false)
235+
236+
* `param` $condition
237+
* `param string` $message
238+
239+
232240
#### assertNotInstanceOf
233241

234242
* `param` $class
@@ -262,6 +270,14 @@ Checks that two variables are not same
262270
* `param string` $message
263271

264272

273+
#### assertNotTrue
274+
275+
Checks that the condition is NOT true (everything but true)
276+
277+
* `param` $condition
278+
* `param string` $message
279+
280+
265281
#### assertNull
266282

267283
Checks that variable is NULL

docs/modules/Laravel5.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,34 @@ $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
17481748
* `param` $code
17491749

17501750

1751+
#### seeResponseCodeIsBetween
1752+
1753+
Checks that response code is between a certain range. Between actually means [from <= CODE <= to]
1754+
1755+
* `param` $from
1756+
* `param` $to
1757+
1758+
1759+
#### seeResponseCodeIsClientError
1760+
1761+
Checks that the response code is 4xx
1762+
1763+
1764+
#### seeResponseCodeIsRedirection
1765+
1766+
Checks that the response code 3xx
1767+
1768+
1769+
#### seeResponseCodeIsServerError
1770+
1771+
Checks that the response code is 5xx
1772+
1773+
1774+
#### seeResponseCodeIsSuccessful
1775+
1776+
Checks that the response code 2xx
1777+
1778+
17511779
#### seeSessionHasValues
17521780

17531781
Assert that the session has a given list of values.

docs/modules/Lumen.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,34 @@ $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
13801380
* `param` $code
13811381

13821382

1383+
#### seeResponseCodeIsBetween
1384+
1385+
Checks that response code is between a certain range. Between actually means [from <= CODE <= to]
1386+
1387+
* `param` $from
1388+
* `param` $to
1389+
1390+
1391+
#### seeResponseCodeIsClientError
1392+
1393+
Checks that the response code is 4xx
1394+
1395+
1396+
#### seeResponseCodeIsRedirection
1397+
1398+
Checks that the response code 3xx
1399+
1400+
1401+
#### seeResponseCodeIsServerError
1402+
1403+
Checks that the response code is 5xx
1404+
1405+
1406+
#### seeResponseCodeIsSuccessful
1407+
1408+
Checks that the response code 2xx
1409+
1410+
13831411
#### selectOption
13841412

13851413
Selects an option in a select tag or in radio button group.

docs/modules/Phalcon.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,34 @@ $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
13031303
* `param` $code
13041304

13051305

1306+
#### seeResponseCodeIsBetween
1307+
1308+
Checks that response code is between a certain range. Between actually means [from <= CODE <= to]
1309+
1310+
* `param` $from
1311+
* `param` $to
1312+
1313+
1314+
#### seeResponseCodeIsClientError
1315+
1316+
Checks that the response code is 4xx
1317+
1318+
1319+
#### seeResponseCodeIsRedirection
1320+
1321+
Checks that the response code 3xx
1322+
1323+
1324+
#### seeResponseCodeIsServerError
1325+
1326+
Checks that the response code is 5xx
1327+
1328+
1329+
#### seeResponseCodeIsSuccessful
1330+
1331+
Checks that the response code 2xx
1332+
1333+
13061334
#### seeSessionHasValues
13071335

13081336
Assert that the session has a given list of values.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy