Skip to content

Commit 70d4c2e

Browse files
authored
docs(browser): add render libraries examples (#9325)
1 parent 090064f commit 70d4c2e

5 files changed

Lines changed: 860 additions & 20 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -594,24 +594,6 @@ export default ({ mode }: { mode: string }) => {
594594
},
595595
],
596596
},
597-
// {
598-
// text: 'Render Function',
599-
// collapsed: true,
600-
// items: [
601-
// {
602-
// text: 'react',
603-
// link: '/config/browser/react',
604-
// },
605-
// {
606-
// text: 'vue',
607-
// link: '/config/browser/vue',
608-
// },
609-
// {
610-
// text: 'svelte',
611-
// link: '/config/browser/svelte',
612-
// },
613-
// ],
614-
// },
615597
{
616598
text: 'browser.enabled',
617599
link: '/config/browser/enabled',
@@ -1007,6 +989,28 @@ export default ({ mode }: { mode: string }) => {
1007989
{
1008990
text: 'Browser Mode',
1009991
items: [
992+
{
993+
text: 'Render Function',
994+
collapsed: false,
995+
items: [
996+
{
997+
text: 'react',
998+
link: '/api/browser/react',
999+
},
1000+
{
1001+
text: 'vue',
1002+
link: '/api/browser/vue',
1003+
},
1004+
{
1005+
text: 'svelte',
1006+
link: '/api/browser/svelte',
1007+
},
1008+
// {
1009+
// text: 'angular',
1010+
// link: '/api/browser/angular',
1011+
// },
1012+
],
1013+
},
10101014
{
10111015
text: 'Context',
10121016
link: '/api/browser/context',

docs/api/browser/locators.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,10 @@ This method returns a single element matching the locator's selector or `null` i
830830

831831
If multiple elements match the selector, this method will throw an error. Use [`.elements()`](#elements) when you need all matching DOM Elements or [`.all()`](#all) if you need an array of locators matching the selector.
832832

833+
::: danger
834+
This is an escape hatch for external APIs that do not support locators. Prefer using locator methods instead.
835+
:::
836+
833837
Consider the following DOM structure:
834838

835839
```html
@@ -866,8 +870,10 @@ If _no element_ matches the selector, an error is thrown. Consider using [`.quer
866870

867871
If _multiple elements_ match the selector, an error is thrown. Use [`.elements()`](#elements) when you need all matching DOM Elements or [`.all()`](#all) if you need an array of locators matching the selector.
868872

869-
::: tip
870-
This method can be useful if you need to pass it down to an external library. It is called automatically when locator is used with `expect.element` every time the assertion is [retried](/api/browser/assertions):
873+
::: danger
874+
This is an escape hatch for external APIs that do not support locators. Prefer using locator methods instead.
875+
876+
It is called automatically when locator is used with `expect.element` every time the assertion is [retried](/api/browser/assertions):
871877

872878
```ts
873879
await expect.element(page.getByRole('button')).toBeDisabled()

0 commit comments

Comments
 (0)