mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-27 21:58:52 +03:00
docs: update import in code example (#22591)
This commit is contained in:
parent
cbf4f39957
commit
f9eeaa2b75
@ -1857,7 +1857,7 @@ const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.
|
||||
const browser = await firefox.launch();
|
||||
const page = await browser.newPage();
|
||||
const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');
|
||||
page.setViewportSize({width: 50, height: 50});
|
||||
await page.setViewportSize({width: 50, height: 50});
|
||||
await watchDog;
|
||||
await browser.close();
|
||||
})();
|
||||
|
@ -14,7 +14,7 @@ Selectors must be registered before creating the page.
|
||||
An example of registering selector engine that queries elements based on a tag name:
|
||||
|
||||
```js
|
||||
const { selectors, firefox } = require('playwright'); // Or 'chromium' or 'webkit'.
|
||||
const { selectors, firefox } = require('@playwright/test'); // Or 'chromium' or 'webkit'.
|
||||
|
||||
(async () => {
|
||||
// Must be a function that evaluates to a selector engine instance.
|
||||
|
@ -236,7 +236,7 @@ This includes any config that needs to be run before or after mounting the compo
|
||||
```js
|
||||
// src/pages/ProductsPage.spec.tsx
|
||||
import { test, expect } from '@playwright/experimental-ct-react';
|
||||
import type { HooksConfig } from 'playwright';
|
||||
import type { HooksConfig } from '@playwright/test';
|
||||
import { ProductsPage } from './pages/ProductsPage';
|
||||
|
||||
test('configure routing through hooks config', async ({ page, mount }) => {
|
||||
@ -271,7 +271,7 @@ This includes any config that needs to be run before or after mounting the compo
|
||||
```js
|
||||
// src/pages/ProductsPage.spec.tsx
|
||||
import { test, expect } from '@playwright/experimental-ct-solid';
|
||||
import type { HooksConfig } from 'playwright';
|
||||
import type { HooksConfig } from '@playwright/test';
|
||||
import { ProductsPage } from './pages/ProductsPage';
|
||||
|
||||
test('configure routing through hooks config', async ({ page, mount }) => {
|
||||
@ -306,7 +306,7 @@ This includes any config that needs to be run before or after mounting the compo
|
||||
```js
|
||||
// src/pages/ProductsPage.spec.ts
|
||||
import { test, expect } from '@playwright/experimental-ct-vue';
|
||||
import type { HooksConfig } from 'playwright';
|
||||
import type { HooksConfig } from '@playwright/test';
|
||||
import ProductsPage from './pages/ProductsPage.vue';
|
||||
|
||||
test('configure routing through hooks config', async ({ page, mount }) => {
|
||||
@ -343,7 +343,7 @@ This includes any config that needs to be run before or after mounting the compo
|
||||
```js
|
||||
// src/pages/ProductsPage.spec.ts
|
||||
import { test, expect } from '@playwright/experimental-ct-vue2';
|
||||
import type { HooksConfig } from 'playwright';
|
||||
import type { HooksConfig } from '@playwright/test';
|
||||
import ProductsPage from './pages/ProductsPage.vue';
|
||||
|
||||
test('configure routing through hooks config', async ({ page, mount }) => {
|
||||
@ -599,7 +599,7 @@ Pinia needs to be initialized in `playwright/index.{js,ts,jsx,tsx}`. If you do t
|
||||
```js
|
||||
// src/pinia.spec.ts
|
||||
import { test, expect } from '@playwright/experimental-ct-vue';
|
||||
import type { HooksConfig } from 'playwright';
|
||||
import type { HooksConfig } from '@playwright/test';
|
||||
import Store from './Store.vue';
|
||||
|
||||
test('override initialState ', async ({ mount }) => {
|
||||
|
6
packages/playwright-core/types/types.d.ts
vendored
6
packages/playwright-core/types/types.d.ts
vendored
@ -5182,7 +5182,7 @@ export interface Frame {
|
||||
* const browser = await firefox.launch();
|
||||
* const page = await browser.newPage();
|
||||
* const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');
|
||||
* page.setViewportSize({width: 50, height: 50});
|
||||
* await page.setViewportSize({width: 50, height: 50});
|
||||
* await watchDog;
|
||||
* await browser.close();
|
||||
* })();
|
||||
@ -5216,7 +5216,7 @@ export interface Frame {
|
||||
* const browser = await firefox.launch();
|
||||
* const page = await browser.newPage();
|
||||
* const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');
|
||||
* page.setViewportSize({width: 50, height: 50});
|
||||
* await page.setViewportSize({width: 50, height: 50});
|
||||
* await watchDog;
|
||||
* await browser.close();
|
||||
* })();
|
||||
@ -18536,7 +18536,7 @@ export interface Selectors {
|
||||
* An example of registering selector engine that queries elements based on a tag name:
|
||||
*
|
||||
* ```js
|
||||
* const { selectors, firefox } = require('playwright'); // Or 'chromium' or 'webkit'.
|
||||
* const { selectors, firefox } = require('@playwright/test'); // Or 'chromium' or 'webkit'.
|
||||
*
|
||||
* (async () => {
|
||||
* // Must be a function that evaluates to a selector engine instance.
|
||||
|
Loading…
Reference in New Issue
Block a user