Skip to content

Commit 456fae2

Browse files
author
rocketraccoon
committed
docs: base url end
1 parent 0e9f4c1 commit 456fae2

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

docs/commands/browser/url.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ console.log(await browser.getUrl()); // outputs: "https://webdriver.io"
4141
**baseUrlResolutions.js**
4242

4343
```javascript
44-
// Let baseUrl = http://example.com/site
44+
// Let baseUrl = http://example.com/site/ important add a slash in the end
4545

4646
// Specifying a full URL results in https://webdriver.io
4747
await browser.url("https://webdriver.io");

docs/reference/config/browsers.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Base URL of the service being tested. Allows for more convenient use of the `bro
151151

152152
- if the target address starts with `/`, `baseUrl` without the path part will be added at the beginning.
153153
- if the target address does not start with `/`, the entire `baseUrl` will be added at the beginning.
154+
- it is important whether `/` exists (or not). [See more][url-resolve].
154155

155156
Default: `http://localhost`.
156157

@@ -1195,3 +1196,4 @@ export = {
11951196
[saveState]: ../../../commands/browser/saveState
11961197
[restoreState]: ../../../commands/browser/restoreState
11971198
[getState]: ../../../commands/browser/getState
1199+
[url-resolve]: https://nodejs.org/api/url.html#urlresolvefrom-to

i18n/ru/docusaurus-plugin-content-docs/current/commands/browser/url.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ console.log(await browser.getUrl()); // выведет: "https://webdriver.io"
4141
**baseUrlResolutions.js**
4242

4343
```javascript
44-
// Пусть baseUrl = http://example.com/site
44+
// Пусть baseUrl = http://example.com/site/ важно указывать слэш в конце
4545

4646
// При указании полного URL-адреса итоговый URL будет https://webdriver.io
4747
await browser.url("https://webdriver.io");

i18n/ru/docusaurus-plugin-content-docs/current/reference/config/browsers.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ URL грида (адрес, на котором слушает ChromeDriver/Sele
149149

150150
- если целевой адрес начинается с `/`, в начало будет добавлен `baseUrl` без path-части.
151151
- если целевой адрес не начинается с `/`, в начало будет добавлен весь `baseUrl`.
152+
- важно наличие или отсутствие `/` в конце. [Подробнее][url-resolve].
152153

153154
По умолчанию: `http://localhost`.
154155

0 commit comments

Comments
 (0)