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: README.md
+42-42Lines changed: 42 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -127,33 +127,6 @@ class E2eTest extends PantherTestCase
127
127
}
128
128
```
129
129
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
-
157
130
## Features
158
131
159
132
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:
* supports remote browser testing services including [SauceLabs](https://saucelabs.com/) and [BrowserStack](https://www.browserstack.com/)
168
141
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
170
151
171
152
When you use the Panther client, the web server running in background will be started on demand at the first call to
172
153
`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
195
176
196
177
This listener will start the web server on demand like previously, but it will stop it after each test suite.
197
178
198
-
##Documentation
179
+
### Hidden Text
199
180
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).
201
182
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
211
184
212
185
The following environment variables can be set to change some Panther behaviors:
213
186
@@ -219,7 +192,7 @@ The following environment variables can be set to change some Panther behaviors:
219
192
*`PANTHER_WEB_SERVER_PORT`: to change the web server's port (default to `9080`)
220
193
*`PANTHER_WEB_SERVER_ROUTER`: to use a web server router script which is run at the start of each HTTP request
221
194
222
-
## Docker Integration
195
+
###Docker Integration
223
196
224
197
Here is a minimal Docker image that can run Panther:
225
198
@@ -233,7 +206,7 @@ ENV PANTHER_NO_SANDBOX 1
233
206
Build it with `docker build . -t myproject`
234
207
Run it with `docker run -it -v "$PWD":/srv/myproject -w /srv/myproject myproject bin/phpunit`
235
208
236
-
## Travis CI Integration
209
+
###Travis CI Integration
237
210
238
211
Panther will work out of the box with Travis if you add the Chrome addon. Here is a minimal `.travis.yml` file to run
239
212
Panther tests:
@@ -250,7 +223,7 @@ script:
250
223
- phpunit
251
224
```
252
225
253
-
## AppVeyor Integration
226
+
### AppVeyor Integration
254
227
255
228
Panther will work out of the box with AppVeyor as long as Google Chrome is installed. Here is a minimal `appveyor.yml`
256
229
file to run Panther tests:
@@ -283,6 +256,33 @@ test_script:
283
256
- php vendor\phpunit\phpunit\phpunit
284
257
```
285
258
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
+
286
286
## Limitations
287
287
288
288
The following features are not currently supported:
0 commit comments