Skip to content

Commit 71cfdd2

Browse files
author
rocketraccoon
committed
feat(testplane): fixes
1 parent 618dd93 commit 71cfdd2

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

docs/html-reporter/html-reporter-setup.mdx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import ConfigExamples from "/docs/_partials/html-reporter-config-examples.mdx";
3737
<tr><td>[plugins](#plugins)</td><td>`Plugin[]`</td><td>`[]`</td><td>A list of plugins with their settings.</td></tr>
3838
<tr><td>[customScripts](#customscripts)</td><td>`AnyFunction[]`</td><td>`[]`</td><td>A list of functions that implement custom scripts. For example, Yandex.Metrika scripts or a Bug.</td></tr>
3939
<tr><td>[yandexMetrika](#yandexmetrika)</td><td>`YandexMetrika`</td><td>*see below*</td><td>[Yandex.Metrika][yandex-metrika].</td></tr>
40-
<tr><td>[badgeFormatter](#badgeformatter)</td><td>`BadgeFormatter`</td><td>`null`</td><td>A callback that is called after every test run. It receives the test result and returns a list of badges.</td></tr>
40+
<tr><td>[generateBadge](#badgeformatter)</td><td>`BadgeFormatter`</td><td>`null`</td><td>A callback that is called after every test run. It receives the test result and returns a list of badges.</td></tr>
4141

4242
</tbody>
4343
</table>
@@ -291,21 +291,21 @@ If you don't want to share analytics with us, you can disable it in any of the f
291291
- Using environment variables: `html_reporter_yandex_metrika_enabled=false` or simply `NO_ANALYTICS=true`
292292
- Using CLI arguments: `--html-reporter-yandex_metrika_enabled=false`
293293

294-
### badgeFormatter
294+
### generateBadge
295295

296296
<Version version="11.4.0" />
297297

298298
A callback that is called after every test run. It receives the test result and returns a list of badges.
299299

300-
Usage example: here we set the ticket name and URL, the branch name, and the speed test indicator.
300+
Usage example: here we set the ticket name and URL, the branch name.
301301

302302
```typescript title="testplane.config.ts"
303303
{
304304
// other Testplane config...
305305
plugins: {
306306
"html-reporter/testplane": {
307307
//...
308-
badgeFormatter: (test) => [
308+
generateBadge: (test) => [
309309
{
310310
title: test.meta.issueTitle,
311311
icon: 'LogoYandexTracker',
@@ -315,15 +315,6 @@ Usage example: here we set the ticket name and URL, the branch name, and the spe
315315
title: test.meta.branch,
316316
icon: 'BranchesRight',
317317
},
318-
test.duration > 3000 ?
319-
{
320-
title: "Slow",
321-
icon: 'Snail',
322-
} :
323-
{
324-
title: "Fast",
325-
icon: 'ChevronsRight',
326-
}
327318
]
328319
}
329320
}

i18n/ru/docusaurus-plugin-content-docs/current/html-reporter/html-reporter-setup.mdx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import ConfigExamples from "../_partials/html-reporter-config-examples.mdx";
3535
<tr><td>[plugins](#plugins)</td><td>`Plugin[]`</td><td>`[]`</td><td>Список плагинов с их настройками.</td></tr>
3636
<tr><td>[customScripts](#customscripts)</td><td>`AnyFunction[]`</td><td>`[]`</td><td>Список функций, реализующих кастомные скрипты. Например, скрипты Яндекс.Метрики или Жучка.</td></tr>
3737
<tr><td>[yandexMetrika](#yandexmetrika)</td><td>`YandexMetrika`</td><td>*см. ниже*</td><td>[Яндекс.Метрика][yandex-metrika].</td></tr>
38-
<tr><td>[badgeFormatter](#badgeformatter)</td><td>`BadgeFormatter`</td><td>`null`</td><td>Колбэк, который вызывается после каждого запуска теста. Он получает результат теста и возвращает список бейджей.</td></tr>
38+
<tr><td>[generateBadge](#badgeformatter)</td><td>`BadgeFormatter`</td><td>`null`</td><td>Колбэк, который вызывается после каждого запуска теста. Он получает результат теста и возвращает список бейджей.</td></tr>
3939

4040
</tbody>
4141
</table>
@@ -289,21 +289,21 @@ customScripts: [
289289
- С помощью переменных окружения: `html_reporter_yandex_metrika_enabled=false` или просто `NO_ANALYTICS=true`
290290
- С помощью аргументов CLI: `--html-reporter-yandex_metrika_enabled=false`
291291

292-
### badgeFormatter
292+
### generateBadge
293293

294294
<Version version="11.4.0" />
295295

296296
Колбэк, который вызывается после каждого запуска теста. Он получает результат теста и возвращает список бейджей.
297297

298-
Пример использования: здесь мы задаём название тикета и URL, название ветки и индикатор скорости теста.
298+
Пример использования: здесь мы задаём название тикета и URL, название ветки.
299299

300300
```typescript title="testplane.config.ts"
301301
{
302302
// other Testplane config...
303303
plugins: {
304304
"html-reporter/testplane": {
305305
//...
306-
badgeFormatter: (test) => [
306+
generateBadge: (test) => [
307307
{
308308
title: test.meta.issueTitle,
309309
icon: 'LogoYandexTracker',
@@ -313,15 +313,6 @@ customScripts: [
313313
title: test.meta.branch,
314314
icon: 'BranchesRight',
315315
},
316-
test.duration > 3000 ?
317-
{
318-
title: "Slow",
319-
icon: 'Snail',
320-
} :
321-
{
322-
title: "Fast",
323-
icon: 'ChevronsRight',
324-
}
325316
]
326317
}
327318
}

0 commit comments

Comments
 (0)