docs(library): pwt vs. library what browsers are installed (#16618)
This commit is contained in:
parent
1733fc3ad7
commit
c5f0265481
|
|
@ -117,6 +117,7 @@ The key differences to note are as follows:
|
|||
| | Library | Test |
|
||||
| - | - | - |
|
||||
| Installation | `npm install playwright` | `npm init playwright@latest` (note `install` vs. `init`) |
|
||||
| Install browsers | Chromium, Firefox, WebKit are installed by default | `npx playwright install` or `npx playwright install chromium` for a single one |
|
||||
| `import`/`require` name | `playwright` | `@playwright/test` |
|
||||
| Initialization | Explicitly need to: <ol><li>Pick a browser to use (e.g. `chromium`)</li><li>Create `browser` ([`method: BrowserType.launch`])</li><li>Create a `context` ([`method: Browser.newContext`]), <em>and</em> pass any context options explcitly (e.g. `devices['iPhone 11']`</li><li>Create a `page` ([`method: BrowserContext.newPage`])</li></ol> | An isolated `page` and `context` are provided to each test out-of the box (along with any other [built-in fixtures](./test-fixtures.md#built-in-fixtures)). No explicit creation. If referenced by the test in it's arguments, the Test Runner will create them for the test. (i.e. lazy-initialization) |
|
||||
| Assertions | No built-in Web-First Assertions | [Web-First assertions](./test-assertions.md) like: <ul><li>[`method: PageAssertions.toHaveTitle`]</li><li>[`method: PageAssertions.toHaveScreenshot#1`]</li></ul> which auto-wait and retry for the condition to be met.|
|
||||
|
|
|
|||
Loading…
Reference in a new issue