1.0.2 • Published 2 years ago

testcafe-reporter-inrupt v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

TestCafe Reporter Inrupt

This package is a modification of the original TestCafe Slack reporter.

This TestCafe reporter is configurable to:

  • Sends test results to the Console and/or Slack.
  • Send the report in pieces or as a whole.
  • Optionally includes errors.

Installation

To install this reporter via npm to your TestCafe project, execute:

npm install --save-dev testcafe-reporter-inrupt

Setup

In order to use this TestCafe reporter plugin, it is necessary to add it as your reporter to your TestCafe .testcaferc.json configuration file:

{
  "reporter": [
    {
      "name": "inrupt"
    }
  ]
}

Configuration

In order to use this TestCafe reporter plugin it is necessary to define some .env variables in your test project (i.e., the folder from where your call TestCafe).

  • cd into your test project.
  • Create or edit the .env file by adding the following required variables:
VariableRequired?DefaultDescription
TESTCAFE_REPORT_TOCONSOLENotrueShould the report be sent to the Console?
TESTCAFE_REPORT_CONSOLE_INCLUDEHEADERNofalseInclude Header information in Console report?
TESTCAFE_REPORT_CONSOLE_MERGENofalseShould the test results be merged into a single Console report, or output individually?
TESTCAFE_REPORT_CONSOLE_SHOWERRORSNotrueShould detailed error messages be displayed in the Console report?
TESTCAFE_REPORT_TOSLACKNofalseShould the report be sent to Slack?
TESTCAFE_REPORT_SLACK_INCLUDEHEADERNofalseInclude Header information in Slack report?
TESTCAFE_REPORT_SLACK_MERGENotrueShould the test results be merged into a single Slack report, or output individually?
TESTCAFE_REPORT_SLACK_SHOWERRORSNofalseShould detailed error messages be displayed in the Slack report?
TESTCAFE_SLACK_WEBHOOKYes if reporting to Slack, No otherwise-Slack Webhook URL
TESTCAFE_SLACK_CHANNELNo#testcafeName of the Slack channel to which report will be sent
TESTCAFE_SLACK_USERNAMENotestcafebotName of the Slack user under which the report will be posted

An example .env file is shown below:

TESTCAFE_REPORT_TOCONSOLE = true
TESTCAFE_REPORT_CONSOLE_INCLUDEHEADER = true
TESTCAFE_REPORT_CONSOLE_MERGE = false
TESTCAFE_REPORT_CONSOLE_SHOWERRORS = true

TESTCAFE_REPORT_TOSLACK = true
TESTCAFE_REPORT_SLACK_INCLUDEHEADER = false
TESTCAFE_REPORT_SLACK_MERGE = true
TESTCAFE_REPORT_CONSOLE_SHOWERRORS = false
TESTCAFE_SLACK_WEBHOOK=https://hooks.slack.com/services/*****
TESTCAFE_SLACK_CHANNEL='#testcafe'
TESTCAFE_SLACK_USERNAME=testcafebot

When you use TestCafe API, you can pass the reporter name to the reporter() method:

const inrupt = require('@kevin-inrupt/testcafe-reporter-inrupt')

testCafe
    .createRunner()
    .src('path/to/test/file.js')
    .browsers('chrome')
    .reporter(inrupt) // <-
    .run();

Further Documentation

TestCafe Reporter Plugins

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.6

2 years ago

0.2.8

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago