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
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
Panther is super powerful. It leverages [the W3C's WebDriver protocol](https://www.w3.org/TR/webdriver/) to drive native web browsers such as Google Chrome and Firefox.
10
10
11
-
Panther is very easy to use, because it implements Symfony's popular [BrowserKit](https://symfony.com/doc/current/components/browser_kit.html) and
11
+
Panther is very easy to use because it implements Symfony's popular [BrowserKit](https://symfony.com/doc/current/components/browser_kit.html) and
12
12
[DomCrawler](https://symfony.com/doc/current/components/dom_crawler.html) APIs, and contains
13
13
all the features you need to test your apps. It will sound familiar if you have ever created [a functional test for a Symfony app](https://symfony.com/doc/current/testing.html#functional-tests):
14
14
as the API is exactly the same!
@@ -17,14 +17,14 @@ Keep in mind that Panther can be used in every PHP project, as it is a standalon
17
17
Panther automatically finds your local installation of Chrome or Firefox and launches them,
18
18
so you don't need to install anything else on your computer, a Selenium server is not needed!
19
19
20
-
In test mode, Panther automatically starts your application using [the PHP built-in web-server](http://php.net/manual/en/features.commandline.webserver.php).
20
+
In test mode, Panther automatically starts your application using [the PHP built-in webserver](http://php.net/manual/en/features.commandline.webserver.php).
21
21
You can focus on writing your tests or web-scraping scenario and Panther will take care of everything else.
22
22
23
23
## Features
24
24
25
25
Unlike testing and web scraping libraries you're used to, Panther:
26
26
27
-
* executes the JavaScript code contained in webpages
27
+
* executes the JavaScript code contained in web pages
28
28
* supports everything that Chrome (or Firefox) implements
29
29
* allows taking screenshots
30
30
* can wait for asynchronously loaded elements to show up
@@ -76,7 +76,7 @@ or in the `drivers/` directory of your project.
76
76
77
77
If you intend to use Panther to test your application, we strongly recommend registering the Panther PHPUnit extension.
78
78
While not strictly mandatory, this extension dramatically improves the testing experience by boosting the performance and
79
-
allowing to use the [interactive debugging mode](#interactive-mode).
79
+
allowing to use of the [interactive debugging mode](#interactive-mode).
80
80
81
81
When using the extension in conjunction with the `PANTHER_ERROR_SCREENSHOT_DIR` environment variable, tests using the
82
82
Panther client that fail or error (after the client is created) will automatically get a screenshot taken to help
@@ -112,11 +112,11 @@ $client->request('GET', 'https://api-platform.com'); // Yes, this website is 100
112
112
$client->clickLink('Getting started');
113
113
114
114
// Wait for an element to be present in the DOM (even if hidden)
It is fast and is able to browse any webpage, not only the ones of the application under test.
204
+
It is fast and can browse any webpage, not only the ones of the application under test.
205
205
However, HttpBrowser doesn't support JavaScript and other advanced features because it is entirely written in PHP.
206
206
This one is available even for non-Symfony apps!
207
207
208
-
The fun part is that the 3 clients implement the exact same API, so you can switch from one to another just by calling
208
+
The fun part is that the 3 clients implement the same API, so you can switch from one to another just by calling
209
209
the appropriate factory method, resulting in a good trade-off for every single test case (Do I need JavaScript? Do I need
210
210
to authenticate with an external SSO server? Do I want to access the kernel of the current request? ... etc).
211
211
@@ -235,7 +235,7 @@ class E2eTest extends PantherTestCase
235
235
// When initializing a custom client, the integrated web server IS NOT started automatically.
236
236
// Use PantherTestCase::startWebServer() or WebServerManager if you want to start it manually.
237
237
238
-
// enjoy the same API for the 3 felines
238
+
// Enjoy the same API for the 3 felines.
239
239
// $*client->request('GET', '...')
240
240
241
241
$kernel = static::createKernel(); // If you are testing a Symfony app, you also have access to the kernel
@@ -247,10 +247,10 @@ class E2eTest extends PantherTestCase
247
247
248
248
### Creating Isolated Browsers to Test Apps Using [Mercure](https://mercure.rocks) or WebSocket
249
249
250
-
Panther provides a convenient way to test applications with real-time capabilities which use [Mercure](https://symfony.com/doc/current/mercure.html), [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
250
+
Panther provides a convenient way to test applications with real-time capabilities that use [Mercure](https://symfony.com/doc/current/mercure.html), [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
251
251
and similar technologies.
252
252
253
-
`PantherTestCase::createAdditionalPantherClient()` creates additional, isolated browsers which can interact with each other.
253
+
`PantherTestCase::createAdditionalPantherClient()` creates additional, isolated browsers that can interact with each other.
254
254
For instance, this can be useful to test a chat application having several users connected simultaneously:
255
255
256
256
```php
@@ -347,15 +347,15 @@ Use the `Client::ping()` method to check if the WebDriver connection is still ac
347
347
348
348
## Additional Documentation
349
349
350
-
Since Panther implements the API of popular libraries, it already has an extensive documentation:
350
+
Since Panther implements the API of popular libraries, it already has extensive documentation:
351
351
352
352
* For the `Client` class, read [the BrowserKit documentation](https://symfony.com/doc/current/components/browser_kit.html)
353
353
* For the `Crawler` class, read [the DomCrawler documentation](https://symfony.com/doc/current/components/dom_crawler.html)
354
354
* For WebDriver, read [the PHP WebDriver documentation](https://github.com/php-webdriver/php-webdriver)
355
355
356
356
### Environment Variables
357
357
358
-
The following environment variables can be set to change some Panther's behaviour:
358
+
The following environment variables can be set to change some Panther's behavior:
359
359
360
360
*`PANTHER_NO_HEADLESS`: to disable the browser's headless mode (will display the testing window, useful to debug)
361
361
*`PANTHER_WEB_SERVER_DIR`: to change the project's document root (default to `./public/`, relative paths **must start** by `./`)
@@ -398,9 +398,9 @@ the complete contents of the tag, including the tag itself.
398
398
399
399
### Interactive Mode
400
400
401
-
Panther can make a pause in your tests suites after a failure.
401
+
Panther can make a pause in your test suites after a failure.
402
402
It is a break time really appreciated for investigating the problem through the web browser.
403
-
For enabling this mode, you need the `--debug` PHPUnit option without the headless mode:
403
+
To enable this mode, you need the `--debug` PHPUnit option without the headless mode:
404
404
405
405
$ PANTHER_NO_HEADLESS=1 bin/phpunit --debug
406
406
@@ -428,7 +428,7 @@ class E2eTest extends PantherTestCase
0 commit comments