You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
19
19
or locally, but behind the web server. It may look hard to collect code coverage for Selenium tests or PhpBrowser tests. But Codeception
20
20
supports remote codecoverage as well as local.
21
21
@@ -24,7 +24,7 @@ supports remote codecoverage as well as local.
24
24
To enable codecoverge put these lines to the global configuration file `codeception.yml`:
25
25
26
26
{% highlight yaml %}
27
-
yml
27
+
yaml
28
28
coverage:
29
29
enabled: true
30
30
@@ -33,20 +33,20 @@ coverage:
33
33
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.
34
34
35
35
{% highlight yaml %}
36
-
yml
36
+
yaml
37
37
coverage:
38
38
enabled: true
39
39
whitelist:
40
40
include:
41
-
- app/*
41
+
- app/*
42
42
exclude:
43
43
- app/cache/*
44
44
blacklist:
45
45
include:
46
46
- app/controllers/*
47
47
exclude:
48
48
- app/cache/CacheProvider.php
49
-
49
+
50
50
51
51
{% endhighlight %}
52
52
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
60
60
There is a shortcut if you don't need that complex filters:
61
61
62
62
{% highlight yaml %}
63
-
63
+
yaml
64
64
coverage:
65
65
enabled: true
66
66
include:
@@ -72,7 +72,7 @@ coverage:
72
72
73
73
These `include` and `exclude` options are to add or remove files from a whitelist.
74
74
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.
76
76
77
77
## Local CodeCoverage
78
78
@@ -82,7 +82,7 @@ All you need is to execute codeception with `--coverage` option.
82
82
To generate a clover xml report or a tasty html report append also `--xml` and `--html` options.
83
83
84
84
{% highlight yaml %}
85
-
85
+
yaml
86
86
codecept run --coverage --xml --html
87
87
88
88
{% endhighlight %}
@@ -92,50 +92,48 @@ XML clover reports are used by IDEs (like PHPStorm) or Continuous Integration se
92
92
93
93
## Remote CodeCoverage
94
94
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,
99
99
without even knowing it is being tested, a small file should be included in order to collect coverage info.
100
100
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.
103
103
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.
105
105
106
106
Please, follow installation instructions described in a [readme file](https://github.com/Codeception/c3).
107
107
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.
109
109
In case you execute your application locally there is nothing to be changed in config.
110
110
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.
112
112
113
113
It's never been easier to setup remote codecoverage for your application. In ay other framework. Really.
114
114
115
115
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.
116
116
For example, let's turn on remote coverage for acceptance suite in `acceptance.suite.yml`
117
117
118
118
{% highlight yaml %}
119
-
119
+
yaml
120
120
coverage:
121
121
enabled: true
122
122
remote: true
123
123
124
124
{% endhighlight %}
125
125
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.
128
128
But in case of running tests on a remote server we are not sure of it.
129
129
130
130
## Conclusion
131
131
132
132
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
134
134
you the most complete information on which parts of your applications are tested and which are not.
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.
11
12
12
13
Use to perform web acceptance tests with non-javascript browser.
13
14
@@ -17,31 +18,47 @@ If test fails stores last shown page in 'output' dir.
17
18
18
19
* Maintainer: **davert**
19
20
* 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/)
22
23
23
24
*Please review the code of non-stable modules and provide patches if you have issues.*
0 commit comments