File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
i18n/en/docusaurus-plugin-content-docs/current/commands/browser Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,24 @@ import Admonition from "@theme/Admonition";
1212
1313<Admonition type = " warning" >Команда _ newWindow_ не работает в мобильных окружениях (!)</Admonition >
1414
15+ <Admonition type = " warning" >
16+ Команда может не работать c _ devtools_ протоколом. Также она не дожидается загрузки страницы.
17+ Чтобы решить эти проблемы, рекомендуется перезаписать команду (на стороне Testplane это будет сделано в версии 9.0.0):
18+ ```javascript
19+ browser.overwriteCommand("newWindow", async function(pageUrl) {
20+ if (browser .isDevTools ) {
21+ const puppeteer = await browser .getPuppeteer ();
22+ await puppeteer.newPage();
23+ } else {
24+ await browser.newWindow(" about:blank" );
25+ }
26+
27+ await browser.url(pageUrl);
28+ });
29+ ` ` `
30+
31+ </Admonition>
32+
1533## Использование {#usage}
1634
1735` ` ` javascript
Original file line number Diff line number Diff line change @@ -14,6 +14,24 @@ Note that this command will automatically switch you to the new window upon exec
1414 The _ newWindow_ command does not work in mobile environments (!)
1515</Admonition >
1616
17+ <Admonition type = " warning" >
18+ The command might not work with _ devtools_ protocol. It also does not wait untill page load.
19+ In order to fix these problems, it is recommended to overwrite the command (on the Testplane side it would be done in version 9.0.0):
20+ ```javascript
21+ browser.overwriteCommand("newWindow", async function(pageUrl) {
22+ if (browser .isDevTools ) {
23+ const puppeteer = await browser .getPuppeteer ();
24+ await puppeteer.newPage();
25+ } else {
26+ await browser.newWindow(" about:blank" );
27+ }
28+
29+ await browser.url(pageUrl);
30+ });
31+ ` ` `
32+
33+ </Admonition>
34+
1735## Usage {#usage}
1836
1937` ` ` javascript
You can’t perform that action at this time.
0 commit comments