Я провожу Cypress тесты в Дженкинсе.Однако мне нужно изменить вывод по умолчанию.Я хотел бы, чтобы структура таблицы с именем теста и другой столбец для статуса пройден или не пройден.
Вывод по умолчанию показан ниже:
(Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 3.1.5 │ │ Browser: Chrome 72 │ │ Specs: 2 found (Login_With_User_Credentials.spec.js, tsconfig.json) │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: Login_With_User_Credentials.spec.js... (1 of 2) 1) Correct credentials login √ Incorrect credentials login (2082ms) 1 passing (3m) 1 failing 1) Correct credentials login: CypressError: Timed out retrying: Expected to find element: 'button#btnSearch', but never found it. at Object.cypressErr (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:65377:11) at Object.throwErr (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:65342:18) at Object.throwErrByPath (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:65369:17) at retry (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:58910:16) at http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:51018:18 at tryCatcher (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:127298:23) at Promise._settlePromiseFromHandler (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125316:31) at Promise._settlePromise (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125373:18) at Promise._settlePromise0 (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125418:10) at Promise._settlePromises (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125493:18) at Async._drainQueue (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:122222:16) at Async._drainQueues (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:122232:10) at Async.drainQueues (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:122106:14) (Results) ┌───────────────────────────────────────────────────┐ │ Tests: 2 │ │ Passing: 1 │ │ Failing: 1 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 1 │ │ Video: false │ │ Duration: 2 minutes, 52 seconds │ │ Spec Ran: Login_With_User_Credentials.spec.js │ └───────────────────────────────────────────────────┘ (Screenshots) - C:\cypress\screenshots\Login_With_User_Credentials.spec.js\Correct credentials login (failed).png (1920x969) ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: tsconfig.json... (2 of 2) 0 passing (2ms) (Results) ┌─────────────────────────────┐ │ Tests: 0 │ │ Passing: 0 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: false │ │ Duration: 0 seconds │ │ Spec Ran: tsconfig.json │ └─────────────────────────────┘ ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ × Login_With_User_Credentials.spec.js 02:52 2 1 1 - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ √ tsconfig.json 6ms - - - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ 1 of 2 failed (50%) 02:52 2 1 1 - -
Я хочу отображать только нижнюю часть вывода:
(Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ × Login_With_User_Credentials.spec.js 02:52 2 1 1 - - │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ │ √ tsconfig.json 6ms - - - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ 1 of 2 failed (50%) 02:52 2 1 1 - -
Есть ли файл конфигурации, который имеетформат изложен?Если так, где я могу найти это?Я также попытался создать собственный файл конфигурации отчета, но пока мне не повезло.
Любая помощь будет оценена.
Установка для mocha Reporter значения min приводит к выводу только сводки по каждому тесту и итоговой сводки.
min
cypress.json
{ "reporter": "min" }
Для более персонализированного вывода выпридется строить самостоятельно.Взгляните на base репортер и min репортер в репозитории мокко.
base
Есть также ряд других репортеров, которых вы могли бы попробовать, здесь .