1.0.26 • Published 1 year ago

@dannysilence/cypress-commands-log v1.0.26

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

cypress-commands-log

Saving executed commands to external file

Based on https://github.com/bahmutov/cypress-failed-log

Usage

In your support/e2e.js (support/e2e.ts) add the following line:

import * as commandLogs from '@dannysilence/cypress-commands-log';
commandLogs.configure(Cypress, Cypress.config, {enabled: true, writeToConsole: true, writeToFile: true});

And in cypress.config.js update setupNodeEvents function:

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  defaultCommandTimeout: 500,
  e2e: {
    setupNodeEvents(on, config) {
      require('@dannysilence/cypress-commands-log')
        .configure(on, config, {enabled: true, writeToConsole: true, writeToFile: true});
    },
  },
})

Output

In cypress folder the directory logs will be created and the files inside will look like the following:

{
  "specName": "cypress\\e2e\\sample3.cy.ts",
  "title": " should pass 1",
  "suiteName": " in positive flows",
  "testName": "Repoter Functionality  in positive flows  should pass 1",
  "testError": "",
  "testCommands": [
    {
      "message": "wait 2500",
      "duration": 1
    },
    {
      "message": "wrap 1",
      "duration": 3
    },
    {
      "message": "assert expected **1** to be above **0**",
      "duration": 2
    },
    {
      "message": "log hello, ",
      "duration": 1
    }
  ]
}
1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago