Skip to content

Commit 28d0cee

Browse files
committed
updated
1 parent f529f18 commit 28d0cee

12 files changed

+437
-93
lines changed

_posts/2017-05-09-new-addons-page.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: "New Addons Page"
44
date: 2017-05-09 01:03:50
55
---
66

7-
As you know Codeception has a really nice ecosystem with lots of modules and extensions built by the community. Thanks for everyone who invest their time into building better testing tools. Sometimes we accept 3rd-party modules into Codeception core, sometimes we ask contributors to publish them as standalone packages.
8-
7+
As you know Codeception has a really nice ecosystem with lots of modules and extensions built by the community. Thanks for everyone who invest their time into building better testing tools. Sometimes we accept 3rd-party modules into Codeception core, sometimes we ask contributors to publish them as standalone packages.
8+
99
Today we'd love to announce a minor but very nice change on our website. **We updated the [Addons](http://codeception.com/addons) page** so community-built modules and extensions would look nice there. The new Addons page looks as slick as a marketplace but everything there is for free!
1010

1111
If you have a helper or an extension that might be useful to others, don't hesitate to share it! New "cards" format for extensions and modules will make them more visible to others. You can also attach your pictures and set colors for cards to be even more visible (If you think your extensions worth it).
@@ -14,7 +14,7 @@ The philosophy of Codeception is: don't reinvent the wheel, share testing soluti
1414

1515
There are some tools you definitely should not miss:
1616

17-
* [Codeception extension for Chrome](https://chrome.google.com/webstore/detail/codeception-testtools/jhaegbojocomemkcnmnpmoobbmnkijik) created by Marcel Pociot.
17+
* [Codeception Extension for Chrome](https://chrome.google.com/webstore/detail/codeception-testtools/jhaegbojocomemkcnmnpmoobbmnkijik) created by Marcel Pociot.
1818
* [WebCeption](https://github.com/jayhealey/Webception) a web-based Codeception runner.
1919
* [Recorder](http://codeception.com/docs/reference/Extensions#CodeceptionExtensionRecorder) an official extension to capture screenshots after each step.
2020
* [VisualCeption](https://github.com/Codeception/VisualCeption) and [CSSRegression](https://github.com/mendicm/css-regression) to test visual regressions on site.
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
layout: post
3+
title: "Codeception 2.3"
4+
date: 2017-05-22 01:03:50
5+
---
6+
7+
Today the Codeception 2.3 sees the world. This is a stable release with almost no breaking changes but with new features you will probably like.
8+
9+
10+
![](/images/codeception2.3_banner.png)
11+
12+
13+
At first, we need to say "thank you" to [Luis Montealegre](https://github.com/MontealegreLuis) for bringing **PHPUnit 6.0 support** to Codeception. This is done by using class aliases so this doesn't break old PHPUnit versions, so as usual, Codeception can be used with PHPUnit 4.8 and higher. However, If you run PHP7+ and you experience PHPUnit issues in this release we recommend you to set `phpunit/phpunit` package to `^5.7.0` in your composer.json.
14+
15+
Supporting 3 major versions of PHPUnit may have its issues, so in next release, which is going to be 3.0 we will probably drop support for old PHPUnits and PHP < 7.
16+
17+
Ok, let's talk about other changes in this release!
18+
19+
20+
## Installation Templates
21+
22+
Codeception is a wide-range testing framework and sometimes it is hard to get it configured for a specific case. Nevertheless, you need only acceptance testing Codeception will still install all 3 test suites for you. In 2.3 we prepared installation templates: customized setup wizards that can configure tests for your needs.
23+
24+
To setup Codeception for acceptance testing with browser only you can run this command
25+
26+
```
27+
codecept init acceptance
28+
```
29+
30+
After answering a few questions, you will be able to execute first browser test
31+
32+
![](/images/codecept_acceptance.gif)
33+
34+
The setup wizard will prepare only `acceptance` test suite with tests located in `tests` directory. Suite configuration will be stored in `codeception.yml`.
35+
36+
**For QA engineers `codecept init acceptance` is a new convenient way to start end-to-end testing in PHP**.
37+
38+
We also included API and Unit templates for faster setup of REST API or unit tests:
39+
40+
```
41+
codecept init api
42+
codecept init unit
43+
```
44+
45+
But the best thing about installation templates that they can be created by anyone! They can be placed inside a separate package and loaded by `init` command. A template class should be placed into `Codeception\Template` namespace and then it can be autoloaded. Installation templates are pretty simple, learn how to build your own by taking a look at [Acceptance template as an example](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Template/Acceptance.php#L67).
46+
47+
## Configuration Improvements
48+
49+
#### Suites Inside Main Config
50+
51+
Suites can be defined inside main config:
52+
53+
```yaml
54+
actor_suffix: Tester
55+
paths:
56+
tests: .
57+
log: _output
58+
data: _data
59+
support: _support
60+
suites:
61+
unit:
62+
path: .
63+
actor: UnitTester
64+
modules:
65+
enabled:
66+
- Asserts
67+
```
68+
69+
A good option if you have a single suite.
70+
71+
#### Suite Paths
72+
73+
The suite can have its custom path (specified by `path`). From config above expects unit tests to be placed into the root directory, where codeception.yml is located (`path: tests: .` and `path: ``)
74+
75+
![selection_201](https://cloud.githubusercontent.com/assets/220264/25978631/1cda7ba6-36cc-11e7-9db1-035b13cab3d4.png)
76+
77+
#### Suites With No Actor
78+
79+
Suite can be defined without an actor, which is useful for unit testing
80+
81+
```yaml
82+
paths:
83+
tests: tests
84+
log: tests/_output
85+
data: tests/_data
86+
support: tests/_support
87+
envs: tests/_envs
88+
suites:
89+
unit:
90+
path: .
91+
modules:
92+
enabled:
93+
- Asserts
94+
```
95+
96+
In this case, UnitTester won't be created, as well as `_generated/UnitActions`. However, such suites won't be able to have Cest and Cept files generated.
97+
98+
#### Naming Changes
99+
100+
`class_name` suite in suite config replaced with `actor`:
101+
102+
```
103+
class_name: UnitTester => actor: UnitTester
104+
```
105+
106+
`actor` from global config is replaced with `actor_suffix` config option (which makes more sense).
107+
108+
All these changes are backward compatible, so old values in config will work.
109+
110+
## Extensions
111+
112+
Dynamical loading of extensions was already with `--override` option but was not very usable. Now extensions can be loaded with `--ext` option:
113+
114+
```bash
115+
codecept run --ext Recorder
116+
```
117+
118+
or by providing a full class name
119+
120+
```
121+
codecept run --ext "Codeception\Extension\Recorder"
122+
```
123+
124+
This can be used to enable a custom reporter. For this reason, the new [DotReporter](http://codeception.com/extensions#DotReporter) has been added:
125+
126+
```
127+
codecept run --ext DotReporter
128+
```
129+
130+
![selection_205](https://cloud.githubusercontent.com/assets/220264/26132800/4d23f336-3aab-11e7-81ba-2896a4c623d2.png)
131+
132+
## Db Populator
133+
134+
From the early days of Codeception we had the Db module which was trying to do its best to populate database and clean up it between tests. However, parsing all possible SQL dialects and running them through PHP was not very effective. What if you could use native Database tools to import data instead of doing it from PHP? Why not!
135+
136+
In Codeception 2.3 we recommend to specify a command to load a database in `populator` option of Db module:
137+
138+
139+
```yaml
140+
modules:
141+
enabled:
142+
- Db:
143+
dsn: 'mysql:host=localhost;dbname=testdb'
144+
user: 'root'
145+
password: ''
146+
cleanup: true # run populator before each test
147+
populate: true # run populator before all test
148+
populator: 'mysql -u $user $dbname < tests/_data/dump.sql'
149+
```
150+
151+
This approach is system-dependent, you can't use the same config on Windows and Nix systems, but is much faster. Thanks [Mauro Asprea @brutuscat](https://github.com/brutuscat) for this feature.
152+
153+
### Db module defaults
154+
155+
Important notice: we changed defaults for Db module, so **`cleanup` and `populate` options are disabled** by default. They were quite dangerous in use, so we decided that you need to set them explicitly in Db module config.
156+
157+
---
158+
159+
Codeception 2.2.12 has been released as well.
160+
See complete [changelog](http://codeception.com/changelog) for all notable changes.
161+
162+
---
163+
164+
P.S. Codeception is seeking for Symfony module maintainer. If you use Codeception with Symfony and you'd like to improve it, please contact us at `team@codeception.com`.
165+
Maintainer responsibilities are: review issues, pull requests, update symfony demo app and so on. Take a part in project development and make open source brighter!

css/codeception.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ body #home-hero h1 {
7070
top:-7px;
7171
}
7272

73+
body .panel>.panel-collapse {
74+
padding: 10px;
75+
}
76+
7377
.maintainer a {
7478
color: #fff;
7579
}
@@ -141,20 +145,24 @@ body .page {
141145

142146
body .fixed {
143147
margin: auto;
144-
max-width: 800px;
148+
max-width: 1000px;
145149
}
146150

147151
body .post {
148152
margin-top: 1.5em;
149153
margin-bottom: 1.5em;
150154
font-size: 1.3em;
151-
line-height: 1.5;
155+
line-height: 1.4;
152156
color: #444;
153157
}
154158

155159
body .page .post p {
156-
margin-top: 1.3em;
157-
margin-bottom: 1.3em;
160+
margin-top: 0;
161+
margin-bottom: 1em;
162+
}
163+
164+
body .page .post h2, body .page .post h3, body .page .post h4, body .page .post h5, body .page .post ul {
165+
margin-bottom: 1em;
158166
}
159167

160168

images/codecept_acceptance.gif

3.75 MB
Loading

images/codecept_api.gif

93.5 KB
Loading

images/codecept_bootstrap.gif

190 KB
Loading

images/codecept_run.gif

110 KB
Loading

images/codecept_unit.gif

242 KB
Loading

images/codeception2.3_banner.png

140 KB
Loading

php5/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy