Skip to content

Commit 863dde7

Browse files
committed
Merge branch 'master' of github.com:Codeception/codeception.github.com
2 parents e653847 + 26bc5e7 commit 863dde7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1528
-2909
lines changed

_data/modules.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
link: https://github.com/nathanmac/im-codeception-module
5858
description: This module allows the testing against external messaging services as well as triggering notifications via your tests, currently supports HipChat messaging service.
5959

60-
- name: MailCatcher
60+
- name: MailCatcher Module
6161
link: https://github.com/captbaritone/codeception-mailcatcher-module
62-
description: This module will let you test emails that are sent during your Codeception acceptance tests. It depends upon you having MailCatcher installed on your development server.
62+
description: MailCatcher is a standalone software which can be configured to catch *any* email sent by your development server, and display it on a webpage. The MailCatcher Module allows you to test the contents of those emails in an acceptance test.
6363
color: "#FFF5C4"
6464

6565
- name: MailSMTP

_includes/extensions.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Time: 2.07 seconds, Memory: 20.00MB
2424
OK (80 tests, 124 assertions)
2525
```
2626

27-
2827
Enable this reporter with `--ext option`
2928

3029
```
@@ -34,8 +33,6 @@ codecept run --ext DotReporter
3433
Failures and Errors are printed by a standard Codeception reporter.
3534
Use this extension as an example for building custom reporters.
3635

37-
38-
3936
## Logger
4037

4138
[See Source](https://github.com/Codeception/Codeception/blob/2.3/ext/Logger.php)
@@ -60,9 +57,6 @@ extensions:
6057
6158
* `max_files` (default: 3) - how many log files to keep
6259

63-
64-
65-
6660
## Recorder
6761

6862
[See Source](https://github.com/Codeception/Codeception/blob/2.3/ext/Recorder.php)
@@ -87,7 +81,6 @@ extensions:
8781
* `delete_successful` (default: true) - delete screenshots for successfully passed tests (i.e. log only failed and errored tests).
8882
* `module` (default: WebDriver) - which module for screenshots to use. Set `AngularJS` if you want to use it with AngularJS module. Generally, the module should implement `Codeception\Lib\Interfaces\ScreenshotSaver` interface.
8983

90-
9184
#### Examples:
9285

9386
``` yaml
@@ -98,9 +91,6 @@ extensions:
9891
delete_successful: false # keep screenshots of successful tests
9992
```
10093

101-
102-
103-
10494
## RunFailed
10595

10696
[See Source](https://github.com/Codeception/Codeception/blob/2.3/ext/RunFailed.php)
@@ -128,8 +118,6 @@ extensions:
128118

129119
On each execution failed tests are logged and saved into `tests/_output/failed` file.
130120

131-
132-
133121
## RunProcess
134122

135123
[See Source](https://github.com/Codeception/Codeception/blob/2.3/ext/RunProcess.php)
@@ -175,14 +163,10 @@ extensions:
175163

176164
HINT: you can use different configurations per environment.
177165

178-
179-
180166
## SimpleReporter
181167

182168
[See Source](https://github.com/Codeception/Codeception/blob/2.3/ext/SimpleReporter.php)
183169

184170
This extension demonstrates how you can implement console output of your own.
185171
Recommended to be used for development purposes only.
186172

187-
188-

builds.markdown

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ title: Codeception Builds
44
---
55

66

7+
## 2.4
8+
*Requires: PHP 5.4 and higher + CURL*
9+
10+
* **[Download Latest 2.4 Release](http://codeception.com/releases/2.4.0/codecept.phar)**
11+
* [2.4.0](http://codeception.com/releases/2.4.0/codecept.phar), [for PHP 5.6](http://codeception.com/releases/2.4.0/php54/codecept.phar)
12+
713
## 2.3
814
*Requires: PHP 5.4 and higher + CURL*
915

10-
* **[Download Latest 2.3 Release](http://codeception.com/releases/2.3.8/codecept.phar)**
16+
* **[Download Latest 2.3 Release](http://codeception.com/releases/2.3.9/codecept.phar)**
17+
* [2.3.9](http://codeception.com/releases/2.3.9/codecept.phar), [for PHP 5.4 - 5.6](http://codeception.com/releases/2.3.9/php54/codecept.phar)
1118
* [2.3.8](http://codeception.com/releases/2.3.8/codecept.phar), [for PHP 5.4 - 5.6](http://codeception.com/releases/2.3.8/php54/codecept.phar)
1219
* [2.3.7](http://codeception.com/releases/2.3.7/codecept.phar), [for PHP 5.4 - 5.6](http://codeception.com/releases/2.3.7/php54/codecept.phar)
1320
* [2.3.6](http://codeception.com/releases/2.3.6/codecept.phar), [for PHP 5.4 - 5.6](http://codeception.com/releases/2.3.6/php54/codecept.phar)

changelog.markdown

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

88
# Changelog
99

10+
#### 2.4.0
11+
12+
* **PHPUnit 7.x compatibility**
13+
* **Dropped PHP 5.4 and PHP 5.5** support (PHP 5.5 still may work)
14+
* Internal API refactored:
15+
* Modern PHP class names used internally
16+
* Moved PHPUnit related classes to [codeception/phpunit-wrapper](https://github.com/Codeception/phpunit-wrapper) package.
17+
* Cest hooks behavior changed (by **[fffilimonov](https://github.com/fffilimonov)**):
18+
* `_failed` called when test fails
19+
* `_passed` called when tests is successful
20+
* `_after` is called for failing and successful tests
21+
22+
#### 2.3.9
23+
24+
* Added `Codeception\Step\Argument\PasswordArgument` to pass sensitive data into tests:
25+
26+
```php
27+
<?php
28+
use \Codeception\Step\Argument\PasswordArgument;
29+
30+
$I->amOnPage('/form/password_argument');
31+
$I->fillField('password', new PasswordArgument('thisissecret'));
32+
```
33+
34+
* **[WebDriver]** added `clearField` method to clean up input fields by **[eknej](https://github.com/eknej)**
35+
* **[DataFactory]** added `make` method to create instances without saving them to database. But **[ibpavlov](https://github.com/ibpavlov)**
36+
* **[REST]** Fixed passing a file to `sendPOST()` without name, size or type parameter. BY **[zebraf1](https://github.com/zebraf1)**
37+
* **[REST]** Add missing / to relative url from config by **[bscheshirwork](https://github.com/bscheshirwork)**
38+
* Fixed HTML Report marks tests as succeeded by **[mpgo13](https://github.com/mpgo13)**
39+
* `clean` command works recursively with included setups. By **[davidnewcomb](https://github.com/davidnewcomb)**
40+
41+
1042
#### 2.3.8
1143

1244
* `Codeception\Util\Stub` moved to standalone package [Codeception\Stub](https://github.com/Codeception/Stub):

codecept.phar

-16 KB
Binary file not shown.

docs/03-AcceptanceTests.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,24 @@ $I->submitForm('#update_form', array('user' => array(
223223

224224
{% endhighlight %}
225225

226+
##### Hiding Sensitive Data
227+
228+
If you need to fill in sensitive data (like passwords) and hide it in logs,
229+
you can pass instance `\Codeception\Step\Argument\PasswordArgument` with the data which needs to be hidden.
230+
231+
{% highlight php %}
232+
233+
<?php
234+
<?php
235+
use \Codeception\Step\Argument\PasswordArgument;
236+
237+
$I->amOnPage('/form/password_argument');
238+
$I->fillField('password', new PasswordArgument('thisissecret'));
239+
240+
{% endhighlight %}
241+
242+
`thisissecret` will be filled into a form but it won't be shown in output and logs.
243+
226244
#### Assertions
227245

228246
In the `PhpBrowser` you can test the page contents.

docs/05-UnitTests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class UserTest extends \Codeception\Test\Unit
104104

105105
### Assertions
106106

107-
There are pretty much assertions you can use inside tests. The most common are:
107+
There are pretty many assertions you can use inside tests. The most common are:
108108

109109
* `$this->assertEquals()`
110110
* `$this->assertContains()`
@@ -177,7 +177,7 @@ In this
177177

178178
{% endhighlight %}
179179

180-
See a reference for static Stub API
180+
See a reference for [static Stub API](http://codeception.com/docs/reference/Stub)
181181

182182
#### Mocks
183183

@@ -517,7 +517,7 @@ public function testSingleton()
517517
## Conclusion
518518

519519
PHPUnit tests are first-class citizens in test suites. Whenever you need to write and execute unit tests,
520-
you don't need to install PHPUnit seperately, but use Codeception directly to execute them.
520+
you don't need to install PHPUnit separately, but use Codeception directly to execute them.
521521
Some nice features can be added to common unit tests by integrating Codeception modules.
522522
For most unit and integration testing, PHPUnit tests are enough. They run fast, and are easy to maintain.
523523

docs/07-AdvancedUsage.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class BasicCest
4949
and will receive an instance of the Actor class as the first parameter and the `$scenario` variable as the second one.
5050
5151
In `_before` and `_after` methods you can use common setups and teardowns for the tests in the class.
52-
This actually makes Cest tests more flexible than Cepts, which rely only on similar methods in Helper classes.
5352
5453
As you see, we are passing the Actor object into `tryToTest` method. This allows us to write scenarios the way we did before:
5554
@@ -61,7 +60,6 @@ class BasicCest
6160
// test
6261
public function tryToTest(\AcceptanceTester $I)
6362
{
64-
$I->wantTo('log in to site');
6563
$I->amOnPage('/');
6664
$I->click('Login');
6765
$I->fillField('username', 'john');
@@ -74,11 +72,29 @@ class BasicCest
7472

7573
{% endhighlight %}
7674

77-
As you see, Cest classes have no parents like `\Codeception\Test\Unit` or `PHPUnit_Framework_TestCase`.
75+
As you see, Cest classes have no parents.
7876
This is done intentionally. It allows you to extend your classes with common behaviors and workarounds
7977
that may be used in child classes. But don't forget to make these methods `protected` so they won't be executed as tests.
8078

81-
You can also define a `_failed` method in Cest classes which will be called if test finishes with `error` or fails.
79+
Cest format also can contain hooks based on test results:
80+
81+
* `_failed` will be executed on failed test
82+
* `_passed` will be executed on passed test
83+
84+
{% highlight php %}
85+
86+
<?php
87+
public function _failed(\AcceptanceTester $I)
88+
{
89+
// will be executed on test failure
90+
}
91+
92+
public function _passed(\AcceptanceTester $I)
93+
{
94+
// will be executed when test is successful
95+
}
96+
97+
{% endhighlight %}
8298
8399
## Dependency Injection
84100
@@ -110,8 +126,6 @@ class SignUpCest
110126

111127
public function signUp(\AcceptanceTester $I)
112128
{
113-
$I->wantTo('sign up');
114-
115129
$this->navBar->click('Sign up');
116130
$this->signUp->register([
117131
'first_name' => 'Joe',

docs/12-ParallelExecution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ We prepared a sample config with codeception, web server, database, and selenium
4747

4848
version: '2'
4949
services:
50-
codeception:
50+
codecept:
5151
image: codeception/codeception
5252
depends_on:
5353
- firefox

docs/modules/AMQP.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ title: AMQP - Codeception - Documentation
55

66

77

8-
<div class="btn-group" role="group" style="float: right" aria-label="..."><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.3/src/Codeception/Module/AMQP.php">source</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/master/docs/modules/AMQP.md">master</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.2/docs/modules/AMQP.md">2.2</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.1/docs/modules/AMQP.md">2.1</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.0/docs/modules/AMQP.md">2.0</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/1.8/docs/modules/AMQP.md">1.8</a></div>
8+
<div class="btn-group" role="group" style="float: right" aria-label="..."><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.4/src/Codeception/Module/AMQP.php">source</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/master/docs/modules/AMQP.md">master</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.3/docs/modules/AMQP.md">2.3</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.2/docs/modules/AMQP.md">2.2</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.1/docs/modules/AMQP.md">2.1</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/2.0/docs/modules/AMQP.md">2.0</a><a class="btn btn-default" href="https://github.com/Codeception/Codeception/blob/1.8/docs/modules/AMQP.md">1.8</a></div>
99

1010
# AMQP
1111

12-
1312
This module interacts with message broker software that implements
1413
the Advanced Message Queuing Protocol (AMQP) standard. For example, RabbitMQ (tested).
1514

@@ -47,7 +46,7 @@ To use this module with Composer you need <em>"php-amqplib/php-amqplib": "~2.4"<
4746
### Actions
4847

4948
#### bindQueueToExchange
50-
49+
5150
Binds a queue to an exchange
5251

5352
This is an alias of method `queue_bind` of `PhpAmqpLib\Channel\AMQPChannel`.
@@ -71,9 +70,8 @@ $I->bindQueueToExchange(
7170
* `param int` $ticket
7271
* `return` mixed|null
7372

74-
7573
#### declareExchange
76-
74+
7775
Declares an exchange
7876

7977
This is an alias of method `exchange_declare` of `PhpAmqpLib\Channel\AMQPChannel`.
@@ -99,9 +97,8 @@ $I->declareExchange(
9997
* `param int` $ticket
10098
* `return` mixed|null
10199

102-
103100
#### declareQueue
104-
101+
105102
Declares queue, creates if needed
106103

107104
This is an alias of method `queue_declare` of `PhpAmqpLib\Channel\AMQPChannel`.
@@ -125,9 +122,8 @@ $I->declareQueue(
125122
* `param int` $ticket
126123
* `return` mixed|null
127124

128-
129125
#### grabMessageFromQueue
130-
126+
131127
Takes last message from queue.
132128

133129
{% highlight php %}
@@ -141,9 +137,8 @@ $message = $I->grabMessageFromQueue('queue.emails');
141137
* `param string` $queue
142138
* `return` \PhpAmqpLib\Message\AMQPMessage
143139

144-
145140
#### purgeAllQueues
146-
141+
147142
Purge all queues defined in config.
148143

149144
{% highlight php %}
@@ -154,9 +149,8 @@ $I->purgeAllQueues();
154149

155150
{% endhighlight %}
156151

157-
158152
#### purgeQueue
159-
153+
160154
Purge a specific queue defined in config.
161155

162156
{% highlight php %}
@@ -169,9 +163,8 @@ $I->purgeQueue('queue.emails');
169163

170164
* `param string` $queueName
171165

172-
173166
#### pushToExchange
174-
167+
175168
Sends message to exchange by sending exchange name, message
176169
and (optionally) a routing key
177170

@@ -189,9 +182,8 @@ $I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'), 'severity');
189182
* `param string|\PhpAmqpLib\Message\AMQPMessage` $message
190183
* `param string` $routing_key
191184

192-
193185
#### pushToQueue
194-
186+
195187
Sends message to queue
196188

197189
{% highlight php %}
@@ -206,9 +198,8 @@ $I->pushToQueue('queue.jobs', new AMQPMessage('create'));
206198
* `param string` $queue
207199
* `param string|\PhpAmqpLib\Message\AMQPMessage` $message
208200

209-
210201
#### seeMessageInQueueContainsText
211-
202+
212203
Checks if message containing text received.
213204

214205
**This method drops message from queue**

0 commit comments

Comments
 (0)