From eb43ebfbd0bb90bbc660b0b4c957f16d2a877036 Mon Sep 17 00:00:00 2001 From: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:50:22 +0300 Subject: [PATCH] hide terminal-report logs from console (#46891) * hide terminal-report logs from console * disable html output from testing-library-dom * revert failing code --- e2e/support/config.js | 4 +++- e2e/support/cypress.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/e2e/support/config.js b/e2e/support/config.js index f2943a1236e..7c07011d29a 100644 --- a/e2e/support/config.js +++ b/e2e/support/config.js @@ -52,7 +52,9 @@ const defaultConfig = { // cypress-terminal-report if (isCI) { - installLogsPrinter(on); + installLogsPrinter(on, { + printLogsToConsole: "never", + }); } /******************************************************************** diff --git a/e2e/support/cypress.js b/e2e/support/cypress.js index afba5dc5cfb..263ac712a4e 100644 --- a/e2e/support/cypress.js +++ b/e2e/support/cypress.js @@ -3,12 +3,29 @@ registerCypressGrep(); import "@cypress/skip-test/support"; import "@testing-library/cypress/add-commands"; +import { configure } from "@testing-library/cypress"; import "cypress-real-events/support"; import addContext from "mochawesome/addContext"; import "./commands"; const isCI = Cypress.env("CI"); +// remove default html output on test failure +configure({ + getElementError: (message, container) => { + // to re-enable the default stack trace, uncomment + // import { prettyDOM } from "@testing-library/dom"; + // const error = new Error( + // [message, prettyDOM(container)].filter(Boolean).join('\n\n'), + // ) + const error = new Error(message); + error.name = "TestingLibraryElementError"; + error.stack = null; + + return error; + }, +}); + Cypress.on("uncaught:exception", (err, runnable) => false); Cypress.on("test:before:run", () => { -- GitLab