Skip to content

Commit 973582f

Browse files
committed
config page added
1 parent b958854 commit 973582f

File tree

2 files changed

+125
-13
lines changed

2 files changed

+125
-13
lines changed

doc.markdown

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Codeception Documentation
55

66
# Documentation
77

8-
## Guides
8+
### Guides
99

1010
Guides will walk you though the basic concepts of testing to the full understanding knowlegde of Codeception.
1111
Everything you want to know about Codeception can be found in Guides.
@@ -19,50 +19,60 @@ Everything you want to know about Codeception can be found in Guides.
1919
* [Unit Tests Practice](/docs/07-UnitTestsPractice) - practical approach to unit testing in scenario manner.
2020
* [Data](/docs/08-Data) - repopulation of database, cleaning up data, using fixtures, etc.
2121

22-
## References
22+
### Examples
23+
24+
(coming soon)
25+
26+
* Getting Started With Selenium
27+
* Testing Symfony2 Application
28+
* Working With Database
29+
* Testing SOAP Web Service
30+
31+
### Reference
2332

2433
References explains API of verious parts of Codeception. Look for them if you forgot something.
2534

2635
* [Commands](/docs/reference/commands) - explains usage of Codecption console utility.
27-
* Configuration - explains basics of suites configuration.
36+
* [Configuration](/docs/reference/configuration) - explains basics of suites and modules configuration.
37+
* PhpDocummentor2 Integration
2838
* [Xml Builder](/docs/reference/xmlbuilder) - building XMLs pragmatically.
2939
* [Stubs](/docs/reference/stubs) - cool stub builder explained.
3040

31-
## Modules
41+
### Modules
3242

3343
Modules are used to test various parts of your application. There are plenty of those and many should arrive in a future.
3444
Choose the best module for your needs and see it's reference.
3545

36-
### Testing Web Applications with Javascript
46+
#### Testing Web Applications with Javascript
3747

38-
* [Selenium](/docs/modules/Selenium) - use Selenium server to run tests in browser.
39-
* [Selenium2](/docs/modules/Selenium2) - use Selenium server to run tests in browser.
40-
* [ZombieJS](/docs/modules/ZombieJS) - use Zombie.js backend to run tests without browser.
48+
* [Selenium](/docs/modules/Selenium) - use *Selenium* server to run tests in browser.
49+
* [Selenium2](/docs/modules/Selenium2) - use *Selenium2* server to run tests in browser.
50+
* [ZombieJS](/docs/modules/ZombieJS) - use *Zombie.js* backend to run tests without browser.
4151

42-
### Testing Web Applications without Javascript
52+
#### Testing Web Applications without Javascript
4353

4454
* [PhpBrowser](/docs/modules/PhpBrowser) - emulates browser usage by fetching and parsing html pages.
4555

46-
### Testing Inside PHP Frameworks
56+
#### Testing Inside PHP Frameworks
4757

4858
* [Symfony2](/docs/modules/Symfony2) - wraper for [Symfony2](http://symfony.com) functional tests.
4959
* [Zend Framework](/docs/modules/Zend) - wraper for [ZF](http://framework.zend.com) functional test.
5060
* [symfony](/docs/modules/symfony) - wraper for [symfony 1.x](http://symfony-project.org) functional test
5161
* [Kohana](/docs/modules/Kohana)
5262
* [Social Engine](/docs/module/SocialEngine) - ZF module adopted for SE
5363

54-
### Unit Testing
64+
#### Unit Testing
5565

5666
Basically you could use PHPUnit tests for unit testing. But Codeception scenario-driven unit tests are much powerful )
5767

5868
* [Unit](/docs/modules/unit) - everything for unit testing.
5969

60-
### API Testing
70+
#### API Testing
6171

6272
* [REST](/docs/modules/REST) - testing REST Web services (can be tested inside framework)
6373
* [SOAP](/docs/modules/SOAP) - testing SOAP WSDL web-services (can be tested inside framework)
6474

65-
### Database Testing
75+
#### Database Testing
6676

6777
* [Db](/docs/modules/Db) - use to test changes in database
6878
* [Doctrine2](/docs/modules/doctrine2) - test database managed by [Doctrine2](http://www.doctrine-project.org/) ORM
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Configuration
2+
3+
## Global Configuration
4+
5+
Configuration file `codeception.yml` is generated by `codecept bootsrtap` command and contains all parameters for running Codeception.
6+
7+
Example:
8+
9+
``` yaml
10+
paths:
11+
tests: tests
12+
log: tests/_log
13+
data: tests/_data
14+
helpers: tests/_helpers
15+
settings:
16+
bootstrap: _bootstrap.php
17+
suite_class: \PHPUnit_Framework_TestSuite
18+
colors: false
19+
memory_limit: 1024M
20+
log: true
21+
modules:
22+
config:
23+
Db:
24+
dsn: ''
25+
user: ''
26+
password: ''
27+
dump: tests/_data/dump.sql
28+
```
29+
30+
### Parameters
31+
32+
#### Paths
33+
34+
* tests - path to test directory
35+
* log - path to log directory, where tests output stored
36+
* data - path to data directory, where tests input data may be stored
37+
* helpers - path to [helper](/docs/03-Modules#helpers) modules with custom actions and assertions
38+
39+
#### Settings
40+
41+
* bootstrap - the bootstrap file always loaded before each step. Can be useful for loading fixtures. But probably you want manual control, then remove this line and use `require_once '_bootsrtap.php'` inside tests.
42+
* suite_class - suite is used as a tests container.
43+
* colors - colored ooutput, by default is `false` on Windows and `true` on other systems. Install [ANSICon](http://adoxa.110mb.com/ansicon/) on Windows and set to true.
44+
* memory_limit - PHP memory consuming parameter. Increase this value if you run out of memory.
45+
* log - weather to log tests execution process to file.
46+
47+
#### Modules
48+
49+
This section is used to configure a module for all suites. If you got module shared through all suites, put their configuration here.
50+
51+
## Suite Configuration
52+
53+
Each suite has it's configuration file in `tests` directory. It's used for configuring modules used in test scenarios.
54+
55+
Example:
56+
57+
``` yaml
58+
class_name: WebGuy
59+
modules:
60+
enabled:
61+
- PhpBrowser
62+
- WebHelper
63+
config:
64+
PhpBrowser:
65+
url: 'http://localhost/myapp/'
66+
```
67+
68+
### Parameters
69+
70+
* class_name - a [Guy class](http://codeception.com/docs/02-GettingStarted#guys) used in this suite.
71+
72+
#### Modules
73+
74+
* enabled - a list of modules. The order of list *matters* as the next modules can replace actions from previous ones.
75+
* config - config of module. The configuration parameters for each module is documented on pages for each module. There are required and optional pameters.
76+
77+
Examples:
78+
79+
Configuring [Db](http://codeception.com/docs/modules/Db) module:
80+
81+
``` yaml
82+
83+
modules:
84+
enabled [PhpBrowser, WebHelper, Db]
85+
config:
86+
dsn: 'mysql:host=localhost;dbname=testdb'
87+
user: root
88+
password:
89+
dump: tests/_data/dump.sql
90+
```
91+
92+
Configuring [Selenium2](http://codeception.com/docs/modules/Selenium2) module:
93+
94+
``` yaml
95+
modules:
96+
enabled: [Selenium2, WebHelper]
97+
config:
98+
Selenium2L:
99+
url: http://localhost/
100+
browser: filrefox
101+
delay: 10
102+
```

0 commit comments

Comments
 (0)