Skip to content

Commit 6a88b6c

Browse files
committed
auto updated documentation
1 parent bd11523 commit 6a88b6c

File tree

13 files changed

+239
-20
lines changed

13 files changed

+239
-20
lines changed

_includes/extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extensions:
4747
#### Configuration
4848

4949
* `delete_successful` (default: true) - delete records for successfully passed tests (log only failed and errored)
50-
* `module` (default: WebDriver) - which module for screenshots to use. Module should implement `Codeception\Lib\Interfaces\ScreenshotSaver` interface. Currently only WebDriver or any its children can be used.
50+
* `module` (default: WebDriver) - which module for screenshots to use. Module should implement `Codeception\Lib\Interfaces\ScreenshotSaver` interaface. Currently only WebDriver or any its children can be used.
5151

5252
``` yaml
5353
extensions:

_includes/guides.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/04-FunctionalTests">Functional Tests</a></li><li><a href="/docs/05-UnitTests">Unit Tests</a></li><li><a href="/docs/06-ReusingTestCode">Reusing Test Code</a></li><li><a href="/docs/07-AdvancedUsage">Advanced Usage</a></li><li><a href="/docs/08-Customization">Customization</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-WebServices">Web Services</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li><li><a href="/docs/12-ParallelExecution">Parallel Execution</a></li><li><a href="/video">Nettuts+ Video Course</a></li>
1+
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/04-FunctionalTests">Functional Tests</a></li><li><a href="/docs/05-UnitTests">Unit Tests</a></li><li><a href="/docs/06-ReusingTestCode">Reusing Test Code</a></li><li><a href="/docs/07-AdvancedUsage">Advanced Usage</a></li><li><a href="/docs/08-Customization">Customization</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-WebServices">Web Services</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li><li><a href="/docs/12-ParallelExecution">Parallel Execution</a></li>

_includes/reference.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/install">Installation</a></li><li><a href="/changelog">Changelog</a></li><li role="separator" class="divider"></li><li><a href="/docs/reference/Autoload">Autoload</a></li><li><a href="/docs/reference/Commands">Commands</a></li><li><a href="/docs/reference/Configuration">Configuration</a></li><li><a href="/docs/reference/Fixtures">Fixtures</a></li><li><a href="/docs/reference/Functions">Functions</a></li><li><a href="/docs/reference/JsonType">JsonType</a></li><li><a href="/docs/reference/Locator">Locator</a></li><li><a href="/docs/reference/Stub">Stub</a></li><li><a href="/docs/reference/XmlBuilder">XmlBuilder</a></li>
1+
<li><a href="/docs/reference/Autoload">Autoload</a></li><li><a href="/docs/reference/Commands">Commands</a></li><li><a href="/docs/reference/Configuration">Configuration</a></li><li><a href="/docs/reference/Fixtures">Fixtures</a></li><li><a href="/docs/reference/Functions">Functions</a></li><li><a href="/docs/reference/JsonType">JsonType</a></li><li><a href="/docs/reference/Locator">Locator</a></li><li><a href="/docs/reference/Stub">Stub</a></li><li><a href="/docs/reference/XmlBuilder">XmlBuilder</a></li>

changelog.markdown

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ title: Codeception Changelog
77

88
# Changelog
99

10+
#### 2.1.8
11+
12+
* `Util\Locator` added methods to create locators to match element at their position: `elementAt`, `firstElement`, `lastElement`
13+
* <strong>[Symfony]</strong> Refactor to unify service retrieval, avoid memleaks and reduce memory footprint. Closes <a href="https://github.com/Codeception/Codeception/issues/2938">#2938</a> and <a href="https://github.com/Codeception/Codeception/issues/2954">#2954</a>.
14+
* <strong>[Symfony]</strong> New optoin `rebootable_client` that reboots client's kernel before each request.
15+
* <strong>[WebDriver]</strong> fixed `seeInField` for textarea with whitespaces before and after string. Closes <a href="https://github.com/Codeception/Codeception/issues/2921">#2921</a>
16+
* <strong>[Symfony]</strong> Deprecated `grabServiceFromContainer` use `grabService` instead. For consistency with other frameworks.
17+
* <strong>[Asserts]</strong> More `assert*` methods from PHPUnit added
18+
* <strong>[Asserts]</strong> Added `expectException` method
19+
* `codecept self-update` works with proxy by <strong><a href="https://github.com/gr1ev0us">@gr1ev0us</a></strong>
20+
* [Phalcon1 add params support for method amOnRoute by <strong><a href="https://github.com/MelnykDmitro">@MelnykDmitro</a></strong>
21+
1022
#### 2.1.7
1123

1224
* **PHPUnit 5.x support**

docs/02-GettingStarted.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Let's take a look at Codeception's architecture. We assume that you already [ins
1111

1212
One of the main concepts of Codeception is representation of tests as actions of a person. We have a UnitTester, who executes functions and tests the code. We also have a FunctionalTester, a qualified tester, who tests the application as a whole, with knowledge of its internals. And an AcceptanceTester, a user that works with our application through an interface that we provide.
1313

14-
Actor classes are not written but generated from suite configuration. **Methods of actor classes are generally taken from Codeception Modules**. Each module provides predefined actions for different testing purposes, and they can be combined to fit the testing environment. Codeception tries to solve 90% of possible testing issues in its modules, so you don't have to reinvent the wheel. We think that you can spend more time on writing tests and less on writing support code to make those tests run. By default AcceptanceTester relies on PhpBrowser module, which is set in `tests/acceptance.suite.yml` configuration file:
14+
Actor classes are not written but generated from suite configuration. **Methods of actor classes are generally taken from Codeception Modules**. Each module provides predefined actions for different testing purposes, and they can be combined to fit the testing environment. Codeception tries to solve 90% of possible testing issues in its modules, so you don't have reinvent the wheel. We think that you can spend more time on writing tests and less on writing support code to make those tests run. By default AcceptanceTester relies on PhpBrowser module, which is set in `tests/acceptance.suite.yml` configuration file:
1515

1616
{% highlight yaml %}
1717

@@ -312,4 +312,4 @@ We took a look into the Codeception structure. Most of the things you need were
312312

313313

314314
* **Next Chapter: [AcceptanceTests >](/docs/03-AcceptanceTests)**
315-
* **Previous Chapter: [< Introduction](/docs/01-Introduction)**
315+
* **Previous Chapter: [< Introduction](/docs/01-Introduction)**

docs/05-UnitTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ modules:
375375
<div class="alert alert-info">
376376
It may look like Cest format is too simple for writing tests. It doesn't provide assertion methods,
377377
methods to create mocks and stubs or even accessing the module with `getModule`, as we did in example above.
378-
However Cest format is better at separating concerns. Test code does not interfere with support code, provided by `UnitTester` object. All additional actions you may need in your unit/integration tests you can implement in `Helper\Unit` class. This is the recommended approach, and allows keeping tests verbose and clean.
378+
However Cest format is better at separating concerns. Test code does not interfere with support code, provided by `UnitTester` object. All additional actions you may need in your unit/integration tests you can implement in `Helper\Unit` class.
379379
</div>
380380

381381

docs/06-ReusingTestCode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ However, implementing all actions for a reuse in one actor class may lead to bre
117117
## StepObjects
118118

119119
If `login` method defined in Actor class may be used in 90% of your tests,
120-
StepObjects are great if you need some common functionality for a group of tests. Let's say you are going to test and admin area of a site. Probably you won't need the same actions from admin area while testing the frontend, so it's a good idea to move those admin-specific into their own class. We will call such class a StepObject.
120+
StepObjects are great if you need some common functionality for a group of tests. Let's say you are going to test an admin area of a site. Probably, you won't need the same actions from admin area while testing the frontend, so it's a good idea to move those admin-specific into their own class. We will call such class a StepObject.
121121

122122
Lets create an Admin StepObject with generator, by specifying test suite, and passing method expected names on prompt.
123123

@@ -217,7 +217,7 @@ If you have complex interaction scenario you may use several step objects in one
217217
## PageObjects
218218

219219
For acceptance and functional testing we will need not only to have common actions to be reused across different tests, we should have buttons, links, and form fields to be reused as well. For those cases we need to implement
220-
[PageObject pattern](http://code.google.com/p/selenium/wiki/PageObjects), which is widely used by test automation engineers. The PageObject pattern represents a web page as a class and the DOM elements on that page as its properties, and some basic interactions as its methods.
220+
[PageObject pattern](http://docs.seleniumhq.org/docs/06_test_design_considerations.jsp#page-object-design-pattern), which is widely used by test automation engineers. The PageObject pattern represents a web page as a class and the DOM elements on that page as its properties, and some basic interactions as its methods.
221221
PageObjects are very important when you are developing a flexible architecture of your tests. Please do not hardcode complex CSS or XPath locators in your tests but rather move them into PageObject classes.
222222

223223
Codeception can generate a PageObject class for you with command:

docs/modules/Asserts.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ title: Asserts - Codeception - Documentation
1313
Special module for using asserts in your tests.
1414

1515

16+
#### assertArrayHasKey
17+
18+
* `param` $key
19+
* `param` $actual
20+
* `param` $description
21+
22+
23+
#### assertArrayNotHasKey
24+
25+
* `param` $key
26+
* `param` $actual
27+
* `param` $description
28+
29+
1630
#### assertContains
1731

1832
Checks that haystack contains needle
@@ -63,6 +77,13 @@ Checks if file doesn't exist
6377
* `param string` $message
6478

6579

80+
#### assertGreaterOrEquals
81+
82+
* `param` $expected
83+
* `param` $actual
84+
* `param` $description
85+
86+
6687
#### assertGreaterThan
6788

6889
Checks that actual is greater than expected
@@ -91,6 +112,33 @@ Checks that actual is greater or equal than expected
91112
* `deprecated`
92113

93114

115+
#### assertInstanceOf
116+
117+
* `param` $class
118+
* `param` $actual
119+
* `param` $description
120+
121+
122+
#### assertInternalType
123+
124+
* `param` $type
125+
* `param` $actual
126+
* `param` $description
127+
128+
129+
#### assertIsEmpty
130+
131+
* `param` $actual
132+
* `param` $description
133+
134+
135+
#### assertLessOrEquals
136+
137+
* `param` $expected
138+
* `param` $actual
139+
* `param` $description
140+
141+
94142
#### assertLessThan
95143

96144
Checks that actual is less than expected
@@ -135,6 +183,13 @@ Checks that two variables are not equal
135183
* `param string` $message
136184

137185

186+
#### assertNotInstanceOf
187+
188+
* `param` $class
189+
* `param` $actual
190+
* `param` $description
191+
192+
138193
#### assertNotNull
139194

140195
Checks that variable is not NULL
@@ -185,6 +240,7 @@ Checks that two variables are same
185240
* `param` $expected
186241
* `param` $actual
187242
* `param string` $message
243+
* `return` mixed|void
188244

189245

190246
#### assertTrue
@@ -195,6 +251,38 @@ Checks that condition is positive.
195251
* `param string` $message
196252

197253

254+
#### expectException
255+
256+
Handles and checks exception called inside callback function.
257+
Either exception class name or exception instance should be provided.
258+
259+
{% highlight php %}
260+
261+
<?php
262+
$I->expectException(MyException::class, function() {
263+
$this->doSomethingBad();
264+
});
265+
266+
$I->expectException(new MyException(), function() {
267+
$this->doSomethingBad();
268+
});
269+
270+
{% endhighlight %}
271+
If you want to check message or exception code, you can pass them with exception instance:
272+
{% highlight php %}
273+
274+
<?php
275+
// will check that exception MyException is thrown with "Don't do bad things" message
276+
$I->expectException(new MyException("Don't do bad things"), function() {
277+
$this->doSomethingBad();
278+
});
279+
280+
{% endhighlight %}
281+
282+
* `param` $exception string or \Exception
283+
* `param` $callback
284+
285+
198286
#### fail
199287

200288
Fails the test with message.

docs/modules/SOAP.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ If you use PHP SoapServer with framework, try to block call to this method in te
3535

3636
### Public Properties
3737

38-
* request - last soap request (DOMDocument)
39-
* response - last soap response (DOMDocument)
38+
* xmlRequest - last SOAP request (DOMDocument)
39+
* xmlResponse - last SOAP response (DOMDocument)
4040

4141

4242

@@ -151,7 +151,6 @@ Example:
151151

152152
<?php
153153
154-
$I->seeResponseContains("<user><query>CreateUser<name>Davert</davert></user>");
155154
$I->seeSoapResponseContainsStructure("<query><name></name></query>");
156155
?>
157156

@@ -240,8 +239,8 @@ Example:
240239

241240
{% highlight php %}
242241

243-
$I->sendRequest('UpdateUser', '<user><id>1</id><name>notdavert</name></user>');
244-
$I->sendRequest('UpdateUser', \Codeception\Utils\Soap::request()->user
242+
$I->sendSoapRequest('UpdateUser', '<user><id>1</id><name>notdavert</name></user>');
243+
$I->sendSoapRequest('UpdateUser', \Codeception\Utils\Soap::request()->user
245244
->id->val(1)->parent()
246245
->name->val('notdavert');
247246

docs/modules/Symfony2.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ This module uses Symfony2 Crawler and HttpKernel to emulate requests and test re
2929
* environment: 'local' - environment used for load kernel
3030
* debug: true - turn on/off debug mode
3131
* em_service: 'doctrine.orm.entity_manager' - use the stated EntityManager to pair with Doctrine Module.
32-
* cache_router: 'false' - enable router caching between tests in order to [increase performance](http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire)
32+
* cache_router: 'false' - enable router caching between tests in order to [increase performance](http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire)
33+
* rebootable_client: 'true' - reboot client's kernel before each request
3334

3435
#### Example (`functional.suite.yml`) - Symfony 2.x Directory Structure
3536

@@ -48,7 +49,8 @@ This module uses Symfony2 Crawler and HttpKernel to emulate requests and test re
4849
* environment: 'local' - environment used for load kernel
4950
* em_service: 'doctrine.orm.entity_manager' - use the stated EntityManager to pair with Doctrine Module.
5051
* debug: true - turn on/off debug mode
51-
* cache_router: 'false' - enable router caching between tests in order to [increase performance](http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire)
52+
* cache_router: 'false' - enable router caching between tests in order to [increase performance](http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire)
53+
* rebootable_client: 'true' - reboot client's kernel before each request
5254

5355
#### Example (`functional.suite.yml`) - Symfony 3 Directory Structure
5456

@@ -64,11 +66,10 @@ This module uses Symfony2 Crawler and HttpKernel to emulate requests and test re
6466

6567
* kernel - HttpKernel instance
6668
* client - current Crawler instance
67-
* container - dependency injection container instance
6869

6970
### Parts
7071

71-
* services - allows to use Symfony2 DIC only with WebDriver or PhpBrowser modules.
72+
* services - allows to use Symfony2 DIC only with WebDriver or PhpBrowser modules.
7273

7374
Usage example:
7475

@@ -87,6 +88,9 @@ modules:
8788

8889
{% endhighlight %}
8990

91+
@property-read ContainerInterface $container
92+
93+
9094

9195
#### _findElements
9296

@@ -673,6 +677,23 @@ $aLinks = $I->grabMultiple('a', 'href');
673677
* `return` string[]
674678

675679

680+
#### grabService
681+
682+
Grabs a service from Symfony DIC container.
683+
Recommended to use for unit testing.
684+
685+
{% highlight php %}
686+
687+
<?php
688+
$em = $I->grabService('doctrine');
689+
?>
690+
691+
{% endhighlight %}
692+
693+
* `param` $service
694+
* `[Part]` services
695+
696+
676697
#### grabServiceFromContainer
677698

678699
Grabs a service from Symfony DIC container.
@@ -688,6 +709,7 @@ $em = $I->grabServiceFromContainer('doctrine');
688709

689710
* `param` $service
690711
* `[Part]` services
712+
* `deprecated` Use grabService instead
691713

692714

693715
#### grabTextFrom
@@ -728,6 +750,37 @@ Moves back in history.
728750
* `param int` $numberOfSteps (default value 1)
729751

730752

753+
#### persistService
754+
755+
Get service $serviceName and add it to the lists of persistent services.
756+
If $isPermanent then service becomes persistent between tests
757+
758+
* `param string` $serviceName
759+
* `param boolean` $isPermanent
760+
761+
762+
#### rebootClientKernel
763+
764+
Reboot client's kernel.
765+
Can be used to manually reboot kernel when 'rebootable_client' => false
766+
767+
{% highlight php %}
768+
769+
<?php
770+
...
771+
perform some requests
772+
...
773+
$I->rebootClientKernel();
774+
...
775+
perform other requests
776+
...
777+
778+
?>
779+
780+
{% endhighlight %}
781+
782+
783+
731784
#### resetCookie
732785

733786
Unsets cookie with the given name.
@@ -1440,4 +1493,11 @@ $I->uncheckOption('#notify');
14401493
14411494
* `param` $option
14421495
1496+
1497+
#### unpersistService
1498+
1499+
Remove service $serviceName from the lists of persistent services.
1500+
1501+
* `param string` $serviceName
1502+
14431503
<p>&nbsp;</p><div class="alert alert-warning">Module reference is taken from the source code. <a href="https://github.com/Codeception/Codeception/tree/2.1/src/Codeception/Module/Symfony2.php">Help us to improve documentation. Edit module reference</a></div>

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