diff --git a/.gitignore b/.gitignore index 62a7e83f..20c658cc 100755 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,9 @@ test/cypress/screenshots test/cypress/videos test/output/out.json test/output/out.txt -test/output/not/existing/path/out.txt +test/output/out.html test/output/out.cst +test/output/not/existing/path/out.txt test/output_nested test/cypress/reports .idea diff --git a/.prettierignore b/.prettierignore index bfe3b8d3..a5dd5108 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -tsconfig.json \ No newline at end of file +tsconfig.json +test/output*/**/*.html \ No newline at end of file diff --git a/README.md b/README.md index 448e4f6b..ab88425c 100755 --- a/README.md +++ b/README.md @@ -294,6 +294,7 @@ setupNodeEvents(on, config) { outputTarget: { 'out.txt': 'txt', 'out.json': 'json', + 'out.html': 'html', } }; @@ -305,7 +306,7 @@ setupNodeEvents(on, config) { The `outputTarget` needs to be an object where the key is the relative path of the file from `outputRoot` and the value is the **type** of format to output. -Supported types: `txt`, `json`. +Supported types: `txt`, `json`, `html`. ### Log specs in separate files diff --git a/index.d.ts b/index.d.ts index 2c43830b..f98b00c8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,10 +1,9 @@ declare namespace Cypress { import type {Log} from './src/installLogsCollector'; - import type {BuiltinOutputProcessorsTypes} from './src/types'; interface Cypress { TerminalReport: { - getLogs(format: BuiltinOutputProcessorsTypes): string | null; + getLogs(format: 'txt' | 'json'): string | null; getLogs(format?: 'none' = 'none'): Log[] | null; }; } diff --git a/src/installLogsCollector.ts b/src/installLogsCollector.ts index f3087529..8901a890 100755 --- a/src/installLogsCollector.ts +++ b/src/installLogsCollector.ts @@ -11,7 +11,7 @@ import LogCollectControlSimple from './collector/LogCollectControlSimple'; import logsTxtFormatter from './outputProcessor/logsTxtFormatter'; import CONSTANTS from './constants'; import type {ExtendedSupportOptions, SupportOptions} from './installLogsCollector.types'; -import type {LogType, Log, Severity, BuiltinOutputProcessorsTypes} from './types'; +import type {LogType, Log, Severity} from './types'; import utils from './utils'; import {validate} from 'superstruct'; import {InstallLogsCollectorSchema} from './installLogsCollector.schema'; @@ -75,7 +75,7 @@ function registerLogCollectorTypes( function registerGlobalApi(logCollectorState: LogCollectorState) { Cypress.TerminalReport = { //@ts-ignore there is no error, this works correctly. - getLogs: (format: BuiltinOutputProcessorsTypes | 'none' = 'none') => { + getLogs: (format: 'txt' | 'json' | 'none' = 'none') => { const logs = logCollectorState.getCurrentLogStack(); if (!logs) { diff --git a/src/installLogsPrinter.ts b/src/installLogsPrinter.ts index 69829ac8..4a4abf14 100755 --- a/src/installLogsPrinter.ts +++ b/src/installLogsPrinter.ts @@ -16,6 +16,7 @@ import utils from './utils'; import consoleProcessor from './outputProcessor/consoleProcessor'; import {validate} from 'superstruct'; import {InstallLogsPrinterSchema} from './installLogsPrinter.schema'; +import HtmlOutputProcessor from './outputProcessor/HtmlOutputProcessor'; const OUTPUT_PROCESSOR_TYPE: Record< BuiltinOutputProcessorsTypes, @@ -23,6 +24,7 @@ const OUTPUT_PROCESSOR_TYPE: Record< > = { json: JsonOutputProcessor, txt: TextOutputProcessor, + html: HtmlOutputProcessor, }; let writeToFileMessages: Record> = {}; @@ -56,9 +58,10 @@ function installLogsPrinter(on: Cypress.PluginEvents, options: PluginOptions = { printLogsToFile, printLogsToConsole, outputCompactLogs, - outputTarget,logToFilesOnAfterRun, + outputTarget, + logToFilesOnAfterRun, includeSuccessfulHookLogs, - compactLogs: compactLogsOption, + compactLogs, collectTestLogs, } = resolvedOptions; @@ -80,8 +83,8 @@ function installLogsPrinter(on: Cypress.PluginEvents, options: PluginOptions = { let messages = data.messages; const terminalMessages = - typeof compactLogsOption === 'number' && compactLogsOption >= 0 - ? compactLogs(messages, compactLogsOption, logDebug) + typeof compactLogs === 'number' && compactLogs >= 0 + ? getCompactLogs(messages, compactLogs, logDebug) : messages; const isHookAndShouldLog = @@ -91,7 +94,7 @@ function installLogsPrinter(on: Cypress.PluginEvents, options: PluginOptions = { if (data.state === 'failed' || printLogsToFile === 'always' || isHookAndShouldLog) { let outputFileMessages = typeof outputCompactLogs === 'number' - ? compactLogs(messages, outputCompactLogs, logDebug) + ? getCompactLogs(messages, outputCompactLogs, logDebug) : outputCompactLogs === false ? messages : terminalMessages; @@ -176,8 +179,8 @@ function installOutputProcessors(on: Cypress.PluginEvents, options: PluginOption const createProcessorFromType = ( file: string, - options: PluginOptions, - type: BuiltinOutputProcessorsTypes | CustomOutputProcessorCallback + type: BuiltinOutputProcessorsTypes | CustomOutputProcessorCallback, + options: PluginOptions ) => { const filepath = path.join(options.outputRoot || '', file); @@ -211,18 +214,18 @@ function installOutputProcessors(on: Cypress.PluginEvents, options: PluginOption root, options.specRoot || '', ext, - (nestedFile: string) => createProcessorFromType(nestedFile, options, type) + (nestedFile: string) => createProcessorFromType(nestedFile, type, options) ) ); } else { - outputProcessors.push(createProcessorFromType(file, options, type)); + outputProcessors.push(createProcessorFromType(file, type, options)); } }); outputProcessors.forEach((processor) => processor.initialize()); } -function compactLogs(logs: Log[], keepAroundCount: number, logDebug: (message: string) => void) { +function getCompactLogs(logs: Log[], keepAroundCount: number, logDebug: (message: string) => void) { logDebug(`Compacting ${logs.length} logs.`); const failingIndexes = logs diff --git a/src/outputProcessor/HtmlOutputProcessor.ts b/src/outputProcessor/HtmlOutputProcessor.ts new file mode 100644 index 00000000..cc892ba7 --- /dev/null +++ b/src/outputProcessor/HtmlOutputProcessor.ts @@ -0,0 +1,195 @@ +import type {AllMessages, PluginOptions} from '../installLogsPrinter.types'; +import BaseOutputProcessor from './BaseOutputProcessor'; +import {Log, LogSymbols, LogType, ValueOf} from '../types'; +import CONSTANTS from '../constants'; +import utils from '../utils'; + +const {COLORS: BASE_COLORS, LOG_TYPES, LOG_SYMBOLS} = CONSTANTS; + +export const TYPE_PADDING = Math.max(...Object.values(LOG_TYPES).map((l) => l.length)) + 3; + +const COLORS = { + ...BASE_COLORS, + DARK_CYAN: 'darkcyan', + LIGHT_GREY: 'lightgrey', +} as const; + +type Colors = ValueOf; + +const MessageConfigMap: Record< + LogType, + (options: PluginOptions) => { + typeColor: Colors; + icon: LogSymbols; + /** + * default is no html color + */ + messageColor?: Colors; + /** + * default is no trim (full message length) + */ + trim?: number; + } +> = { + [LOG_TYPES.PLUGIN_LOG_TYPE]: () => ({typeColor: COLORS.DARK_CYAN, icon: LOG_SYMBOLS.INFO}), + [LOG_TYPES.BROWSER_CONSOLE_WARN]: () => ({typeColor: COLORS.YELLOW, icon: LOG_SYMBOLS.WARNING}), + [LOG_TYPES.BROWSER_CONSOLE_ERROR]: () => ({typeColor: COLORS.RED, icon: LOG_SYMBOLS.ERROR}), + [LOG_TYPES.BROWSER_CONSOLE_DEBUG]: () => ({typeColor: COLORS.BLUE, icon: LOG_SYMBOLS.DEBUG}), + [LOG_TYPES.BROWSER_CONSOLE_INFO]: () => ({typeColor: COLORS.DARK_CYAN, icon: LOG_SYMBOLS.INFO}), + [LOG_TYPES.BROWSER_CONSOLE_LOG]: () => ({typeColor: COLORS.DARK_CYAN, icon: LOG_SYMBOLS.INFO}), + [LOG_TYPES.CYPRESS_LOG]: () => ({typeColor: COLORS.DARK_CYAN, icon: LOG_SYMBOLS.INFO}), + [LOG_TYPES.CYPRESS_XHR]: (options) => ({ + typeColor: COLORS.LIGHT_GREY, + icon: LOG_SYMBOLS.ROUTE, + messageColor: COLORS.LIGHT_GREY, + trim: options.routeTrimLength, + }), + [LOG_TYPES.CYPRESS_FETCH]: (options) => ({ + typeColor: COLORS.GREEN, + icon: LOG_SYMBOLS.ROUTE, + trim: options.routeTrimLength, + messageColor: COLORS.GREY, + }), + [LOG_TYPES.CYPRESS_INTERCEPT]: (options) => ({ + typeColor: COLORS.GREEN, + icon: LOG_SYMBOLS.ROUTE, + messageColor: COLORS.GREY, + trim: options.routeTrimLength, + }), + [LOG_TYPES.CYPRESS_REQUEST]: (options) => ({ + typeColor: COLORS.GREEN, + icon: LOG_SYMBOLS.SUCCESS, + messageColor: COLORS.GREY, + trim: options.routeTrimLength, + }), + [LOG_TYPES.CYPRESS_COMMAND]: () => ({ + typeColor: COLORS.GREEN, + icon: LOG_SYMBOLS.SUCCESS, + }), +}; + +// https://stackoverflow.com/questions/6234773/can-i-escape-html-special-chars-in-javascript +export function escapeHtml(html: string) { + return html + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +/** + * Format an individual Cypress message for HTML logging: + * - Convert cy.log markup syntax to HTML (bold/italic). + * - Color message depending on message type and severity. + * - Trim long messages. + * - Apply proper spacing, newlines, and HTML syntax. + */ +export function formatMessage({type, message, severity}: Log, options: PluginOptions) { + const messageConfig = MessageConfigMap[type](options); + + let processedMessage = message; + let {typeColor, icon, messageColor, trim = options.defaultTrimLength} = messageConfig; + + if (severity === 'error') { + typeColor = COLORS.RED; + icon = LOG_SYMBOLS.ERROR; + } else if (severity === 'warning') { + typeColor = COLORS.YELLOW; + icon = LOG_SYMBOLS.WARNING; + } + + const maybeTrimLength = (msg: string) => + trim && msg.length > trim + ? msg.substring(0, trim) + ' ...\n\n... remainder of log omitted ...\n' + : msg; + + const processMessage = (msg: string) => escapeHtml(maybeTrimLength(msg)); + + if (type == 'cy:log') { + processedMessage = utils.applyMessageMarkdown(processedMessage, { + bold: (str) => `${str}`, + italic: (str) => `${str}`, + processContents: processMessage, + }); + } else { + processedMessage = processMessage(processedMessage); + } + + // If the message is multilined, align non-first lines with the "message column" that's + // to the right of the "type column" + processedMessage = processedMessage + .split('\n') + .map((line, index) => (index === 0 ? line : `${' '.repeat(TYPE_PADDING + 1)}${line}`)) + .join('\n'); + + processedMessage = `${processedMessage}`; + + const typeString = `
${
+    // pad to make "type column" spacing even
+    `${type}${icon}`.padStart(TYPE_PADDING, ' ')
+  }
`; + + return `

${typeString} ${processedMessage}

\n`; +} + +/** + * Custom html output processor intended to be used with + * `cypress-terminal-report`. Generates detailed html log files that log + * every Cypress message in a test-- in other words, log exactly what is + * in the messages window when running `cypress open`) + * + * Example usage in config file: + * ``` + * import installTerminalReporter from + * 'cypress-terminal-report/src/installLogsPrinter' + * + * installTerminalReporter(on, { + printLogsToFile: 'always', + outputRoot: config.reporterOptions.resultsDir, + specRoot: config.reporterOptions.testsDir, + outputTarget:()=>({ 'logs|html': detailedLogHtmlOutputProcessor }), + }) + ``` + */ +export default class HtmlOutputProcessor extends BaseOutputProcessor { + private closingContent = ` + +`; + private beforeClosingContentPos = -this.closingContent.length; + + constructor( + protected file: string, + protected options: PluginOptions + ) { + super(file, options); + this.initialContent = ` + + + + + +${this.closingContent}`; + } + + write(allMessages: AllMessages) { + for (const [spec, tests] of Object.entries(allMessages)) { + let html = `\n

${escapeHtml(spec)}

\n`; + + for (const [test, messages] of Object.entries(tests)) { + html += `

${escapeHtml(test)}

\n`; + for (const message of messages) { + html += formatMessage(message, this.options); + } + html += '
\n'; + } + + this.writeSpecChunk(spec, html, this.beforeClosingContentPos); + } + } +} diff --git a/src/outputProcessor/consoleProcessor.ts b/src/outputProcessor/consoleProcessor.ts index 9f5d2355..18fe4890 100644 --- a/src/outputProcessor/consoleProcessor.ts +++ b/src/outputProcessor/consoleProcessor.ts @@ -89,14 +89,15 @@ const getTypeString = (type: LogType, icon: LogSymbols, color: Colors, padding: return TYPE_STRING_CACHE[key]; } - const typeString = padType(KNOWN_LOG_TYPES.includes(type) ? type : '[unknown]', padding); - const fullString = typeString + icon + ' '; - const coloredTypeString = BOLD_COLORS.includes(color) - ? chalk[color].bold(fullString) - : chalk[color](fullString); - - TYPE_STRING_CACHE[key] = coloredTypeString; - return coloredTypeString; + let typeString = padType(KNOWN_LOG_TYPES.includes(type) ? type : '[unknown]', padding); + typeString += icon + ' '; + typeString = chalk[color](typeString); + if (BOLD_COLORS.includes(color)) { + typeString = chalk.bold(typeString); + } + + TYPE_STRING_CACHE[key] = typeString; + return typeString; }; function consoleProcessor(messages: Log[], options: PluginOptions, data: MessageData) { diff --git a/src/outputProcessor/logsTxtFormatter.ts b/src/outputProcessor/logsTxtFormatter.ts index bfa0a384..d2502447 100644 --- a/src/outputProcessor/logsTxtFormatter.ts +++ b/src/outputProcessor/logsTxtFormatter.ts @@ -2,7 +2,7 @@ import CONSTANTS from '../constants'; import type {Log, Severity} from '../types'; const PADDING = ' '; -const PADDING_LOGS = `${PADDING}`.repeat(6); +const PADDING_LOGS = PADDING.repeat(6); const SEVERITY_ICON = { [CONSTANTS.SEVERITY.ERROR]: 'X', [CONSTANTS.SEVERITY.WARNING]: '!', diff --git a/src/types.ts b/src/types.ts index c2dec764..a3498b6a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -29,7 +29,7 @@ export type State = ValueOf; export type CommandTimings = ValueOf; -export type BuiltinOutputProcessorsTypes = 'txt' | 'json'; +export type BuiltinOutputProcessorsTypes = 'txt' | 'json' | 'html'; // ***************************************************************************** // Objects diff --git a/test/cypress.config.js b/test/cypress.config.js index 61baaecb..f5a1a7f6 100644 --- a/test/cypress.config.js +++ b/test/cypress.config.js @@ -25,6 +25,7 @@ module.exports = defineConfig({ 'not/existing/path/out.txt': 'txt', 'out.txt': 'txt', 'out.json': 'json', + 'out.html': 'html', 'out.cst': function (allMessages) { this.initialContent = 'Specs:\n'; this.chunkSeparator = '\n'; @@ -40,6 +41,7 @@ module.exports = defineConfig({ options.outputTarget = { 'txt|txt': 'txt', 'json|json': 'json', + 'html|html': 'html', 'custom|cst': function (allMessages) { this.initialContent = 'Specs:\n'; this.chunkSeparator = '\n'; diff --git a/test/output/.gitattributes b/test/output/.gitattributes index 0e87050c..6f211714 100644 --- a/test/output/.gitattributes +++ b/test/output/.gitattributes @@ -1,3 +1,4 @@ out.spec.txt text eol=lf out.spec.json text eol=lf +out.spec.html text eol=lf out.spec.cst text eol=lf diff --git a/test/output/out.spec.always.html b/test/output/out.spec.always.html new file mode 100644 index 00000000..77ad063a --- /dev/null +++ b/test/output/out.spec.always.html @@ -0,0 +1,178 @@ + + + + + + + +

cypress/integration/happyFlow.spec.js

+

Happy flow. -> Happy flow

+

    cy:command✔
visit	/commands/network-requests

+

  cy:intercept➟
Method: GET
+                Matcher: "comments/*"

+

    cy:command✔
get	.network-btn

+

    cy:command✔
click	

+

        cy:xhr➟
(getComment) GET https://jsonplaceholder.cypress.io/comments/1
+                Status: 200

+

    cy:command✔
wait	@getComment

+

    cy:command✔
its	.response.statusCode

+

    cy:command✔
assert	expected **200** to equal **200**
+                Actual: 	200
+                Expected: 	200

+

  cy:intercept➟
Method: POST
+                Matcher: "/comments"

+

    cy:command✔
get	.network-post

+

    cy:command✔
click	

+

        cy:xhr➟
(postComment) POST https://jsonplaceholder.cypress.io/comments
+                Status: 201

+

    cy:command✔
wait	@postComment

+

    cy:command✔
assert	expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **email**

+

    cy:command✔
assert	expected **{ Object (host, connection, ...) }** to have property **content-type**

+

    cy:command✔
assert	expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **name=Using+POST+in+cy.intercept()**

+

    cy:command✔
window	

+

    cons:error✘
null,
+                undefined,
+                ,
+                false,
+                function () {}

+

    cy:command✔
window	

+

      cons:log✱
{
+                  "a": "b"
+                },
+                {
+                  "c": "d"
+                },
+                10,
+                string

+

    cy:command✔
window	

+

     cons:warn❖
This is a warning message

+

    cy:command✔
window	

+

    cons:error✘
This is an error message

+

    cy:command✔
window	

+

    cons:error✘
Error: This is an error message with stack.
+                    at Context.eval (https://example.cypress.io/__cypress/tests?p=cypress/integration/happyFlow.spec.js:50:43)

+

    cy:command✔
window	

+

      cons:log✱
This should console.log appear.

+

    cy:command✔
window	

+

      cons:log✱
{
+                  "this": "Is an object",
+                  "with": {
+                    "keys": 12512
+                  }
+                }

+

    cy:command✔
window	

+

     cons:info✱
This should console.info appear.

+

    cy:command✔
window	

+

    cons:debug⚈
This should console.debug appear.

+

  cy:intercept➟
Matcher: {"method":"PUT","url":"comments/*"}
+                Mocked Response: {"statusCode":404,"body":{"error":"whoa, this comment does not exist"},"delayMs":500}

+

    cy:command✔
get	.network-put

+

    cy:command✔
click	

+

        cy:xhr❖
(putComment) STUBBED PUT https://jsonplaceholder.cypress.io/comments/1
+                Status: 404
+                Response body: {
+                  "error": "whoa, this comment does not exist"
+                }

+

    cy:command✔
wait	@putComment

+

    cy:command✔
get	.network-put-comment

+

    cy:command✔
assert	expected **<div.network-put-comment>** to contain **whoa, this comment does not exist**

+

    cy:command✘
get	.breaking-get

+
+ +

cypress/integration/mochaContexts.spec.js

+

main context -> first level test

+

    cy:command✘
get	.breaking-get 1

+
+

main context -> second context -> second level test

+

    cy:command✘
get	.breaking-get 2

+
+

main context -> second context -> third context -> third level test

+

    cy:command✘
get	.breaking-get 3

+
+

unnested before with nested context -> nested context -> the test nested

+

        cy:log✱
log

+
+

unnested before and test with nested context -> not nested

+

        cy:log✱
log

+
+

unnested before and test with nested context -> nested context -> the test nested

+

        cy:log✱
log

+
+ +

cypress/integration/printLogsSuccess.spec.js

+

Print Logs Success. -> Print Logs Success

+

    cy:command✔
visit	/

+

    cy:command✔
contains	cypress

+
+ +

cypress/integration/requests.spec.js

+

Requests. -> GET 200

+

    cy:request✔
https://jsonplaceholder.cypress.io/todos/1
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 1,
+                  "title": "delectus aut autem",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/2
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 2,
+                  "title": "quis ut nam facilis et officia qui",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/3
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 3,
+                  "title": "fugiat veniam minus",
+                  "completed": false
+                }

+

    cy:command✘
get	.breaking-get

+
+

Requests. -> POST 200

+

    cy:request✔
POST https://jsonplaceholder.cypress.io/comments
+                Status: 201
+                Response body: {
+                  "id": 501
+                }

+

    cy:command✘
get	.breaking-get

+
+

Requests. -> GET should give 500 response status

+

    cy:request✘
GET http://localhost:3015/v3/4b2d23ec-4516-4a94-967e-995596d01a32
+                Status: 500 - Internal Server Error
+                Response body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.

+
+

Requests. -> POST should give 400 response status

+

    cy:request✘
POST http://localhost:3015/v3/57a00707-bccf-4653-ac50-ba1c00cad431
+                Status: 400 - Bad Request
+                Response body: {
+                  "status": "Wrong!",
+                  "data": {
+                    "corpo": "corpo da resposta",
+                    "titulo": "titulo da resposta"
+                  }
+                }

+
+

Requests. -> PUT should fail

+

    cy:request✘
PUT https://jsonplaceholder.cypress.io/comments
+                Status: 404 - Not Found
+                Response body: {}

+
+

Requests. -> cypress logging is disabled in the request

+
+

Requests. -> Network error

+

    cy:request✘
POST http://this.does.not.exist
+                Network error: getaddrinfo ENOTFOUND this.does.not.exist

+
+ + + \ No newline at end of file diff --git a/test/output/out.spec.failFast.html b/test/output/out.spec.failFast.html new file mode 100644 index 00000000..75ac884f --- /dev/null +++ b/test/output/out.spec.failFast.html @@ -0,0 +1,46 @@ + + + + + + + +

cypress/integration/requests.spec.js

+

Requests. -> GET 200

+

    cy:request✔
https://jsonplaceholder.cypress.io/todos/1
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 1,
+                  "title": "delectus aut autem",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/2
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 2,
+                  "title": "quis ut nam facilis et officia qui",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/3
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 3,
+                  "title": "fugiat veniam minus",
+                  "completed": false
+                }

+

    cy:command✘
get	.breaking-get

+

    cy:command✔
task	failFastLog, Failed tests: 1/1

+

    cy:command✔
task	failFastLog, Enabling skip mode

+

    cy:command✔
task	failFastShouldSkip, true

+
+ + + \ No newline at end of file diff --git a/test/output/out.spec.globalAfter.html b/test/output/out.spec.globalAfter.html new file mode 100644 index 00000000..ea12f642 --- /dev/null +++ b/test/output/out.spec.globalAfter.html @@ -0,0 +1,38 @@ + + + + + + + +

cypress/integration/allHooks.spec.js

+

All hooks. -> [[ before all #1 ]]

+

        cy:log✱
from before

+
+

All hooks. -> passed it

+

        cy:log✱
from beforeEach

+

        cy:log✱
from it

+

        cy:log✱
from afterEach

+
+

All hooks. -> passed it 2

+

        cy:log✱
from beforeEach

+

        cy:log✱
from it 2

+

        cy:log✱
from afterEach

+
+

All hooks. -> [[ after all #1 ]]

+

        cy:log✱
from after

+
+

All hooks. -> [[ after all #2 ]]

+

        cy:log✱
from after 2

+
+

[[ after all #1 ]]

+

        cy:log✱
global after

+
+ + + \ No newline at end of file diff --git a/test/output/out.spec.hooks.always.html b/test/output/out.spec.hooks.always.html new file mode 100644 index 00000000..262910db --- /dev/null +++ b/test/output/out.spec.hooks.always.html @@ -0,0 +1,137 @@ + + + + + + + +

cypress/integration/afterLogs.spec.js

+

after fails -> the test 1

+

        cy:log✱
log test 1

+
+

after fails -> the test 11

+

        cy:log✱
log test 11

+
+

after fails -> [[ after all #1 ]]

+

        cy:log✱
after log simple

+

    cy:command✘
get	after simple

+
+

after succeeds -> the test 2

+

        cy:log✱
log test 2

+
+

after succeeds -> the test 22

+

        cy:log✱
log test 22

+
+

after succeeds -> the test 222

+

        cy:log✱
log test 222

+
+

after succeeds -> [[ after all #1 ]]

+

        cy:log✱
after 1

+
+

after succeeds -> [[ after all #2 ]]

+

        cy:log✱
after 2

+
+

nested after fails -> nested context -> the test 3

+

        cy:log✱
log test 3 nested

+
+

nested after fails -> nested context -> [[ after all #1 ]]

+

    cy:command✘
get	after nested

+
+

nested after fails -> [[ after all #1 ]]

+

        cy:log✱
log after root

+

    cy:command✘
get	after root

+
+ +

cypress/integration/allHooks.spec.js

+

All hooks. -> [[ before all #1 ]]

+

        cy:log✱
from before

+
+

All hooks. -> passed it

+

        cy:log✱
from beforeEach

+

        cy:log✱
from it

+

        cy:log✱
from afterEach

+
+

All hooks. -> passed it 2

+

        cy:log✱
from beforeEach

+

        cy:log✱
from it 2

+

        cy:log✱
from afterEach

+
+

All hooks. -> [[ after all #1 ]]

+

        cy:log✱
from after

+
+

All hooks. -> [[ after all #2 ]]

+

        cy:log✱
from after 2

+
+ +

cypress/integration/beforeLogs.spec.js

+

before fails -> [[ before all #1 ]]

+

        cy:log✱
some before command

+

    cy:command✘
get	.breaking.get

+
+

before fails -> [[ after all #1 ]]

+

        cy:log✱
after

+
+

before succeeds -> [[ before all #1 ]]

+

        cy:log✱
some before command

+

        cy:log✱
some other before command

+
+

before succeeds -> [[ before all #2 ]]

+

        cy:log✱
some before command from second before hook

+
+

before succeeds -> the test fails

+

        cy:log✱
log

+

    cy:command✘
get	.breaking.get

+
+

before succeeds -> [[ after all #1 ]]

+

        cy:log✱
after before succeeds

+
+

nested before fails -> [[ before all #1 ]]

+

        cy:log✱
some before command not in nested

+
+

nested before fails -> not nested

+

        cy:log✱
not nested

+
+

nested before fails -> nested context -> [[ before all #1 ]]

+

        cy:log✱
some before command in nested

+

    cy:command✘
get	.breaking.get

+
+

nested before fails -> nested context -> [[ after all #1 ]]

+

        cy:log✱
after nested

+
+

nested before fails -> [[ after all #1 ]]

+

        cy:log✱
after not nested

+
+ +

cypress/integration/mochaContexts.spec.js

+

main context -> first level test

+

    cy:command✘
get	.breaking-get 1

+
+

main context -> second context -> second level test

+

    cy:command✘
get	.breaking-get 2

+
+

main context -> second context -> third context -> third level test

+

    cy:command✘
get	.breaking-get 3

+
+

unnested before with nested context -> [[ before all #1 ]]

+

        cy:log✱
before should display before nested context title

+
+

unnested before with nested context -> nested context -> the test nested

+

        cy:log✱
log

+
+

unnested before and test with nested context -> [[ before all #1 ]]

+

        cy:log✱
before should display before nested context title

+
+

unnested before and test with nested context -> not nested

+

        cy:log✱
log

+
+

unnested before and test with nested context -> nested context -> the test nested

+

        cy:log✱
log

+
+ + + \ No newline at end of file diff --git a/test/output/out.spec.hooks.onFail.html b/test/output/out.spec.hooks.onFail.html new file mode 100644 index 00000000..a6fb3951 --- /dev/null +++ b/test/output/out.spec.hooks.onFail.html @@ -0,0 +1,52 @@ + + + + + + + +

cypress/integration/afterLogs.spec.js

+

after fails -> [[ after all #1 ]]

+

        cy:log✱
after log simple

+

    cy:command✘
get	after simple

+
+

nested after fails -> nested context -> [[ after all #1 ]]

+

    cy:command✘
get	after nested

+
+

nested after fails -> [[ after all #1 ]]

+

        cy:log✱
log after root

+

    cy:command✘
get	after root

+
+ +

cypress/integration/beforeLogs.spec.js

+

before fails -> [[ before all #1 ]]

+

        cy:log✱
some before command

+

    cy:command✘
get	.breaking.get

+
+

before succeeds -> the test fails

+

        cy:log✱
log

+

    cy:command✘
get	.breaking.get

+
+

nested before fails -> nested context -> [[ before all #1 ]]

+

        cy:log✱
some before command in nested

+

    cy:command✘
get	.breaking.get

+
+ +

cypress/integration/mochaContexts.spec.js

+

main context -> first level test

+

    cy:command✘
get	.breaking-get 1

+
+

main context -> second context -> second level test

+

    cy:command✘
get	.breaking-get 2

+
+

main context -> second context -> third context -> third level test

+

    cy:command✘
get	.breaking-get 3

+
+ + + \ No newline at end of file diff --git a/test/output/out.spec.onFail.html b/test/output/out.spec.onFail.html new file mode 100644 index 00000000..8be6a42f --- /dev/null +++ b/test/output/out.spec.onFail.html @@ -0,0 +1,163 @@ + + + + + + + +

cypress/integration/happyFlow.spec.js

+

Happy flow. -> Happy flow

+

    cy:command✔
visit	/commands/network-requests

+

  cy:intercept➟
Method: GET
+                Matcher: "comments/*"

+

    cy:command✔
get	.network-btn

+

    cy:command✔
click	

+

        cy:xhr➟
(getComment) GET https://jsonplaceholder.cypress.io/comments/1
+                Status: 200

+

    cy:command✔
wait	@getComment

+

    cy:command✔
its	.response.statusCode

+

    cy:command✔
assert	expected **200** to equal **200**
+                Actual: 	200
+                Expected: 	200

+

  cy:intercept➟
Method: POST
+                Matcher: "/comments"

+

    cy:command✔
get	.network-post

+

    cy:command✔
click	

+

        cy:xhr➟
(postComment) POST https://jsonplaceholder.cypress.io/comments
+                Status: 201

+

    cy:command✔
wait	@postComment

+

    cy:command✔
assert	expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **email**

+

    cy:command✔
assert	expected **{ Object (host, connection, ...) }** to have property **content-type**

+

    cy:command✔
assert	expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **name=Using+POST+in+cy.intercept()**

+

    cy:command✔
window	

+

    cons:error✘
null,
+                undefined,
+                ,
+                false,
+                function () {}

+

    cy:command✔
window	

+

      cons:log✱
{
+                  "a": "b"
+                },
+                {
+                  "c": "d"
+                },
+                10,
+                string

+

    cy:command✔
window	

+

     cons:warn❖
This is a warning message

+

    cy:command✔
window	

+

    cons:error✘
This is an error message

+

    cy:command✔
window	

+

    cons:error✘
Error: This is an error message with stack.
+                    at Context.eval (https://example.cypress.io/__cypress/tests?p=cypress/integration/happyFlow.spec.js:50:43)

+

    cy:command✔
window	

+

      cons:log✱
This should console.log appear.

+

    cy:command✔
window	

+

      cons:log✱
{
+                  "this": "Is an object",
+                  "with": {
+                    "keys": 12512
+                  }
+                }

+

    cy:command✔
window	

+

     cons:info✱
This should console.info appear.

+

    cy:command✔
window	

+

    cons:debug⚈
This should console.debug appear.

+

  cy:intercept➟
Matcher: {"method":"PUT","url":"comments/*"}
+                Mocked Response: {"statusCode":404,"body":{"error":"whoa, this comment does not exist"},"delayMs":500}

+

    cy:command✔
get	.network-put

+

    cy:command✔
click	

+

        cy:xhr❖
(putComment) STUBBED PUT https://jsonplaceholder.cypress.io/comments/1
+                Status: 404
+                Response body: {
+                  "error": "whoa, this comment does not exist"
+                }

+

    cy:command✔
wait	@putComment

+

    cy:command✔
get	.network-put-comment

+

    cy:command✔
assert	expected **<div.network-put-comment>** to contain **whoa, this comment does not exist**

+

    cy:command✘
get	.breaking-get

+
+ +

cypress/integration/mochaContexts.spec.js

+

main context -> first level test

+

    cy:command✘
get	.breaking-get 1

+
+

main context -> second context -> second level test

+

    cy:command✘
get	.breaking-get 2

+
+

main context -> second context -> third context -> third level test

+

    cy:command✘
get	.breaking-get 3

+
+ +

cypress/integration/requests.spec.js

+

Requests. -> GET 200

+

    cy:request✔
https://jsonplaceholder.cypress.io/todos/1
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 1,
+                  "title": "delectus aut autem",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/2
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 2,
+                  "title": "quis ut nam facilis et officia qui",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/3
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 3,
+                  "title": "fugiat veniam minus",
+                  "completed": false
+                }

+

    cy:command✘
get	.breaking-get

+
+

Requests. -> POST 200

+

    cy:request✔
POST https://jsonplaceholder.cypress.io/comments
+                Status: 201
+                Response body: {
+                  "id": 501
+                }

+

    cy:command✘
get	.breaking-get

+
+

Requests. -> GET should give 500 response status

+

    cy:request✘
GET http://localhost:3015/v3/4b2d23ec-4516-4a94-967e-995596d01a32
+                Status: 500 - Internal Server Error
+                Response body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.

+
+

Requests. -> POST should give 400 response status

+

    cy:request✘
POST http://localhost:3015/v3/57a00707-bccf-4653-ac50-ba1c00cad431
+                Status: 400 - Bad Request
+                Response body: {
+                  "status": "Wrong!",
+                  "data": {
+                    "corpo": "corpo da resposta",
+                    "titulo": "titulo da resposta"
+                  }
+                }

+
+

Requests. -> PUT should fail

+

    cy:request✘
PUT https://jsonplaceholder.cypress.io/comments
+                Status: 404 - Not Found
+                Response body: {}

+
+

Requests. -> cypress logging is disabled in the request

+
+

Requests. -> Network error

+

    cy:request✘
POST http://this.does.not.exist
+                Network error: getaddrinfo ENOTFOUND this.does.not.exist

+
+ + + \ No newline at end of file diff --git a/test/output/out.spec.retries.html b/test/output/out.spec.retries.html new file mode 100644 index 00000000..7715179c --- /dev/null +++ b/test/output/out.spec.retries.html @@ -0,0 +1,33 @@ + + + + + + + +

cypress/integration/retries.spec.js

+

fail but win (Attempt 1)

+

        cy:log✱
Hello. currentRetry: 0

+

    cy:command✘
contains	Foobar

+
+

fail but win (Attempt 2)

+

        cy:log✱
Hello. currentRetry: 1

+

    cy:command✘
contains	Foobar

+
+

Retries -> fails (Attempt 1)

+

    cy:command✘
get	breaking

+
+

Retries -> fails (Attempt 2)

+

    cy:command✘
get	breaking

+
+

Retries -> fails (Attempt 3)

+

    cy:command✘
get	breaking

+
+ + + \ No newline at end of file diff --git a/test/output_nested_cucumber_spec/html/cucumber/Happy.html b/test/output_nested_cucumber_spec/html/cucumber/Happy.html new file mode 100644 index 00000000..b9bb3a3a --- /dev/null +++ b/test/output_nested_cucumber_spec/html/cucumber/Happy.html @@ -0,0 +1,56 @@ + + + + + + + +

cypress/integration/cucumber/Happy.feature

+

The Happy -> Opening happy page and getting comments

+

  cy:intercept➟
Method: GET
+                Matcher: "comments/*"

+

    cy:command✔
Before   

+

    cy:command✔
assert   expected **0** to be below **2**

+

    cy:command✔
then     function(){}

+

    cy:command✔
Given    **I open Happy page**

+

    cy:command✔
visit    /commands/network-requests

+

    cy:command✔
then     function(){}

+

    cy:command✔
Then     **I can load comments**

+

    cy:command✔
get      .network-btn

+

    cy:command✔
click    

+

        cy:xhr➟
(getComment) GET https://jsonplaceholder.cypress.io/comments/1
+                Status: 200

+

    cy:command✔
wait     @getComment

+

    cy:command✔
its      .status

+

    cy:command✘
assert     expected **undefined** to equal **200**

+
+

The Happy -> Opening happy page and posting comments

+

  cy:intercept➟
Method: GET
+                Matcher: "comments/*"

+

    cy:command✔
Before   

+

    cy:command✔
assert   expected **1** to be below **2**
+                Actual:  1
+                Expected:        2

+

    cy:command✔
then     function(){}

+

    cy:command✔
Given    **I open Happy page**

+

    cy:command✔
visit    /commands/network-requests

+

    cy:command✔
then     function(){}

+

    cy:command✔
Then     **I can post comment**

+

  cy:intercept➟
Method: POST
+                Matcher: "/comments"

+

    cy:command✔
get      .network-post

+

    cy:command✔
click    

+

        cy:xhr➟
(postComment) POST https://jsonplaceholder.cypress.io/comments
+                Status: 201

+

    cy:command✔
wait     @postComment

+

    cy:command✔
assert   expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **email**

+

    cy:command✘
assert     expected **{ Object (host, connection, ...) }** to have property **Content-Type**

+
+ + + \ No newline at end of file diff --git a/test/output_nested_cypress_grep_spec/html/cypressGrep.spec.html b/test/output_nested_cypress_grep_spec/html/cypressGrep.spec.html new file mode 100644 index 00000000..6a68cef5 --- /dev/null +++ b/test/output_nested_cypress_grep_spec/html/cypressGrep.spec.html @@ -0,0 +1,20 @@ + + + + + + + +

cypress/integration/cypressGrep.spec.js

+

Cypress grep -> run only this

+

    cy:command✔
visit	/

+

    cy:command✔
contains	cypress

+
+ + + \ No newline at end of file diff --git a/test/output_nested_spec/html/callsSuiteInAnotherFile.spec.html b/test/output_nested_spec/html/callsSuiteInAnotherFile.spec.html new file mode 100644 index 00000000..d90d2d8a --- /dev/null +++ b/test/output_nested_spec/html/callsSuiteInAnotherFile.spec.html @@ -0,0 +1,26 @@ + + + + + + + +

cypress/integration/callsSuiteInAnotherFile.spec.js

+

Calls function in another file that creates a sub-suite. -> the test 2

+

    cy:command✘
assert	expected **1** to equal **2**
+                Actual: 	1
+                Expected: 	2

+
+

Calls function in another file that creates a sub-suite. -> sub-suite in different file -> subsuite test 2

+

    cy:command✘
assert	expected **1** to equal **2**
+                Actual: 	1
+                Expected: 	2

+
+ + + \ No newline at end of file diff --git a/test/output_nested_spec/html/cypressGrep.spec.html b/test/output_nested_spec/html/cypressGrep.spec.html new file mode 100644 index 00000000..6a68cef5 --- /dev/null +++ b/test/output_nested_spec/html/cypressGrep.spec.html @@ -0,0 +1,20 @@ + + + + + + + +

cypress/integration/cypressGrep.spec.js

+

Cypress grep -> run only this

+

    cy:command✔
visit	/

+

    cy:command✔
contains	cypress

+
+ + + \ No newline at end of file diff --git a/test/output_nested_spec/html/happyFlow.spec.html b/test/output_nested_spec/html/happyFlow.spec.html new file mode 100644 index 00000000..f9764678 --- /dev/null +++ b/test/output_nested_spec/html/happyFlow.spec.html @@ -0,0 +1,88 @@ + + + + + + + +

cypress/integration/happyFlow.spec.js

+

Happy flow. -> Happy flow

+

    cy:command✔
visit	/commands/network-requests

+

  cy:intercept➟
Method: GET
+                Matcher: "comments/*"

+

    cy:command✔
get	.network-btn

+

    cy:command✔
click	

+

        cy:xhr➟
(getComment) GET https://jsonplaceholder.cypress.io/comments/1
+                Status: 200

+

    cy:command✔
wait	@getComment

+

    cy:command✔
its	.response.statusCode

+

    cy:command✔
assert	expected **200** to equal **200**
+                Actual: 	200
+                Expected: 	200

+

  cy:intercept➟
Method: POST
+                Matcher: "/comments"

+

    cy:command✔
get	.network-post

+

    cy:command✔
click	

+

        cy:xhr➟
(postComment) POST https://jsonplaceholder.cypress.io/comments
+                Status: 201

+

    cy:command✔
wait	@postComment

+

    cy:command✔
assert	expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **email**

+

    cy:command✔
assert	expected **{ Object (host, connection, ...) }** to have property **content-type**

+

    cy:command✔
assert	expected **name=Using+POST+in+cy.intercept()&email=hello%40cypress.io&body=You+can+change+the+method+used+for+cy.intercept()+to+be+GET%2C+POST%2C+PUT%2C+PATCH%2C+or+DELETE** to include **name=Using+POST+in+cy.intercept()**

+

    cy:command✔
window	

+

    cons:error✘
null,
+                undefined,
+                ,
+                false,
+                function () {}

+

    cy:command✔
window	

+

      cons:log✱
{
+                  "a": "b"
+                },
+                {
+                  "c": "d"
+                },
+                10,
+                string

+

    cy:command✔
window	

+

     cons:warn❖
This is a warning message

+

    cy:command✔
window	

+

    cons:error✘
This is an error message

+

    cy:command✔
window	

+

    cons:error✘
Error: This is an error message with stack.
+                    at Context.eval (https://example.cypress.io/__cypress/tests?p=cypress/integration/happyFlow.spec.js:50:43)

+

    cy:command✔
window	

+

      cons:log✱
This should console.log appear.

+

    cy:command✔
window	

+

      cons:log✱
{
+                  "this": "Is an object",
+                  "with": {
+                    "keys": 12512
+                  }
+                }

+

    cy:command✔
window	

+

     cons:info✱
This should console.info appear.

+

    cy:command✔
window	

+

    cons:debug⚈
This should console.debug appear.

+

  cy:intercept➟
Matcher: {"method":"PUT","url":"comments/*"}
+                Mocked Response: {"statusCode":404,"body":{"error":"whoa, this comment does not exist"},"delayMs":500}

+

    cy:command✔
get	.network-put

+

    cy:command✔
click	

+

        cy:xhr❖
(putComment) STUBBED PUT https://jsonplaceholder.cypress.io/comments/1
+                Status: 404
+                Response body: {
+                  "error": "whoa, this comment does not exist"
+                }

+

    cy:command✔
wait	@putComment

+

    cy:command✔
get	.network-put-comment

+

    cy:command✔
assert	expected **<div.network-put-comment>** to contain **whoa, this comment does not exist**

+

    cy:command✘
get	.breaking-get

+
+ + + \ No newline at end of file diff --git a/test/output_nested_spec/html/multiple.dots.in.spec.html b/test/output_nested_spec/html/multiple.dots.in.spec.html new file mode 100644 index 00000000..a71420dc --- /dev/null +++ b/test/output_nested_spec/html/multiple.dots.in.spec.html @@ -0,0 +1,20 @@ + + + + + + + +

cypress/integration/multiple.dots.in.spec.js

+

Multiple dots. -> Multiple dots.

+

    cy:command✔
visit	/commands/network-requests

+

    cy:command✘
get	.breaking-wait

+
+ + + \ No newline at end of file diff --git a/test/output_nested_spec/html/requests.spec.html b/test/output_nested_spec/html/requests.spec.html new file mode 100644 index 00000000..4fea349a --- /dev/null +++ b/test/output_nested_spec/html/requests.spec.html @@ -0,0 +1,78 @@ + + + + + + + +

cypress/integration/requests.spec.js

+

Requests. -> GET 200

+

    cy:request✔
https://jsonplaceholder.cypress.io/todos/1
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 1,
+                  "title": "delectus aut autem",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/2
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 2,
+                  "title": "quis ut nam facilis et officia qui",
+                  "completed": false
+                }

+

    cy:request✔
GET https://jsonplaceholder.cypress.io/todos/3
+                Status: 200
+                Response body: {
+                  "userId": 1,
+                  "id": 3,
+                  "title": "fugiat veniam minus",
+                  "completed": false
+                }

+

    cy:command✘
get	.breaking-get

+
+

Requests. -> POST 200

+

    cy:request✔
POST https://jsonplaceholder.cypress.io/comments
+                Status: 201
+                Response body: {
+                  "id": 501
+                }

+

    cy:command✘
get	.breaking-get

+
+

Requests. -> GET should give 500 response status

+

    cy:request✘
GET http://localhost:3015/v3/4b2d23ec-4516-4a94-967e-995596d01a32
+                Status: 500 - Internal Server Error
+                Response body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.

+
+

Requests. -> POST should give 400 response status

+

    cy:request✘
POST http://localhost:3015/v3/57a00707-bccf-4653-ac50-ba1c00cad431
+                Status: 400 - Bad Request
+                Response body: {
+                  "status": "Wrong!",
+                  "data": {
+                    "corpo": "corpo da resposta",
+                    "titulo": "titulo da resposta"
+                  }
+                }

+
+

Requests. -> PUT should fail

+

    cy:request✘
PUT https://jsonplaceholder.cypress.io/comments
+                Status: 404 - Not Found
+                Response body: {}

+
+

Requests. -> cypress logging is disabled in the request

+
+

Requests. -> Network error

+

    cy:request✘
POST http://this.does.not.exist
+                Network error: getaddrinfo ENOTFOUND this.does.not.exist

+
+ + + \ No newline at end of file diff --git a/test/specs/misc.spec.js b/test/specs/misc.spec.js index 2cbcc09c..ec0af0c7 100755 --- a/test/specs/misc.spec.js +++ b/test/specs/misc.spec.js @@ -40,6 +40,7 @@ describe('Misc.', () => { (error, stdout) => { expect(stdout).to.not.contain(`cypress-terminal-report: Wrote custom logs to txt.`); expect(stdout).to.not.contain(`cypress-terminal-report: Wrote custom logs to json.`); + expect(stdout).to.not.contain(`cypress-terminal-report: Wrote custom logs to html.`); expect(stdout).to.not.contain(`cypress-terminal-report: Wrote custom logs to custom.`); } ); diff --git a/test/utils.js b/test/utils.js index 10ec89d5..a811b577 100644 --- a/test/utils.js +++ b/test/utils.js @@ -95,7 +95,7 @@ export const runTestContinuous = async (command, afterOutput, callback) => { export const outputCleanUpAndInitialization = (testOutputs, outRoot) => { outRoot.value = path.join(__dirname, 'output'); - testOutputs.value = ['out.txt', 'out.json', 'out.cst']; + testOutputs.value = ['out.txt', 'out.json', 'out.html', 'out.cst']; testOutputs.value.forEach((out) => { if (fs.existsSync(path.join(outRoot.value, out))) { fs.unlinkSync(path.join(outRoot.value, out)); @@ -150,7 +150,7 @@ export const expectOutputFilesToBeCorrect = (testOutputs, outRoot, specExtName) export const expectConsoleLogForOutput = (stdout, outRoot, fileNames = [''], toNot = false) => { fileNames.forEach((fileName) => { let ext = path.extname(fileName).substring(1); - if (!['json', 'txt'].includes(ext)) { + if (!['json', 'txt', 'html'].includes(ext)) { ext = 'custom'; } let logString =