Skip to content

Commit 7c47014

Browse files
rpayanmdunglas
andauthored
docs: fix README.md example and typos (#647)
Co-authored-by: Kévin Dunglas <[email protected]>
1 parent c136f5f commit 7c47014

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

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
1212
[DomCrawler](https://symfony.com/doc/current/components/dom_crawler.html) APIs, and contains
1313
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):
1414
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
1717
Panther automatically finds your local installation of Chrome or Firefox and launches them,
1818
so you don't need to install anything else on your computer, a Selenium server is not needed!
1919

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 web server](http://php.net/manual/en/features.commandline.webserver.php).
2121
You can focus on writing your tests or web-scraping scenario and Panther will take care of everything else.
2222

2323
## Features
2424

2525
Unlike testing and web scraping libraries you're used to, Panther:
2626

27-
* executes the JavaScript code contained in webpages
27+
* executes the JavaScript code contained in web pages
2828
* supports everything that Chrome (or Firefox) implements
2929
* allows taking screenshots
3030
* can wait for asynchronously loaded elements to show up
@@ -76,7 +76,7 @@ or in the `drivers/` directory of your project.
7676

7777
If you intend to use Panther to test your application, we strongly recommend registering the Panther PHPUnit extension.
7878
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).
8080

8181
When using the extension in conjunction with the `PANTHER_ERROR_SCREENSHOT_DIR` environment variable, tests using the
8282
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
112112
$client->clickLink('Getting started');
113113

114114
// Wait for an element to be present in the DOM (even if hidden)
115-
$crawler = $client->waitFor('#installing-the-framework');
115+
$crawler = $client->waitFor('#bootstrapping-the-core-library');
116116
// Alternatively, wait for an element to be visible
117-
$crawler = $client->waitForVisibility('#installing-the-framework');
117+
$crawler = $client->waitForVisibility('#bootstrapping-the-core-library');
118118

119-
echo $crawler->filter('#installing-the-framework')->text();
119+
echo $crawler->filter('div:has(> #bootstrapping-the-core-library)')->text();
120120
$client->takeScreenshot('screen.png'); // Yeah, screenshot!
121121
```
122122

@@ -201,11 +201,11 @@ Two alternative clients are available:
201201
* The second leverages Symfony's [HttpBrowser](https://symfony.com/doc/4.4/components/browser_kit.html#making-external-http-requests).
202202
It is an intermediate between Symfony's kernel and Panther's test clients. HttpBrowser sends real HTTP requests using
203203
Symfony's [HttpClient](https://symfony.com/doc/current/components/http_client.html) component.
204-
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.
205205
However, HttpBrowser doesn't support JavaScript and other advanced features because it is entirely written in PHP.
206206
This one is available even for non-Symfony apps!
207207

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
209209
the appropriate factory method, resulting in a good trade-off for every single test case (Do I need JavaScript? Do I need
210210
to authenticate with an external SSO server? Do I want to access the kernel of the current request? ... etc).
211211

@@ -235,7 +235,7 @@ class E2eTest extends PantherTestCase
235235
// When initializing a custom client, the integrated web server IS NOT started automatically.
236236
// Use PantherTestCase::startWebServer() or WebServerManager if you want to start it manually.
237237

238-
// enjoy the same API for the 3 felines
238+
// Enjoy the same API for the 3 felines.
239239
// $*client->request('GET', '...')
240240

241241
$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
247247

248248
### Creating Isolated Browsers to Test Apps Using [Mercure](https://mercure.rocks) or WebSocket
249249

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)
251251
and similar technologies.
252252

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.
254254
For instance, this can be useful to test a chat application having several users connected simultaneously:
255255

256256
```php
@@ -347,15 +347,15 @@ Use the `Client::ping()` method to check if the WebDriver connection is still ac
347347

348348
## Additional Documentation
349349

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:
351351

352352
* For the `Client` class, read [the BrowserKit documentation](https://symfony.com/doc/current/components/browser_kit.html)
353353
* For the `Crawler` class, read [the DomCrawler documentation](https://symfony.com/doc/current/components/dom_crawler.html)
354354
* For WebDriver, read [the PHP WebDriver documentation](https://github.com/php-webdriver/php-webdriver)
355355

356356
### Environment Variables
357357

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:
359359

360360
* `PANTHER_NO_HEADLESS`: to disable the browser's headless mode (will display the testing window, useful to debug)
361361
* `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.
398398

399399
### Interactive Mode
400400

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.
402402
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:
404404

405405
$ PANTHER_NO_HEADLESS=1 bin/phpunit --debug
406406

@@ -428,7 +428,7 @@ class E2eTest extends PantherTestCase
428428
public function testMyApp(): void
429429
{
430430
$pantherClient = static::createPantherClient(['external_base_uri' => 'https://localhost']);
431-
// the PHP integrated web server will not be started
431+
// The integrated web server will not be started
432432
}
433433
}
434434
```
@@ -442,7 +442,7 @@ processes if you write several tests using Panther for different domain names.
442442

443443
To do so, you can use the native `@runInSeparateProcess` PHPUnit annotation.
444444

445-
**ℹ Note:** it is really convenient to use the `external_base_uri` option and start your own webserver in the background,
445+
**ℹ Note:** It is really convenient to use the `external_base_uri` option and start your own webserver in the background
446446
because Panther will not have to start and stop your server on each test. [Symfony CLI](https://symfony.com/download) can
447447
be a quick and easy way to do so.
448448

@@ -583,7 +583,7 @@ Here is a minimal `.travis.yml` file to run Panther tests:
583583
```yaml
584584
language: php
585585
addons:
586-
# If you don't use Chrome, or Firefox, remove the corresponding line
586+
# If you don't use Chrome or Firefox, remove the corresponding line
587587
chrome: stable
588588
firefox: latest
589589
@@ -656,7 +656,7 @@ test_script:
656656
If you want to use Panther with other testing tools like [LiipFunctionalTestBundle](https://github.com/liip/LiipFunctionalTestBundle)
657657
or if you just need to use a different base class, Panther has got you covered.
658658
It provides you with the `Symfony\Component\Panther\PantherTestCaseTrait` and you can use it to enhance your existing
659-
test-infrastructure with some Panther awesomeness:
659+
test infrastructure with some Panther awesomeness:
660660

661661
```php
662662
<?php
@@ -688,7 +688,7 @@ The following features are not currently supported:
688688
* Updating existing documents (browsers are mostly used to consume data, not to create webpages)
689689
* Setting form values using the multidimensional PHP array syntax
690690
* Methods returning an instance of `\DOMElement` (because this library uses `WebDriverElement` internally)
691-
* Selecting invalid choices in select
691+
* Selecting invalid choices in the select
692692

693693
Pull Requests are welcome to fill the remaining gaps!
694694

0 commit comments

Comments
 (0)