Skip to content

Commit 00b993e

Browse files
author
davert
committed
Merge branch 'master' of github.com:Codeception/codeception.github.com
2 parents 6ec4bea + 1e8609b commit 00b993e

19 files changed

+1155
-37
lines changed

_includes/modules.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Selenium">Selenium</a></li><li><a href="/docs/modules/Selenium2">Selenium2</a></li><li><a href="/docs/modules/SocialEngine">SocialEngine</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Unit">Unit</a></li><li><a href="/docs/modules/WebDebug">WebDebug</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li><li><a href="/docs/modules/ZombieJS">ZombieJS</a></li>
1+
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/Laravel4">Laravel4</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Selenium">Selenium</a></li><li><a href="/docs/modules/Selenium2">Selenium2</a></li><li><a href="/docs/modules/SocialEngine">SocialEngine</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Unit">Unit</a></li><li><a href="/docs/modules/WebDebug">WebDebug</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li><li><a href="/docs/modules/ZombieJS">ZombieJS</a></li>

_posts/2013-05-04-specification-testing-coparison.markdown

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Now lets talk about functional and acceptance tests for web. Now we know differe
101101

102102
* In web it is not very important to develop pages from how they need to behave. So there all power of Gherkin could not be applied. In this case Gherkin works just as simple translator and nothing more. My decision is to use right things for right purposes.
103103
* As I've pointed out above you also need to know Mink "internals" (API) to proceed some your custom methods.
104-
* Testing web-pages can lead to many ambiguous or redundant Gherkin steps.
104+
* Testing web-pages can lead to many *"Ambiguous"* or *"Redundant"* Behat feature steps.
105105

106106
Of course there are some things to avoid this, but i prefer "easy-to-learn things" in this situation.
107107

@@ -129,7 +129,7 @@ $I->seeLink('Login');
129129
?>
130130
{% endhighlight %}
131131

132-
As you can see it is easy to read, and one really great thing is it is easy to write, because of auto-completion. In Behat when using Gherkin you can get some *"Undefined steps"* errors, just because you mistyped something. And it happens to be annoying.
132+
As you can see it is easy to read, and one really great thing is it is easy to write, because of auto-completion. In Behat when using Gherkin you can get some *"Undefined"* steps errors, just because you mistyped something. And it happens to be annoying.
133133

134134
Codeception bundled with modules for functional and acceptance tests: PhpBrowser (functional tests over curl), Selenium (1,2) for acceptance tests, etc. There are also some nice modules for REST, SOAP and XML-RPC that can help you to test your API.
135135

@@ -139,4 +139,13 @@ Overall, my choice in Codeception is to use "PhpBrowser" module (requires a web-
139139

140140
**Also need to notice that maybe Codeception is not a "true" BDD, unlike Behat. Behat+Gherkin helps you to use and design your application. Codeception helps you to test it nicely.**
141141

142-
*This post was intended to be a start to series. In next posts you will learn how to use newcoming Cest format for testing and integrate Codeception with Continious integration tools. Stay tuned!*
142+
### Links to read and get more info
143+
144+
* <http://codeception.com>
145+
* <http://behat.org>
146+
* <http://mink.behat.org/>
147+
* [Stop simulating BDD](http://codeception.com/12-20-2012/not-bdd.html)
148+
* [Ruling the swarm of tests with Codeception](http://phpmaster.com/ruling-the-swarm-of-tests-with-codeception/)
149+
150+
151+
*This post was intended to be a start to series. In next posts you will learn how to use newcoming Cest format for testing and integrate Codeception with Continious integration tools. Stay tuned!*

codecept.phar

2.84 KB
Binary file not shown.

docs/04-AcceptanceTests.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ $I->lookForwardTo('get money when the bank is closed');
109109

110110
After we have described the story background, let's start writing a scenario.
111111

112-
The `$I` object is used to write all interactions. The methods of the `$I` object are taken from the `PHPBrowser` and `Db` modules. We will briefly describe them here, but for the full reference look into the modules reference, here on (Codeception.com)[http://codeception.com].
112+
The `$I` object is used to write all interactions. The methods of the `$I` object are taken from the `PHPBrowser` and `Db` modules. We will briefly describe them here, but for the full reference look into the modules reference, here on [Codeception.com](http://codeception.com).
113113

114114
{% highlight php %}
115115

docs/05-FunctionalTests.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ We recommend writing tests on unstable parts of your application as functional t
3434

3535
## Pitfalls
3636

37-
Acceptance tests are usually much slower then functional tests. But functional tests are less stable, as they run testing framework and application in one environment.
37+
Acceptance tests are usually much slower than functional tests. But functional tests are less stable, as they run testing framework and application in one environment.
3838

3939
#### Headers, Cookies, Sessions
4040

@@ -224,7 +224,7 @@ After you get your module stabilized, share it with the community. Fork a Codece
224224

225225
There are some requirements for modules:
226226

227-
* It should be easy to configure
227+
* It should be easy to configure.
228228
* It should contain proper documentation.
229229
* It should extend basic operations by using framework internals.
230230
* It's preferred that it be able to print additional debug information.
@@ -240,5 +240,6 @@ If you are using a framework other than the ones listed here, create a module fo
240240

241241

242242

243+
243244
* **Next Chapter: [UnitTests >](/docs/06-UnitTests)**
244245
* **Previous Chapter: [< AcceptanceTests](/docs/04-AcceptanceTests)**

docs/06-UnitTests.markdown

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This can be done by this command:
2020

2121
{% highlight yaml %}
2222
bash
23-
$ php codecept.phar generate:phpunit unit Simple
23+
$ php codecept.phar generate:phpunit unit Example
2424

2525
{% endhighlight %}
2626

@@ -29,11 +29,11 @@ We need another command to create Codeception-powered unit tests.
2929

3030
{% highlight yaml %}
3131
bash
32-
$ php codecept.phar generate:test unit Simple
32+
$ php codecept.phar generate:test unit Example
3333

3434
{% endhighlight %}
3535

36-
Both tests will create a new `SimpleTest` file located in `tests/unit` directory.
36+
Both tests will create a new `ExampleTest` file located in `tests/unit` directory.
3737

3838
A test created by `generate:test` command will look like this:
3939

@@ -42,7 +42,7 @@ A test created by `generate:test` command will look like this:
4242
<?php
4343
use Codeception\Util\Stub;
4444
45-
class SimpleTest extends \Codeception\TestCase\Test
45+
class ExampleTest extends \Codeception\TestCase\Test
4646
{
4747
/**
4848
* @var CodeGuy
@@ -163,7 +163,7 @@ Less words, more code for better understanding.
163163
<?php
164164
use Codeception\Util\Stub;
165165
166-
class SimpleTest extends \Codeception\TestCase\Test
166+
class ExampleTest extends \Codeception\TestCase\Test
167167
{
168168
/**
169169
* @var CodeGuy
@@ -193,5 +193,6 @@ PHPUnit tests is a first-class citizen in test suites. Whenever you need to writ
193193

194194

195195

196+
196197
* **Next Chapter: [UnitTestsInScenarios >](/docs/07-UnitTestsInScenarios)**
197198
* **Previous Chapter: [< FunctionalTests](/docs/05-FunctionalTests)**

docs/10-WebServices.markdown

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Codeception - Documentation
77

88
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.
99

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 ApiGuy class for it.
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 ApiGuy class for it.
1111

1212
{% highlight yaml %}
1313

@@ -30,7 +30,7 @@ class_name: ApiGuy
3030
modules:
3131
enabled: [PhpBrowser, REST, ApiHelper]
3232
config:
33-
PhpBrowser:
33+
PhpBrowser:
3434
url: http://serviceapp/
3535
REST:
3636
url: http://serviceapp/api/v1/
@@ -63,7 +63,7 @@ $I->seeResponseContains('{ result: ok}');
6363

6464
{% endhighlight %}
6565

66-
REST module is designed to be used with services that serve responses in JSON format. For example, method `seeResponseContainsJson` will convert provided array to json and check if response contains it.
66+
REST module is designed to be used with services that serve responses in JSON format. For example, method `seeResponseContainsJson` will convert provided array to json and check if response contains it.
6767

6868
You may want to perform more complex assertions of response. This can be done with writing your own methods in [Helper](http://codeception.com/docs/03-Modules#helpers) classes. To access the latest JSON response you will need to get `response` property of REST module. Let's demonstrate it with `seeResponseIsHtml` method:
6969

@@ -97,10 +97,10 @@ class_name: ApiGuy
9797
modules:
9898
enabled: [PhpBrowser, SOAP, ApiHelper]
9999
config:
100-
PhpBrowser:
100+
PhpBrowser:
101101
url: http://serviceapp/
102102
SOAP:
103-
endpoint: http://serviceapp/api/v1/
103+
endpoint: http://serviceapp/api/v1/
104104

105105
{% endhighlight %}
106106

@@ -126,7 +126,7 @@ will produce this XML header
126126

127127
{% endhighlight %}
128128

129-
Use `sendSoapRequest` method to define the body of your request.
129+
Use `sendSoapRequest` method to define the body of your request.
130130

131131
{% highlight php %}
132132

@@ -148,8 +148,6 @@ This call will be translated to XML:
148148
</soap:Body>
149149

150150
{% endhighlight %}
151-
?>
152-
```
153151

154152
And here is the list of sample assertions that can be used with SOAP.
155153

@@ -164,7 +162,7 @@ $I->seeSoapResponseContainsXPath('//result/user/name[@id=1]');
164162

165163
{% endhighlight %}
166164

167-
In case you don't want to write long XML strings, consider using [XmlBuilder](http://codeception.com/docs/reference/xmlbuilder) class. It will help you to build complex XMLs in jQuery-like style.
165+
In case you don't want to write long XML strings, consider using [XmlBuilder](http://codeception.com/docs/reference/xmlbuilder) class. It will help you to build complex XMLs in jQuery-like style.
168166
In next example we will use `XmlBuilder` (created from SoapUtils factory) instead of regular XMLs.
169167

170168
{% highlight php %}

docs/modules/Kohana.markdown

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,24 @@ $I->dontSeeLink('Logout'); // I suppose user is not logged in
279279
* param null $url
280280

281281

282+
#### dontSeeOptionIsSelected
283+
284+
285+
Checks if option is not selected in select field.
286+
287+
{% highlight php %}
288+
289+
<?php
290+
$I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
291+
?>
292+
293+
{% endhighlight %}
294+
295+
* param $selector
296+
* param $optionText
297+
* return mixed
298+
299+
282300
#### fillField
283301

284302

@@ -301,7 +319,7 @@ If no url provided returns full URI.
301319

302320
{% highlight php %}
303321

304-
<?php
322+
<?php
305323
$user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~');
306324
$uri = $I->grabFromCurrentUrl();
307325
?>
@@ -507,6 +525,24 @@ $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
507525
* param null $url
508526

509527

528+
#### seeOptionIsSelected
529+
530+
531+
Checks if option is selected in select field.
532+
533+
{% highlight php %}
534+
535+
<?php
536+
$I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
537+
?>
538+
539+
{% endhighlight %}
540+
541+
* param $selector
542+
* param $optionText
543+
* return mixed
544+
545+
510546
#### seePageNotFound
511547

512548

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