1.0.26 • Published 3 years ago

@dannysilence/cypress-commands-log v1.0.26

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years 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

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.9

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago