Skip to content

Commit f7284d5

Browse files
committed
fix: add comment about this in custom commands
1 parent fe2c75d commit f7284d5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

docs/guides/custom-commands.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ To add a custom command to the `browser` object, use the `addCommand` method. He
2727

2828
```typescript
2929
browser.addCommand("getUrlAndTitle", async function () {
30+
// this in the context of custom commands points to browser object
3031
return {
3132
url: await this.getUrl(),
3233
title: await this.getTitle(),

i18n/ru/docusaurus-plugin-content-docs/current/guides/custom-commands.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import AddElementCommandExample from "@site/docs/config/_partials/examples/_prep
2727

2828
```typescript
2929
browser.addCommand("getUrlAndTitle", async function () {
30+
// this в контексте кастомных команд указывает на объект браузера
3031
return {
3132
url: await this.getUrl(),
3233
title: await this.getTitle(),

0 commit comments

Comments
 (0)