diff --git a/docs/src/test-components-js.md b/docs/src/test-components-js.md index e6b6db3796..99ac853228 100644 --- a/docs/src/test-components-js.md +++ b/docs/src/test-components-js.md @@ -264,9 +264,17 @@ test('…', async { mount, page, context } => { `@playwright/experimental-ct-{react,svelte,vue}` wrap `@playwright/test` to provide an additional built-in component-testing specific fixture called `mount`: -
-React Example -
+
+
+
+```js
 import { test, expect } from '@playwright/experimental-ct-react'
 
 import HelloWorld from './HelloWorld.tsx'
@@ -276,12 +284,14 @@ test.use({ viewport: { width: 500, height: 500 } })
 test('should work', async ({ mount }) => {
   const component = await mount();
   await expect(component).toContainText('Greetings')
-})
-
+}) +``` -
-Vue Example -
+
+
+
+
+```js
 import { test, expect } from '@playwright/experimental-ct-vue'
 
 import HelloWorld from './HelloWorld.vue'
@@ -295,12 +305,14 @@ test('should work', async ({ mount }) => {
     }
   });
   await expect(component).toContainText('Greetings')
-})
-
+}) +``` -
-Svelte Example -
+
+  
+
+
+```js
 import { test, expect } from '@playwright/experimental-ct-vue'
 
 import NamedSlots from './NamedSlots.vue'
@@ -318,9 +330,12 @@ test('named slots should work', async ({ mount }) => {
   await expect(component).toContainText('Header')
   await expect(component).toContainText('Main Content')
   await expect(component).toContainText('Footer')
-})
-
+}) +``` + + + Additionally, it adds some config options you can use in your `playwright-ct.config.{ts,js}`.