Skip to content

Commit 757b4e4

Browse files
authored
docs: add lastFailed config option (#21)
1 parent 655fda6 commit 757b4e4

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

docs/config/last-failed.mdx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import Admonition from "@theme/Admonition";
2+
3+
# lastFailed
4+
5+
## Обзор {#overview}
6+
7+
Раздел `lastFailed` в настройках Testplane не является обязательным.
8+
9+
Используйте его, чтобы настроить перезапуск упавших тестов.
10+
11+
## Настройка {#setup}
12+
13+
Раздел `lastFailed` имеет следующий формат:
14+
15+
```javascript
16+
module.exports = {
17+
lastFailed: {
18+
only: false,
19+
input: [".testplane/failed.json"],
20+
output: ".testplane/failed.json",
21+
},
22+
23+
// другие настройки Testplane...
24+
};
25+
```
26+
27+
### Расшифровка параметров конфигурации {#setup_description}
28+
29+
<table>
30+
<thead>
31+
<tr><td>**Параметр**</td><td>**Тип**</td><td>**По&nbsp;умолчанию**</td><td>**Описание**</td></tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>[only](#only)</td><td>Boolean</td><td>false</td><td>Включить / отключить режим перезапуска упавших тестов.</td></tr>
35+
<tr><td>[input](#input)</td><td>String или Array</td><td>.testplane/failed.json</td><td>Путь или список путей для чтения списка упавших тестов</td></tr>
36+
<tr><td>[output](#output)</td><td>String</td><td>.testplane/failed.json</td><td>Путь для сохранения списка упавших тестов</td></tr>
37+
38+
</tbody>
39+
</table>
40+
41+
### only {#only}
42+
43+
Включает режим перезапуска упавших тестов, в котором запускаются только тесты из списка, путь к которому указан в input, если установить значение в `true`. По умолчанию: `false`.
44+
45+
### input {#input}
46+
47+
Путь или список путей для чтения списка упавших тестов. Если указан список путей к файлам, то перезапускаются все тесты, которые встречаются хотя бы в одном из них. По умолчанию: `.testplane/failed.json`
48+
49+
### output {#output}
50+
51+
Путь для сохранения списка упавших тестов. Используется всегда, независимо от опции `only`. По умолчанию: `.testplane/failed.json`

docs/config/main.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ module.exports = {
5454
plugins: {
5555
// подключение внешних плагинов Testplane...
5656
},
57+
lastFailed: {
58+
// настройки перезапуска упавших тестов...
59+
},
5760
prepareBrowser: function(browser) {
5861
// здесь можно добавить новые команды к объекту browser,
5962
// где browser - это сессия WebdriverIO
@@ -84,6 +87,7 @@ module.exports = {
8487
<tr><td>[sets][sets]</td><td>Раздел, позволяющий привязать набор тестов к определенным браузерам и запускать их сразу одной командой. Может пригодиться, например, для отдельного запуска десктопных и мобильных тестов.</td></tr>
8588
<tr><td>[system][system]</td><td>Раздел системных настроек Testplane. Позволяет задать число подпроцессов, в которых будут запускаться тесты, включить режим дебага для WebDriver, и многое другое.</td></tr>
8689
<tr><td>[plugins][plugins]</td><td>Раздел, с помощью которого можно подключить к testplane внешние плагины.</td></tr>
90+
<tr><td>[lastFailed][last-failed]</td><td>Раздел, с помощью которого можно настроить перезапуск упавших тестов.</td></tr>
8791
<tr><td>[prepareBrowser][prepare-browser]</td><td>Функция, в которой можно подготовить браузер до того, как в нем будут запущены тесты. Например, в этой функции можно добавить новые команды для объекта _browser_.</td></tr>
8892
<tr><td>[prepareEnvironment][prepare-environment]</td><td>Функция, в которой можно задать переменные окружения или, например, дополнить какие-то параметры конфига.</td></tr>
8993
@@ -102,5 +106,6 @@ module.exports = {
102106
[sets]: ../sets
103107
[system]: ../system
104108
[plugins]: ../plugins
109+
[last-failed]: ../last-failed
105110
[prepare-browser]: ../prepare-browser
106111
[prepare-environment]: ../prepare-environment
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
javascript
2+
import Admonition from "@theme/Admonition";
3+
4+
# lastFailed
5+
6+
## Overview {#overview}
7+
8+
The `lastFailed` section in Testplane settings is optional.
9+
10+
Use it to configure the rerun of failed tests.
11+
12+
## Setup {#setup}
13+
14+
The `lastFailed` section has the following format:
15+
16+
```javascript
17+
module.exports = {
18+
lastFailed: {
19+
only: false,
20+
input: [".testplane/failed.json"],
21+
output: ".testplane/failed.json",
22+
},
23+
24+
// other Testplane settings...
25+
};
26+
```
27+
28+
### Description of Configuration Parameters {#setup_description}
29+
30+
<table>
31+
<thead>
32+
<tr><td>**Parameter**</td><td>**Type**</td><td>**Default&nbsp;value**</td><td>**Description**</td></tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>[only](#only)</td><td>Boolean</td><td>false</td><td>Enable / disable the mode for rerunning failed tests.</td></tr>
36+
<tr><td>[input](#input)</td><td>String or Array</td><td>.testplane/failed.json</td><td>Path or list of paths for reading the list of failed tests.</td></tr>
37+
<tr><td>[output](#input)</td><td>String</td><td>.testplane/failed.json</td><td>Path for saving the list of failed tests.</td></tr>
38+
39+
</tbody>
40+
</table>
41+
42+
### only {#only}
43+
44+
Enables the mode for rerunning failed tests, in which only the tests from the list specified in input are run if set to true. Default: `false`.
45+
46+
### input {#input}
47+
48+
Path or list of paths for reading the list of failed tests. If a list of file paths is specified, all tests that are found in at least one of them are rerun. Default: `.testplane/failed.json`
49+
50+
### output {#output}
51+
52+
Path for saving the list of failed tests. Always used regardless of the only option. Default: `.testplane/failed.json`

i18n/en/docusaurus-plugin-content-docs/current/config/main.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ module.exports = {
5454
plugins: {
5555
// external Testplane plugins settings...
5656
},
57+
lastFailed: {
58+
// failed tests rerun settings...
59+
},
5760
prepareBrowser: function(browser) {
5861
// here you can add new commands to the browser object,
5962
// where browser is a WebdriverIO session
@@ -84,6 +87,7 @@ In order not to repeat common [settings of each browser][browsers] over and over
8487
<tr><td>[sets][sets]</td><td>A section that allows you to bind a set of tests to certain browsers and run them at once with one command. For example, you can launch desktop and mobiles tests separately by using this option.</td></tr>
8588
<tr><td>[system][system]</td><td>Testplane system settings section. Allows you to set the number of subprocesses to run the tests in, enable the debug mode for WebDriver, and much more.</td></tr>
8689
<tr><td>[plugins][plugins]</td><td>A section with which you can mount external plugins to Testplane.</td></tr>
90+
<tr><td>[lastFailed][last-failed]</td><td>A section with which you can configure the rerun of failed tests.</td></tr>
8791
<tr><td>[prepareBrowser][prepare-browser]</td><td>A function in which you can prepare the browser before to run the tests in it. For example, in this function you can add new commands for the _browser_ object.</td></tr>
8892
<tr><td>[prepareEnvironment][prepare-environment]</td><td>A function in which you can set environment variables or, for example, add some config parameters.</td></tr>
8993
@@ -102,5 +106,6 @@ You can set your configuration file using the `--config` CLI option, specifying
102106
[sets]: ../sets
103107
[system]: ../system
104108
[plugins]: ../plugins
109+
[last-failed]: ../last-failed
105110
[prepare-browser]: ../prepare-browser
106111
[prepare-environment]: ../prepare-environment

0 commit comments

Comments
 (0)