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
Copy file name to clipboardExpand all lines: changelog.markdown
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,34 @@ title: Codeception Changelog
7
7
8
8
# Changelog
9
9
10
+
#### 2.1.3
11
+
12
+
* <strong>[REST]</strong> **Added matching data types** by with new methods <strong>[seeResponseMatchesJsonType]</strong>(http://codeception.com/docs/modules/REST#seeResponseMatchesJsonType) and `dontSeeResponseMatchesJsonType`. See <ahref="https://github.com/Codeception/Codeception/issues/2391">#2391</a>
13
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> added `_request` and `_loadPage` hidden API methods for performing arbitrary requests.
14
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Fixed `seeInField`, `dontSeeInField` for disabled fields <ahref="https://github.com/Codeception/Codeception/issues/2378">#2378</a>. See <ahref="https://github.com/Codeception/Codeception/issues/2414">#2414</a>.
15
+
* Environment files can now be located in subfolders of `tests/_env` by <strong><ahref="https://github.com/Zifius">@Zifius</a></strong>
16
+
* <strong>[Symfony2]</strong> Fixed issue when accessing profiler when no request has been performed <ahref="https://github.com/Codeception/Codeception/issues/652">#652</a>.
17
+
* <strong>[Symfony2]</strong> Added `amOnRoute` and `seeCurrentRouteIs` methods by <strong><ahref="https://github.com/raistlin">@raistlin</a></strong>
18
+
* <strong>[ZF2]</strong> Added `amOnRoute` and `seeCurrentRouteIs` methods module, by <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
19
+
* Fixed issue with trailing slashes in `seeCurrentUrlEquals` and `dontSeeCurrentUrlEquals` methods <ahref="https://github.com/Codeception/Codeception/issues/2324">#2324</a>. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
20
+
* Warning is displayed once using unconfigured environment.
21
+
* Fixed loading environment configurations for Cept files by <strong><ahref="https://github.com/splinter89">@splinter89</a></strong>
22
+
* Fixed bootstrap with namespaces to inject namespaced actor classes properly.
23
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> added hidden `_request()` method to send requests to backend from Helper classes.
24
+
* <strong>[Laravel5]</strong> Added `disableEvents()`, `enableEvents()` and `expectEvents()` methods. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
25
+
* <strong>[Laravel5]</strong> Added `dontSeeFormErrors()` method. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
26
+
* <strong>[Db]</strong> Deleted Oracle driver (it existed by mistake, the real driver is Oci). By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
27
+
* <strong>[Db]</strong> Implemented getPrimaryKey method for Sqlite, Mysql, Postgresql, Oracle and MsSql. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
28
+
* <strong>[Db]</strong> Implemented support for composite primary keys and tables without primary keys. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
29
+
* Fixed the scalarizeArray to be aware of NULL fields <ahref="https://github.com/Codeception/Codeception/issues/2264">#2264</a>. By <strong><ahref="https://github.com/fbidu">@fbidu</a></strong>
30
+
* <strong>[Soap]</strong> Fixed SOAP module <ahref="https://github.com/Codeception/Codeception/issues/2296">#2296</a>. By <strong><ahref="https://github.com/relaxart">@relaxart</a></strong>
31
+
* Fixed a bug where blank lines in a groups file would run every test in the project <ahref="https://github.com/Codeception/Codeception/issues/2297">#2297</a>. By <strong><ahref="https://github.com/imjoehaines">@imjoehaines</a></strong>
32
+
* <strong>[WebDriver]</strong> seeNumberOfElements should only count visible elements <ahref="https://github.com/Codeception/Codeception/issues/2303">#2303</a>. By <strong><ahref="https://github.com/sascha">@sascha</a></strong>-egerer
33
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Verbose output for all HTTP requests. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
34
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Throw `Codeception\Exception\ExternalUrlException` when framework module tries to open an external URL <ahref="https://github.com/Codeception/Codeception/issues/2328">#2328</a>. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
35
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Added `switchToIframe` method. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
Copy file name to clipboardExpand all lines: docs/02-GettingStarted.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ Each suite has its own bootstrap file. It's located in the suite directory and i
155
155
156
156
## Cept, Cest and Test Formats
157
157
158
-
Codeception supports three test formats. Beside the previously described scenario-based Cept format, Codeception can also execute [PHPUnit test files for unit testing](http://codeception.com/docs/06-UnitTests), and Cest format.
158
+
Codeception supports three test formats. Beside the previously described scenario-based Cept format, Codeception can also execute [PHPUnit test files for unit testing](http://codeception.com/docs/05-UnitTests), and Cest format.
159
159
160
160
Cest combines scenario-driven test approach with OOP design. In case you want to group a few testing scenarios into one you should consider using Cest format. In the example below we are testing CRUD actions within a single file but with a several test (one per each operation):
Copy file name to clipboardExpand all lines: docs/06-ReusingTestCode.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,7 +288,7 @@ class Login
288
288
*/
289
289
protected $tester;
290
290
291
-
public function __construct(AcceptanceTester $I)
291
+
public function __construct(\AcceptanceTester $I)
292
292
{
293
293
$this->tester = $I;
294
294
}
@@ -343,7 +343,7 @@ class UserCest
343
343
344
344
{% endhighlight %}
345
345
346
-
The dependency nijection container can construct any object that require any known class type. For instance, `Page\Login` required `AcceptanceTester`, and so it was injected into `Page\Login` constructor, and PageObject was created and passed into method arguments. You should specify explicitly the types of requried objects for Codeception to know what objects should be created for a test. Dependency Injection will be described in the next chapter.
346
+
The dependency injection container can construct any object that require any known class type. For instance, `Page\Login` required `AcceptanceTester`, and so it was injected into `Page\Login` constructor, and PageObject was created and passed into method arguments. You should specify explicitly the types of requried objects for Codeception to know what objects should be created for a test. Dependency Injection will be described in the next chapter.
Copy file name to clipboardExpand all lines: docs/07-AdvancedUsage.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,7 +221,7 @@ class ModeratorCest {
221
221
222
222
{% endhighlight %}
223
223
224
-
You can also use `@before` and `@after` for included functions. But you can't have multiple annotations of the same kind for single method - one method can have only one `@before` and only one `@after` annotation.
224
+
You can also use `@before` and `@after` for included functions. But you can't have multiple annotations of the same kind for single method - one method can have only one `@before` and only one `@after` annotation of the same kind.
The same way we tested a web site, Codeception allows you to test web services. They are very hard to test manually, so it's really good idea to automate web service testing. As a standards we have SOAP and REST, which are represented in corresponding modules. We will cover them in this chapter.
8
+
The same way we tested a web site, Codeception allows you to test web services. They are very hard to test manually, so it's a really good idea to automate web service testing. We have SOAP and REST as standards, which are represented in corresponding modules, which we will cover in this chapter.
9
9
10
-
You should start with creating a new test suite, which was not provided by the `bootstrap` command. We recommend to call it **api** and use the `ApiTester` class for it.
10
+
You should start by creating a new test suite, (which was not provided by the `bootstrap` command). We recommend calling it **api** and using the `ApiTester` class for it.
11
11
12
12
{% highlight bash %}
13
13
@@ -19,7 +19,7 @@ We will put all the api tests there.
19
19
20
20
## REST
21
21
22
-
The REST web service is accessed via HTTP with standard methods: `GET`, `POST`, `PUT`, `DELETE`. They allow to receive and manipulate entities from the service. Accessing WebService requires HTTP client, so for using it you need the module `PhpBrowser` or one of framework modules set up. For example, we can use the `Symfony2` module for Symfony2 applications in order to ignore web server and test web service internally.
22
+
The REST web service is accessed via HTTP with standard methods: `GET`, `POST`, `PUT`, `DELETE`. They allow users to receive and manipulate entities from the service. Accessing a WebService requires an HTTP client, so for using it you need the module `PhpBrowser` or one of framework modules set up. For example, we can use the `Symfony2` module for Symfony2 applications in order to ignore web server and test web service internally.
23
23
24
24
Configure modules in `api.suite.yml`:
25
25
@@ -34,7 +34,7 @@ modules:
34
34
35
35
{% endhighlight %}
36
36
37
-
The REST module will connect to `PhpBrowser` according to this configuration. Depending on web service we may deal with XML or JSON responses. Codeception handles both data formats well, however If you don't need one of them, you can explicitly specify that the JSON or XML parts of the module will be used:
37
+
The REST module will connect to `PhpBrowser` according to this configuration. Depending on the web service we may deal with XML or JSON responses. Codeception handles both data formats well, however If you don't need one of them, you can explicitly specify that the JSON or XML parts of the module will be used:
38
38
39
39
{% highlight yaml %}
40
40
@@ -62,15 +62,15 @@ modules:
62
62
63
63
{% endhighlight %}
64
64
65
-
Once we configured new testing suite, we can create the first sample test:
65
+
Once we have configured our new testing suite, we can create the first sample test:
66
66
67
67
{% highlight bash %}
68
68
69
69
$ php codecept.phar generate:cept api CreateUser
70
70
71
71
{% endhighlight %}
72
72
73
-
It will be called `CreateUserCept.php`. We can use it to test creation of a user via the REST API.
73
+
It will be called `CreateUserCept.php`. We can use it to test the creation of a user via the REST API.
The latest line checked that the response contained the provided string. However we shouldn't rely on it, as depending on content formatting we can receive different results with the same data. What we actually need is to check that the response can be parsed and it contains some of the values we expect. In the case of JSON we can use `seeResponseContainsJson` method
92
+
The last line of the previous example verified that the response contained the provided string. However we shouldn't rely on it, as depending on content formatting we can receive different results with the same data. What we actually need is to check that the response can be parsed and it contains some of the values we expect. In the case of JSON we can use the`seeResponseContainsJson` method
93
93
94
94
{% highlight php %}
95
95
@@ -108,7 +108,7 @@ $I->seeResponseContainsJson([
108
108
109
109
{% endhighlight %}
110
110
111
-
You may want to perform even more complex assertions on a response. This can be done by writing your own methods in [Helper](http://codeception.com/docs/03-ModulesAndHelpers#Helpers) classes. To access the latest JSON response you will need to get the `response` property of the `REST` module. Let's demonstrate it with `seeResponseIsHtml` method:
111
+
You may want to perform even more complex assertions on a response. This can be done by writing your own methods in the [Helper](http://codeception.com/docs/03-ModulesAndHelpers#Helpers) classes. To access the latest JSON response you will need to get the `response` property of the `REST` module. Let's demonstrate it with the`seeResponseIsHtml` method:
0 commit comments