Skip to content

Commit 07891ac

Browse files
authored
Improve README.md
1 parent 401e952 commit 07891ac

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -127,33 +127,6 @@ class E2eTest extends PantherTestCase
127127
}
128128
```
129129

130-
### Usage with Other Testing Tools
131-
132-
If you want to use Panther with other testing tools like [LiipFunctionalTestBundle](https://github.com/liip/LiipFunctionalTestBundle) or if you just need to use a different base class, Panther has got you covered. It provides you with the `Symfony\Component\Panther\PantherTestCaseTrait` and you can use it to enhance your existing test-infrastructure with some Panther awesomeness:
133-
134-
```php
135-
<?php
136-
137-
namespace App\Tests\Controller;
138-
139-
use Liip\FunctionalTestBundle\Test\WebTestCase;
140-
use Symfony\Component\HttpFoundation\Response;
141-
use Symfony\Component\Panther\PantherTestCaseTrait;
142-
143-
class DefaultControllerTest extends WebTestCase
144-
{
145-
use PantherTestCaseTrait; // this is the magic. Panther is now available.
146-
147-
public function testWithFixtures()
148-
{
149-
$this->loadFixtures([]); // load your fixtures
150-
$client = self::createPantherClient(); // create your panther client
151-
152-
$client->request('GET', '/');
153-
}
154-
}
155-
```
156-
157130
## Features
158131

159132
Unlike testing and web scraping libraries you're used to, Panther:
@@ -166,7 +139,15 @@ Unlike testing and web scraping libraries you're used to, Panther:
166139
* supports custom [Selenium server](https://www.seleniumhq.org) installations
167140
* supports remote browser testing services including [SauceLabs](https://saucelabs.com/) and [BrowserStack](https://www.browserstack.com/)
168141

169-
### Improve Performances by Having a Persistent Web Server Running
142+
## Documentation
143+
144+
Since Panther implements the API of popular libraries, it already has an extensive documentation:
145+
146+
* For the `Client` class, read [the BrowserKit's documentation](https://symfony.com/doc/current/components/browser_kit.html)
147+
* For the `Crawler` class, read [the DomCrawler's documentation](https://symfony.com/doc/current/components/dom_crawler.html)
148+
* For Webdriver, read [the Facebook's PHP WebDriver documentation](https://github.com/facebook/php-webdriver)
149+
150+
### Improve Performances by Having a Persistent Web Server Running
170151

171152
When you use the Panther client, the web server running in background will be started on demand at the first call to
172153
`createPantherClient()`, `createGoutteClient()` or `startWebServer()` and it will be stopped at `tearDownAfterClass()`.
@@ -195,19 +176,11 @@ anterior PHPUnit version, you can also hook to PHPUnit with the Panther's server
195176

196177
This listener will start the web server on demand like previously, but it will stop it after each test suite.
197178

198-
## Documentation
179+
### Hidden Text
199180

200-
Since Panther implements the API of popular libraries, it already has an extensive documentation:
181+
Webdriver returns only the displayed text. When you filter on head tag (like `title`), the method `text()` returns an empty string. Use the method `html()` method to get the complete contents of the tag (including the tag itself).
201182

202-
* For the `Client` class, read [the BrowserKit's documentation](https://symfony.com/doc/current/components/browser_kit.html)
203-
* For the `Crawler` class, read [the DomCrawler's documentation](https://symfony.com/doc/current/components/dom_crawler.html)
204-
* For Webdriver, read [the Facebook's PHP WebDriver documentation](https://github.com/facebook/php-webdriver)
205-
206-
## Notice
207-
208-
* Webdriver returns only the displayed text. When you filter on head tag (like `title`), the method `text()` returns an empty string. Use the method `html()` method to get the complete contents of the tag (including the tag itself).
209-
210-
## Environment Variables
183+
### Environment Variables
211184

212185
The following environment variables can be set to change some Panther behaviors:
213186

@@ -219,7 +192,7 @@ The following environment variables can be set to change some Panther behaviors:
219192
* `PANTHER_WEB_SERVER_PORT`: to change the web server's port (default to `9080`)
220193
* `PANTHER_WEB_SERVER_ROUTER`: to use a web server router script which is run at the start of each HTTP request
221194

222-
## Docker Integration
195+
### Docker Integration
223196

224197
Here is a minimal Docker image that can run Panther:
225198

@@ -233,7 +206,7 @@ ENV PANTHER_NO_SANDBOX 1
233206
Build it with `docker build . -t myproject`
234207
Run it with `docker run -it -v "$PWD":/srv/myproject -w /srv/myproject myproject bin/phpunit`
235208

236-
## Travis CI Integration
209+
### Travis CI Integration
237210

238211
Panther will work out of the box with Travis if you add the Chrome addon. Here is a minimal `.travis.yml` file to run
239212
Panther tests:
@@ -250,7 +223,7 @@ script:
250223
- phpunit
251224
```
252225
253-
## AppVeyor Integration
226+
### AppVeyor Integration
254227
255228
Panther will work out of the box with AppVeyor as long as Google Chrome is installed. Here is a minimal `appveyor.yml`
256229
file to run Panther tests:
@@ -283,6 +256,33 @@ test_script:
283256
- php vendor\phpunit\phpunit\phpunit
284257
```
285258

259+
### Usage with Other Testing Tools
260+
261+
If you want to use Panther with other testing tools like [LiipFunctionalTestBundle](https://github.com/liip/LiipFunctionalTestBundle) or if you just need to use a different base class, Panther has got you covered. It provides you with the `Symfony\Component\Panther\PantherTestCaseTrait` and you can use it to enhance your existing test-infrastructure with some Panther awesomeness:
262+
263+
```php
264+
<?php
265+
266+
namespace App\Tests\Controller;
267+
268+
use Liip\FunctionalTestBundle\Test\WebTestCase;
269+
use Symfony\Component\HttpFoundation\Response;
270+
use Symfony\Component\Panther\PantherTestCaseTrait;
271+
272+
class DefaultControllerTest extends WebTestCase
273+
{
274+
use PantherTestCaseTrait; // this is the magic. Panther is now available.
275+
276+
public function testWithFixtures()
277+
{
278+
$this->loadFixtures([]); // load your fixtures
279+
$client = self::createPantherClient(); // create your panther client
280+
281+
$client->request('GET', '/');
282+
}
283+
}
284+
```
285+
286286
## Limitations
287287

288288
The following features are not currently supported:

0 commit comments

Comments
 (0)