docs(ct): general improvements (#17923)
This commit is contained in:
parent
aad0fd9bdf
commit
842dec334d
|
|
@ -110,7 +110,7 @@ import App from './App';
|
||||||
test.use({ viewport: { width: 500, height: 500 } });
|
test.use({ viewport: { width: 500, height: 500 } });
|
||||||
|
|
||||||
test('should work', async ({ mount }) => {
|
test('should work', async ({ mount }) => {
|
||||||
const component = await mount(<App></App>);
|
const component = await mount(<App />);
|
||||||
await expect(component).toContainText('Learn React');
|
await expect(component).toContainText('Learn React');
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
@ -126,7 +126,7 @@ import App from './App.vue';
|
||||||
test.use({ viewport: { width: 500, height: 500 } });
|
test.use({ viewport: { width: 500, height: 500 } });
|
||||||
|
|
||||||
test('should work', async ({ mount }) => {
|
test('should work', async ({ mount }) => {
|
||||||
const component = await mount(<App></App>);
|
const component = await mount(<App />);
|
||||||
await expect(component).toContainText('Vite + Vue');
|
await expect(component).toContainText('Vite + Vue');
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
@ -155,6 +155,22 @@ test('should work', async ({ mount }) => {
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem value="solid">
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { test, expect } from '@playwright/experimental-ct-solid';
|
||||||
|
import App from './App';
|
||||||
|
|
||||||
|
test.use({ viewport: { width: 500, height: 500 } });
|
||||||
|
|
||||||
|
test('should work', async ({ mount }) => {
|
||||||
|
const component = await mount(<App />);
|
||||||
|
await expect(component).toContainText('Learn Solid');
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -362,7 +378,7 @@ Yes. Use a Playwright Config for each and follow their respective guides ([E2E P
|
||||||
This is a [known issue](https://github.com/microsoft/playwright/issues/14401). The following pattern does not work:
|
This is a [known issue](https://github.com/microsoft/playwright/issues/14401). The following pattern does not work:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const app = <App></App>;
|
const app = <App />;
|
||||||
await mount(app);
|
await mount(app);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -375,7 +391,7 @@ undefined: TypeError: Cannot read properties of undefined (reading 'map')
|
||||||
while this works:
|
while this works:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
await mount(<App></App>);
|
await mount(<App />);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Q) How can I use Vite plugins?
|
### Q) How can I use Vite plugins?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue