Skip to content

Commit

Permalink
updated readme to remove auto-start option
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Oct 21, 2024
1 parent 73fd994 commit da7361a
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Most common config values are:
* `browser` - either `chromium`, `firefox`, `webkit`
* `show` - (default: `true`) to show browser or set to `false` to run tests in headless mode
* `timeout` - (default: `5000`) timeout (in ms) for all Playwright operations
* `pw_start` - (default: `true`) start Playwright Server (Proxy to CodeceptJS) automatically. Set to `false` and run server manually in case server doesn't start.
* `pw_server` - (default: 'http://localhost:8191') url of Playwright Server
* `pw_debug` - (default: `false`) print Playwright Server debug information
* `video` - save video on fail
Expand All @@ -68,28 +67,29 @@ More configuration options are is listed on [CodeceptJS Playwright page](https:/

## Usage

Playwright module requires NodeJS server to be running. Playwright module will start it and stop automatically. Default port is **8191**.
Playwright module requires NodeJS server to be running. Start the server manually:

If you want to disable automatic server start, set `start` option to `false`:
```
npx codeception-playwright-module
```

If you want to start server automatically, use [RunProcess extension](https://codeception.com/extensions#RunProcess) from Codeception

```yaml
modules:
extensions:
enabled:
- Playwright:
url: 'http://localhost'
browser: 'chromium'
show: true
pw_start: false
- Codeception\Extension\RunProcess:
0: npx codeception-playwright-module
sleep: 3 # wait 5 seconds for processes to boot
```

In this case you can start the server manually:
If you start server on different host or port, run port with `--port` option:

```bash
npx codeception-playwright-module
```
Please check that server can be started with no issues.
npx codeception-playwright-module --playwright 9999
```

If you start server on different host or port, you can configure it:
And pass port to config

```yaml
modules:
Expand All @@ -98,7 +98,6 @@ modules:
url: 'http://localhost'
browser: 'chromium'
show: true
pw_start: false
pw_server: http://otherhost:8191
```

Expand All @@ -116,6 +115,8 @@ Playwright-specific commands are also available in [CodeceptJS Playwright Helper
$I->amOnPage('/');
$I->click('#first .clickable');
$I->dontSeeInTitle('Error');
$I->fillField('Username', 'John');
$I->fillField('Password', '1233456');
$I->see('Hello, world!');
```

Expand Down

0 comments on commit da7361a

Please sign in to comment.