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: docs/APITesting.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,10 @@ title: API Testing - Codeception Docs
9
9
10
10
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.
11
11
12
-
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.
12
+
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.
13
13
14
14
```bash
15
-
php vendor/bin/codecept generate:suite api
15
+
php vendor/bin/codecept generate:suite Api
16
16
```
17
17
18
18
We will put all the api tests there.
@@ -23,7 +23,7 @@ We will put all the api tests there.
23
23
24
24
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 `Symfony` module for Symfony2 applications in order to ignore web server and test web service internally.
25
25
26
-
Configure modules in `api.suite.yml`:
26
+
Configure modules in `Api.suite.yml`:
27
27
28
28
```yaml
29
29
actor: ApiTester
@@ -60,7 +60,7 @@ modules:
60
60
Once we have configured our new testing suite, we can create the first sample test:
61
61
62
62
```bash
63
-
php vendor/bin/codecept generate:cest api CreateUser
63
+
php vendor/bin/codecept generate:cest Api CreateUser
64
64
```
65
65
66
66
It will be called `CreateUserCest.php`.
@@ -379,7 +379,7 @@ class Api extends \Codeception\Module {
379
379
380
380
## Conclusion
381
381
382
-
Codeception has two modules that will help you to test various web services. They need a new `api` suite to be created. Remember, you are not limited to test only response body. By including `Db` module you may check if a user has been created after the `CreateUser` call. You can improve testing scenarios by using REST or SOAP responses in your helper methods.
382
+
Codeception has two modules that will help you to test various web services. They need a new `Api` suite to be created. Remember, you are not limited to test only response body. By including `Db` module you may check if a user has been created after the `CreateUser` call. You can improve testing scenarios by using REST or SOAP responses in your helper methods.
383
383
384
384
385
385
<div class="alert alert-warning"><a href="https://github.com/Codeception/codeception.github.com/edit/master/docs/APITesting.md"><strong>Improve</strong> this guide</a></div>
@@ -151,13 +151,13 @@ And in the end we are verifying our expectation using **Then** keyword. The acti
151
151
We can test this scenario by executing it in dry-run mode. In this mode test won't be executed (actually, we didn't define any step for it, so it won't be executed in any case).
Copy file name to clipboardExpand all lines: docs/Codecoverage.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
@@ -153,7 +153,7 @@ coverage:
153
153
### Remote Server
154
154
155
155
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.
156
-
For example, let's turn on remote coverage for acceptance suite in `acceptance.suite.yml`:
156
+
For example, let's turn on remote coverage for acceptance suite in `Acceptance.suite.yml`:
Copy file name to clipboardExpand all lines: docs/ParallelExecution.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,9 +146,9 @@ Codeception can organize tests into [groups](https://codeception.com/docs/Advanc
146
146
147
147
148
148
```bash
149
-
tests/functional/LoginCept.php
150
-
tests/functional/AdminCest.php:createUser
151
-
tests/functional/AdminCest.php:deleteUser
149
+
tests/Functional/LoginCept.php
150
+
tests/Functional/AdminCest.php:createUser
151
+
tests/Functional/AdminCest.php:deleteUser
152
152
```
153
153
154
154
Tasks from `\Codeception\Task\SplitTestsByGroups` will generate non-intersecting group files. You can either split your tests by files or by single tests:
@@ -159,15 +159,15 @@ public function parallelSplitTests()
159
159
// Split your tests by files
160
160
$this->taskSplitTestFilesByGroups(5)
161
161
->projectRoot('.')
162
-
->testsFrom('tests/acceptance')
162
+
->testsFrom('tests/Acceptance')
163
163
->groupsTo('tests/Support/Data/paracept_')
164
164
->run();
165
165
166
166
/*
167
167
// Split your tests by single tests (alternatively)
168
168
$this->taskSplitTestsByGroups(5)
169
169
->projectRoot('.')
170
-
->testsFrom('tests/acceptance')
170
+
->testsFrom('tests/Acceptance')
171
171
->groupsTo('tests/Support/Data/paracept_')
172
172
->run();
173
173
*/
@@ -207,7 +207,7 @@ Let's try to execute tests from the second group:
207
207
208
208
209
209
```bash
210
-
php vendor/bin/codecept run acceptance -g paracept_2
210
+
php vendor/bin/codecept run Acceptance -g paracept_2
211
211
```
212
212
213
213
#### Step 2: Running Tests
@@ -228,7 +228,7 @@ public function parallelRun()
228
228
for ($i = 1; $i <= 5; $i++) {
229
229
$parallel->process(
230
230
$this->taskCodecept() // use built-in Codecept task
231
-
->suite('acceptance') // run acceptance tests
231
+
->suite('Acceptance') // run acceptance tests
232
232
->group("paracept_$i") // for all paracept_* groups
233
233
->xml("tests/_log/result_$i.xml") // save XML results
0 commit comments