docs: clarify webServer ipv4/ipv6 and baseURL protocol (#10610)

This commit is contained in:
Max Schmitt 2021-11-30 20:01:28 +01:00 committed by GitHub
parent 682d1f41c7
commit 3337920c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

View file

@ -206,7 +206,7 @@ export const test = base.extend<{ saveLogs: void }>({
To launch a server during the tests, use the `webServer` option in the [configuration file](#configuration-object).
You can specify a port via `port` or additional environment variables, see [here](#configuration-object). The server will wait for it to be available before running the tests. For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI.
You can specify a port via `port` or additional environment variables, see [here](#configuration-object). The server will wait for it to be available (on `127.0.0.1` or `::1`) before running the tests. For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI.
The port gets then passed over to Playwright as a [`param: baseURL`] when creating the context [`method: Browser.newContext`].

View file

@ -567,9 +567,11 @@ export default config;
Launch a development web server during the tests.
The server will wait for it to be available before running the tests. For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI.
The server will wait for it to be available on `127.0.0.1` or `::1` before running the tests. For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI.
The port gets then passed over to Playwright as a `baseURL` when creating the context [`method: Browser.newContext`].
For example `8080` ends up in `baseURL` to be `http://localhost:8080`. If you want to use `https://` you need to manually specify
the `baseURL` inside `use`.
```js js-flavor=ts
// playwright.config.ts

View file

@ -570,11 +570,14 @@ interface TestConfig {
/**
* Launch a development web server during the tests.
*
* The server will wait for it to be available before running the tests. For continuous integration, you may want to use
* the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI.
* The server will wait for it to be available on `127.0.0.1` or `::1` before running the tests. For continuous
* integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server
* on the CI.
*
* The port gets then passed over to Playwright as a `baseURL` when creating the context
* [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context).
* [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context). For example `8080`
* ends up in `baseURL` to be `http://localhost:8080`. If you want to use `https://` you need to manually specify the
* `baseURL` inside `use`.
*
* ```ts
* // playwright.config.ts
@ -1056,11 +1059,14 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* Launch a development web server during the tests.
*
* The server will wait for it to be available before running the tests. For continuous integration, you may want to use
* the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI.
* The server will wait for it to be available on `127.0.0.1` or `::1` before running the tests. For continuous
* integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server
* on the CI.
*
* The port gets then passed over to Playwright as a `baseURL` when creating the context
* [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context).
* [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context). For example `8080`
* ends up in `baseURL` to be `http://localhost:8080`. If you want to use `https://` you need to manually specify the
* `baseURL` inside `use`.
*
* ```ts
* // playwright.config.ts