Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions blog/local-browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import localBrowsersExampleUrl from "/video/blog/local-browsers/local-browsers-e

<!-- truncate -->

Раньше Testplane с протоколом автоматизации webdriver можно было запустить локально только с вручную запущенным [selenium-standalone](https://github.com/webdriverio/selenium-standalone). Теперь достаточно указать `gridUrl: "local"` в [Конфиге Testplane](/docs/v8/command-line) или запустить тесты с [CLI-опцией](/docs/v8/command-line) `--local`. В таком случае перед запуском тестов при необходимости будут загружены соответствующие браузеры и вебдрайверы к ним, которые также будут запущены для дальнейшего использования в этих тестах.
Раньше Testplane с протоколом автоматизации webdriver можно было запустить локально только с вручную запущенным [selenium-standalone](https://github.com/webdriverio/selenium-standalone). Теперь достаточно указать `gridUrl: "local"` в [Конфиге Testplane](/docs/v8/reference/config/main) или запустить тесты с [CLI-опцией](/docs/v8/reference/cli) `--local`. В таком случае перед запуском тестов при необходимости будут загружены соответствующие браузеры и вебдрайверы к ним, которые также будут запущены для дальнейшего использования в этих тестах.

Загрузить браузеры и вебдрайверы к ним можно и отдельно, с помощью команды [install-deps](/docs/v8/command-line#install-deps).
Загрузить браузеры и вебдрайверы к ним можно и отдельно, с помощью команды [install-deps](/docs/v8/reference/cli#install-deps).

Пример запуска тестов на локальном браузере с webdriver протоколом автоматизации:

Expand All @@ -25,4 +25,4 @@ import localBrowsersExampleUrl from "/video/blog/local-browsers/local-browsers-e

### Как использовать?

Узнайте больше об этом в нашей документации [Как запустить Testplane в локальном браузере](/docs/v8/guides/local-browsers).
Узнайте больше об этом в нашей документации [Как запустить Testplane в локальном браузере](/docs/v8/basic-guides/managing-browsers).
2 changes: 1 addition & 1 deletion blog/storybook-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Also you can try it yourself in our [example project][example] on GitHub with cu
[storybook]: https://storybook.js.org
[testplane-storybook]: https://github.com/gemini-testing/testplane-storybook
[play-function]: https://storybook.js.org/docs/writing-stories/play-function
[vt-story]: ../../docs/v8/visual-testing/with-storybook
[vt-story]: ../../docs/v8/basic-guides/visual-testing-with-storybook
[example]: https://github.com/gemini-testing/testplane/tree/master/examples/storybook-autoscreenshots
6 changes: 3 additions & 3 deletions blog/testplane-vs-playwright.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ Playwright же связывает обновления инструмента
✅ Необходимо тестирование в широком спектре десктопных браузеров и мобильных устройств\
✅ Требуется тестирование нативных приложений Android и iOS

[anti-aliasing-tolerance]: https://testplane.io/docs/v8/config/browsers/#antialiasing_tolerance
[anti-aliasing-tolerance]: https://testplane.io/docs/v8/reference/config/browsers/#antialiasing_tolerance
[looks-same]: https://github.com/gemini-testing/looks-same
[looks-same-benchmarks]: https://github.com/gemini-testing/looks-same/blob/master/benchmark/results.md
[mpt]: https://learn.microsoft.com/en-us/azure/playwright-testing/
[report-visual-testing]: https://testplane.io/docs/v8/html-reporter/overview/#superb-visual-testing-capabilities
[reporter]: https://testplane.io/docs/v8/html-reporter/overview/
[storybook]: https://storybook.js.org
[storybook-autotests]: https://testplane.io/docs/v8/visual-testing/with-storybook/
[storybook-autotests]: https://testplane.io/docs/v8/basic-guides/visual-testing-with-storybook/
[testplane-mcp]: https://testplane.io/ru/docs/v8/testplane-mcp/
[tolerance]: https://testplane.io/docs/v8/config/browsers/#tolerance
[tolerance]: https://testplane.io/docs/v8/reference/config/browsers/#tolerance
[time-travel]: https://testplane.io/ru/docs/v8/guides/time-travel/
2 changes: 1 addition & 1 deletion blog/time-travel-release.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ Time Travel записывает снапшоты DOM-дерева, что по
Следите за новыми релизами в нашем блоге и в разделе [Release Notes на GitHub](https://github.com/gemini-testing/html-reporter/releases), а в случае обнаружения проблем приходите в [issue GitHub][gh-issues] — мы вам обязательно поможем!

[gh-issues]: https://github.com/gemini-testing/testplane/issues
[time-travel-guide]: https://testplane.io/ru/docs/v8/guides/time-travel/
[time-travel-guide]: https://testplane.io/ru/docs/v8/basic-guides/time-travel/
4 changes: 2 additions & 2 deletions blog/vscode-extension.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Admonition from "@theme/Admonition";
import runTestsFromSidebarVideoUrl from "/video/blog/vscode-extension/run-tests-from-sidebar.mp4";
import runTestsFromEditorVideoUrl from "/video/blog/vscode-extension/run-tests-from-editor.mp4";

Для Testplane реализовали расширение для <a href="https://code.visualstudio.com/">VS Code</a>, с помощью которого можно настраивать Testplane с нуля, запускать тесты и удобно работать с <a href="/ru/docs/v8/command-line#testplane-repl">REPL режимом</a>.
Для Testplane реализовали расширение для <a href="https://code.visualstudio.com/">VS Code</a>, с помощью которого можно настраивать Testplane с нуля, запускать тесты и удобно работать с <a href="/ru/docs/v8/reference/cli#testplane-repl">REPL режимом</a>.

<!-- truncate -->

Expand Down Expand Up @@ -80,7 +80,7 @@ Install Testplane

#### С настройкой `REPL`

При клике в чекбокс `Enable REPL` и последующем запуске теста (в REPL режиме можно одновременно запустить только один тест) он будет запущен в специальном REPL режиме. Подробнее про этот режим можно прочитать <a href="/ru/docs/v8/command-line#testplane-repl">здесь</a>.
При клике в чекбокс `Enable REPL` и последующем запуске теста (в REPL режиме можно одновременно запустить только один тест) он будет запущен в специальном REPL режиме. Подробнее про этот режим можно прочитать <a href="/ru/docs/v8/reference/cli#testplane-repl">здесь</a>.

![Включение опции REPL](/img/blog/vscode-extension/enable-repl.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ Instances of the `browser` and `expect` are available inside of the browser's gl

Calling the `log`, `info`, `warn`, `error`, `debug` and `table` commands on the `console` object in the browser causes information to be displayed not only in the browser's DevTools, but also in the terminal from which Testplane was launched. I.e., you can call `console.log` in the test/component and you will be able to see the result of it execution in the terminal. This is especially handy when debugging the test.

[test-run-env-option]: ../config/system.mdx#testrunenv
[test-run-env-option]: ../reference/config/system.mdx#testrunenv
[browser-execute]: ../commands/browser/execute.mdx
[testplane-examples-component-testing]: https://github.com/gemini-testing/testplane/tree/master/examples/component-testing
[testplane-global-hook]: https://github.com/gemini-testing/testplane-global-hook
[vite-hmr]: https://vitejs.dev/guide/api-hmr.html
[repl-mode]: ../command-line/index.mdx#testplane-repl
[repl-mode]: ../reference/cli.mdx#testplane-repl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Admonition from "@theme/Admonition";
import AddElementCommandExample from "@site/docs/config/_partials/examples/_prepare-browser-add-element-command.mdx";
import AddElementCommandExample from "@site/docs/reference/config/_partials/examples/_prepare-browser-add-element-command.mdx";

# Custom Commands

Expand All @@ -20,7 +20,7 @@ Testplane allows you to enhance your test suites by adding custom commands. Thes

<Admonition type="tip">
A good place to add all of your custom commands is
[`prepareBrowser`](../config/prepare-browser.mdx) hook.
[`prepareBrowser`](../reference/config/prepare-browser.mdx) hook.
</Admonition>

To add a custom command to the `browser` object, use the `addCommand` method. Here's how you can define a command that retrieves both the URL and title of the current page:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Admonition from "@theme/Admonition";

# How to Debug a Test
# Debugging Tests

## Problem {#problem}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
import Admonition from "@theme/Admonition";

# How to Manage Network Bandwidth
# Emulation

## Overview {#overview}
## CPU Performance

<Admonition type="warning">
This recipe only works when using _Chrome DevTools Protocol (CDP)_.

Read details in the section “[How to use CDP in Testplane][how-to-use-cdp]”.
This feature only works with browsers supporting _Chrome DevTools Protocol (CDP)_.

</Admonition>

The CPU speed on mobile devices is significantly slower than on computers. Therefore, to emulate CPU speed in _puppeteer_, there is a method called [emulateCPUThrottling][emulate-cpu-throttling].

### Example: Slowing Down CPU Speed by 8x {#example}

Let's use this method to slow down CPU speed by 8 times:

```javascript
it("should open yandex.ru with emulation 8x slower CPU", async function ({ browser }) {
// Get puppeteer instance
const puppeteer = await browser.getPuppeteer();

// Get the first open page (considering it to be currently active)
const [page] = await puppeteer.pages();

// Slow down the CPU speed by 8 times
await page.emulateCPUThrottling(8);

await browser.url("https://yandex.ru");
});
```

[emulate-cpu-throttling]: https://pptr.dev/api/puppeteer.page.emulatecputhrottling
[cdp-session-send]: https://pptr.dev/api/puppeteer.cdpsession.send
[emulation-set-cpu-throttling-rate]: https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate

## Network Bandwidth

<Admonition type="warning">

This feature only works with browsers supporting _Chrome DevTools Protocol (CDP)_.

</Admonition>

Expand All @@ -23,7 +55,7 @@ Besides custom settings, the [throttle][throttle] method supports the following
- DSL
- WiFi

## Example 1: Emulating a 2G Connection {#example_1}
### Example 1: Emulating a 2G Connection {#example_1}

Let's emulate a 2G connection and open yandex.ru in Chrome with phone emulation:

Expand All @@ -36,7 +68,7 @@ it("should open yandex.ru with emulation of 2G-connection", async function ({ br
});
```

## Example 2: Emulating a Network with Given Characteristics {#example_2}
### Example 2: Emulating a Network with Given Characteristics {#example_2}

We can also emulate a connection with specific characteristics:

Expand All @@ -54,5 +86,4 @@ it("should open yandex.ru with emulation of custom connection", async function (
});
```

[how-to-use-cdp]: ../how-to-use-cdp
[throttle]: ../../commands/browser/throttle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Admonition from "@theme/Admonition";

# How to Run Testplane in a Local Browser
# Managing Browsers

## Introduction

Testplane can automatically download browsers in accordance with your [Testplane Config](/docs/v8/config/main).
Testplane can automatically download browsers in accordance with your [Testplane Config](/docs/v8/reference/config/main).

Additionally, if Testplane is used on a supported version of Ubuntu, the necessary deb packages for running browsers will also be downloaded in a similar manner.

Expand All @@ -16,11 +16,11 @@ In a project with Testplane, you can execute the command `npx testplane install-

You can also download only the necessary browsers described in the config. For example, if the browser `chrome-dark` is described, you can download only this one with the command `npm testplane install-deps chrome-dark'.

You can read more about this command on the respective page: [install-deps](/docs/v8/command-line#install-deps)
You can read more about this command on the respective page: [install-deps](/docs/v8/reference/cli#install-deps)

## Running tests

You can run tests on local browsers using the [CLI option](/docs/v8/command-line) `--local`, or with [gridUrl](/docs/v8/config/browsers/#grid_url): "local" in the [Testplane config](/docs/v8/config/main). For example:
You can run tests on local browsers using the [CLI option](/docs/v8/reference/cli) `--local`, or with [gridUrl](/docs/v8/reference/config/browsers/#grid_url): "local" in the [Testplane config](/docs/v8/reference/config/main). For example:

```bash
npx testplane --local
Expand Down
Loading