Skip to content

Commit 1fd4066

Browse files
author
Davert
committed
Merge branch 'master' of github.com:Codeception/codeception.github.com
2 parents ca05186 + efff88d commit 1fd4066

12 files changed

+801
-30
lines changed

_includes/modules.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Selenium">Selenium</a></li><li><a href="/docs/modules/Selenium2">Selenium2</a></li><li><a href="/docs/modules/SocialEngine">SocialEngine</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Unit">Unit</a></li><li><a href="/docs/modules/WebDebug">WebDebug</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/ZombieJS">ZombieJS</a></li>
1+
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Selenium">Selenium</a></li><li><a href="/docs/modules/Selenium2">Selenium2</a></li><li><a href="/docs/modules/SocialEngine">SocialEngine</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Unit">Unit</a></li><li><a href="/docs/modules/WebDebug">WebDebug</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li><li><a href="/docs/modules/ZombieJS">ZombieJS</a></li>

codecept.phar

3.12 KB
Binary file not shown.

docs/11-Codecoverage.markdown

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ title: Codeception - Documentation
66
## Code Coverage
77

88
At some point you want to review which parts of your application are tested well and which are not.
9-
Just for this case the [CodeCoverage](http://en.wikipedia.org/wiki/Code_coverage) is used. When you execute your tests to collect coverage report,
9+
Just for this case the [CodeCoverage](http://en.wikipedia.org/wiki/Code_coverage) is used. When you execute your tests to collect coverage report,
1010
you will receive statistics of all classes, methods, and lines triggered by these tests.
1111
The ratio between all lines in script and all touched lines is a main coverage criteria. In the ideal world you should get a 100% code coverage,
12-
but in reality 80% are just enough. And even 100% code coverage rate doesn't save you from fatal errors and crashes.
12+
but in reality 80% are just enough. And even 100% code coverage rate doesn't save you from fatal errors and crashes.
1313

1414
**Codeception has CodeCoverage tools since 1.5. To collect coverage information `xdebug` is required**.
1515

1616
![Code Coverage Example](http://codeception.com/images/coverage.png)
1717

18-
Coverage data can be collected manually for local tests and remote tests. Remote tests may be executed on different node,
18+
Coverage data can be collected manually for local tests and remote tests. Remote tests may be executed on different node,
1919
or locally, but behind the web server. It may look hard to collect code coverage for Selenium tests or PhpBrowser tests. But Codeception
2020
supports remote codecoverage as well as local.
2121

@@ -24,7 +24,7 @@ supports remote codecoverage as well as local.
2424
To enable codecoverge put these lines to the global configuration file `codeception.yml`:
2525

2626
{% highlight yaml %}
27-
yml
27+
yaml
2828
coverage:
2929
enabled: true
3030

@@ -33,20 +33,20 @@ coverage:
3333
that's ok for now. But what files should be present in final coverage report? You can filter files by providing blacklist and whitelist filters.
3434

3535
{% highlight yaml %}
36-
yml
36+
yaml
3737
coverage:
3838
enabled: true
3939
whitelist:
4040
include:
41-
- app/*
41+
- app/*
4242
exclude:
4343
- app/cache/*
4444
blacklist:
4545
include:
4646
- app/controllers/*
4747
exclude:
4848
- app/cache/CacheProvider.php
49-
49+
5050

5151
{% endhighlight %}
5252
What are whitelists and blacklists?
@@ -60,7 +60,7 @@ Also you can use '*' mask in a file name, i.e. `app/models/*Model.php` to match
6060
There is a shortcut if you don't need that complex filters:
6161

6262
{% highlight yaml %}
63-
63+
yaml
6464
coverage:
6565
enabled: true
6666
include:
@@ -72,7 +72,7 @@ coverage:
7272

7373
These `include` and `exclude` options are to add or remove files from a whitelist.
7474

75-
All these settings can be redefined for each suite in their config files.
75+
All these settings can be redefined for each suite in their config files.
7676

7777
## Local CodeCoverage
7878

@@ -82,7 +82,7 @@ All you need is to execute codeception with `--coverage` option.
8282
To generate a clover xml report or a tasty html report append also `--xml` and `--html` options.
8383

8484
{% highlight yaml %}
85-
85+
yaml
8686
codecept run --coverage --xml --html
8787

8888
{% endhighlight %}
@@ -92,50 +92,48 @@ XML clover reports are used by IDEs (like PHPStorm) or Continuous Integration se
9292

9393
## Remote CodeCoverage
9494

95-
If you run your application via Webserver (Apache, Nginx, PHP WebServer) you don't have a direct access to tested code,
96-
so collecting coverage becomes a non-trivial task. The same goes to scripts that are tested on different node.
97-
To get access to this code you need `xdebug` installed with `remote_enable` option turned on.
98-
Codeception also requires a little spy to interact with your application. As your application run standalone,
95+
If you run your application via Webserver (Apache, Nginx, PHP WebServer) you don't have a direct access to tested code,
96+
so collecting coverage becomes a non-trivial task. The same goes to scripts that are tested on different node.
97+
To get access to this code you need `xdebug` installed with `remote_enable` option turned on.
98+
Codeception also requires a little spy to interact with your application. As your application run standalone,
9999
without even knowing it is being tested, a small file should be included in order to collect coverage info.
100100

101-
This file is called `c3.php` and is [available on GitHub](https://github.com/Codeception/c3).
102-
`c3.php` should be downloaded and included in your application in a very first line of it's from controller.
101+
This file is called `c3.php` and is [available on GitHub](https://github.com/Codeception/c3).
102+
`c3.php` should be downloaded and included in your application in a very first line of it's from controller.
103103
By sending special headers Codeception will command your application when to start codecoverage collection and when to stop it.
104-
After the suite is finished, a report will be stored and Codeception will grab it from your application.
104+
After the suite is finished, a report will be stored and Codeception will grab it from your application.
105105

106106
Please, follow installation instructions described in a [readme file](https://github.com/Codeception/c3).
107107

108-
After the `c3.php` file is included in application you can start gather coverage.
108+
After the `c3.php` file is included in application you can start gather coverage.
109109
In case you execute your application locally there is nothing to be changed in config.
110110
All codecoverage reports will be collected as usual and merged afterwards.
111-
Think of it: Codeception runs remote coverage in the same way as local.
111+
Think of it: Codeception runs remote coverage in the same way as local.
112112

113113
It's never been easier to setup remote codecoverage for your application. In ay other framework. Really.
114114

115115
But if you run tests on different server (or your webserver doesn't use code from current directory) a single option `remote` should be added to config.
116116
For example, let's turn on remote coverage for acceptance suite in `acceptance.suite.yml`
117117

118118
{% highlight yaml %}
119-
119+
yaml
120120
coverage:
121121
enabled: true
122122
remote: true
123123

124124
{% endhighlight %}
125125

126-
In this case remote Code Coverage results won't be merged with local ones if this option is enabled.
127-
Merging is possible only in case a remote and local file have th same path.
126+
In this case remote Code Coverage results won't be merged with local ones if this option is enabled.
127+
Merging is possible only in case a remote and local file have th same path.
128128
But in case of running tests on a remote server we are not sure of it.
129129

130130
## Conclusion
131131

132132
It's never been easier to setup local and remote code coverage. Just one config and one additional file to include!
133-
**With Codeception you can easily generate CodeCoverage reports for your Selenium tests** (or other acceptance or api tests). Mixing reports for `acceptance`, `functional`, and `unit` suites provides
133+
**With Codeception you can easily generate CodeCoverage reports for your Selenium tests** (or other acceptance or api tests). Mixing reports for `acceptance`, `functional`, and `unit` suites provides
134134
you the most complete information on which parts of your applications are tested and which are not.
135135

136136

137137

138138

139-
140-
141139
* **Previous Chapter: [< WebServices](/docs/10-WebServices)**

docs/modules/AMQP.markdown

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Use it to cleanup the queue between tests.
4444
### Public Properties
4545

4646
* connection - AMQPConnection - current connection
47-
* channel - AMQPChannel - current channel
4847

4948
* available since version 1.1.2
5049
* author tiger.seo@gmail.com

docs/modules/Kohana.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ Module is created by [Nikita Groshin](nike-17@ya.ru)
3131
### Actions
3232

3333

34+
#### amHttpAuthenticated
35+
36+
37+
Adds HTTP authentication via username/password.
38+
39+
* param $username
40+
* param $password
41+
42+
3443
#### amOnPage
3544

3645

docs/modules/PhpBrowser.markdown

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: Codeception - Documentation
88

99

1010
Uses [Mink](http://mink.behat.org) with [Goutte](https://github.com/fabpot/Goutte) and [Guzzle](http://guzzlephp.org/) to interact with your application over CURL.
11+
Module works over CURL and requires **PHP CURL extension** to be enabled.
1112

1213
Use to perform web acceptance tests with non-javascript browser.
1314

@@ -17,31 +18,47 @@ If test fails stores last shown page in 'output' dir.
1718

1819
* Maintainer: **davert**
1920
* Stability: **stable**
20-
* Contact: codecept@davert.mail.ua
21-
* relies on [Mink](http://mink.behat.org)
21+
* Contact: davert.codecept@mailican.com
22+
* relies on [Mink](http://mink.behat.org) and [Guzzle](http://guzzlephp.org/)
2223

2324
*Please review the code of non-stable modules and provide patches if you have issues.*
2425

2526
### Configuration
2627

2728
* url *required* - start url of your app
29+
* curl - curl options
2830

2931
#### Example (`acceptance.suite.yml`)
3032

31-
modules:
33+
modules:
3234
enabled: [PhpBrowser]
3335
config:
3436
PhpBrowser:
3537
url: 'http://localhost'
38+
curl:
39+
CURLOPT_RETURNTRANSFER: true
3640

3741
### Public Properties
3842

3943
* session - contains Mink Session
44+
* guzzle - contains [Guzzle](http://guzzlephp.org/) client instance: `\Guzzle\Http\Client`
45+
46+
All SSL certification checks are disabled by default.
47+
To configure CURL options use `curl` config parameter.
4048

4149

4250
### Actions
4351

4452

53+
#### amHttpAuthenticated
54+
55+
56+
Adds HTTP authentication via username/password.
57+
58+
* param $username
59+
* param $password
60+
61+
4562
#### amOnPage
4663

4764

@@ -267,6 +284,37 @@ $I->dontSeeLink('Logout'); // I suppose user is not logged in
267284
* param null $url
268285

269286

287+
#### executeInGuzzle
288+
289+
290+
Low-level API method.
291+
If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly
292+
293+
Example:
294+
295+
{% highlight php %}
296+
297+
<?php
298+
// from the official Guzzle manual
299+
$I->amGoingTo('Sign all requests with OAuth');
300+
$I->executeInGuzzle(function (\Guzzle\Http\Client $client) {
301+
$client->addSubscriber(new Guzzle\Plugin\Oauth\OauthPlugin(array(
302+
'consumer_key' => '***',
303+
'consumer_secret' => '***',
304+
'token' => '***',
305+
'token_secret' => '***'
306+
)));
307+
});
308+
?>
309+
310+
{% endhighlight %}
311+
312+
Not recommended this command too be used on regular basis.
313+
If Codeception lacks important Guzzle Client methods implement then and submit patches.
314+
315+
* param callable $function
316+
317+
270318
#### fillField
271319

272320

docs/modules/Selenium.markdown

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,27 @@ XPath or CSS selectors are accepted.
320320
* param $el2
321321

322322

323+
#### executeInSelenium
324+
325+
326+
Low-level API method.
327+
If Codeception commands are not enough, use Selenium RC methods directly
328+
329+
{% highlight php %}
330+
331+
$I->executeInSelenium(function(\Selenium\Browser $browser) {
332+
$browser->open('/');
333+
});
334+
335+
{% endhighlight %}
336+
337+
Use [Browser Selenium API](https://github.com/alexandresalome/PHP-Selenium)
338+
Not recommended this command too be used on regular basis.
339+
If Codeception lacks important Selenium methods implement then and submit patches.
340+
341+
* param callable $function
342+
343+
323344
#### executeJs
324345

325346

docs/modules/Selenium2.markdown

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,27 @@ XPath or CSS selectors are accepted.
365365
* param $el2
366366

367367

368+
#### executeInSelenium
369+
370+
371+
Low-level API method.
372+
If Codeception commands are not enough, use Selenium WebDriver methods directly
373+
374+
{% highlight php %}
375+
376+
$I->executeInSelenium(function(\WebDriver\Session $webdriver) {
377+
$webdriver->back();
378+
});
379+
380+
{% endhighlight %}
381+
382+
Use [WebDriver Session API](https://github.com/facebook/php-webdriver)
383+
Not recommended this command too be used on regular basis.
384+
If Codeception lacks important Selenium methods implement then and submit patches.
385+
386+
* param callable $function
387+
388+
368389
#### executeJs
369390

370391

docs/modules/SocialEngine.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ Module is created by [Artem Kovradin](http://tvorzasp.com)
3232
### Actions
3333

3434

35+
#### amHttpAuthenticated
36+
37+
38+
Adds HTTP authentication via username/password.
39+
40+
* param $username
41+
* param $password
42+
43+
3544
#### amOnPage
3645

3746

docs/modules/Yii1.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ Do not forget that after adding module in your functional.suite.yml you must run
7878
### Actions
7979

8080

81+
#### amHttpAuthenticated
82+
83+
84+
Adds HTTP authentication via username/password.
85+
86+
* param $username
87+
* param $password
88+
89+
8190
#### amOnPage
8291

8392

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