From f3787c85e8917475fc71b0ae7dbbcd15557ac619 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Fri, 7 Jul 2023 12:01:32 -0400 Subject: [PATCH] cypress: install package 'cypress-terminal-report' https://github.com/archfz/cypress-terminal-report Change-Id: I242e421aeb02ee3861b16af78af87c6a9db22ad5 Signed-off-by: Henry Castro --- cypress_test/README | 5 +++++ cypress_test/cypress.config.ts | 5 +++-- cypress_test/package.json | 1 + cypress_test/support/index.js | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cypress_test/README b/cypress_test/README index f9b7c23ee8..0a4af91e6b 100644 --- a/cypress_test/README +++ b/cypress_test/README @@ -281,6 +281,11 @@ Used Packages - cypress: Cypress integration test framework. +- cypress-terminal-report: + This package makes cypress to dump test logs to the command line + when a test fails. You can write things to this log by calling + cy.log() in the test code. + - cypress-log-to-output: This one can be used to dump console.error() messages to the command line. To enable this functionality you need to set ENABLE_CONSOLE_LOG diff --git a/cypress_test/cypress.config.ts b/cypress_test/cypress.config.ts index 2f77cea274..8518791a9a 100644 --- a/cypress_test/cypress.config.ts +++ b/cypress_test/cypress.config.ts @@ -1,7 +1,7 @@ -/* global process */ import { defineConfig } from 'cypress'; import plugin from './plugins/index.js'; -import 'process'; +import process from 'process'; +import installLogsPrinter from 'cypress-terminal-report/src/installLogsPrinter'; export default defineConfig({ video: false, @@ -17,6 +17,7 @@ export default defineConfig({ }, e2e: { setupNodeEvents(on, config) { + installLogsPrinter(on); plugin(on, config); }, specPattern: 'integration_tests/**/*_spec.js', diff --git a/cypress_test/package.json b/cypress_test/package.json index a95b2f35a6..a9e83338df 100644 --- a/cypress_test/package.json +++ b/cypress_test/package.json @@ -11,6 +11,7 @@ "cypress-file-upload": "5.0.8", "cypress-iframe": "1.0.1", "cypress-log-to-output": "1.1.2", + "cypress-terminal-report": "^5.3.0", "cypress-wait-until": "1.7.2", "eslint": "7.19.0", "eslint-plugin-cypress-rules": "file:eslint_plugin", diff --git a/cypress_test/support/index.js b/cypress_test/support/index.js index fb8fca4bed..6ca8ff31b5 100644 --- a/cypress_test/support/index.js +++ b/cypress_test/support/index.js @@ -3,6 +3,9 @@ require('cypress-wait-until'); require('cypress-file-upload'); require('cypress-iframe'); +import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector'; + +installLogsCollector(); if (Cypress.env('INTEGRATION') === 'php-proxy') { Cypress.Server.defaults({