Giter Club home page Giter Club logo

testcafe-reporter-html's Introduction

testcafe-reporter-html

PICUS' HTML reporter generator for TestCafe automated tests. It provides an HTML report of a TestCafe task(s) execution, as well as feedback on the errors, if these occurred. Also it provides an easy way to view the screenshots from failing tests.

Build Status

Testcafé Reporter HTML

Table of Contents

Installation and setup

1. Install package

$ npm install testcafe-reporter-html

2. Add the reporter flag to your test task runner

$ testcafe chrome test_folder/ --reporter html

3. Configure the output file

By default the html is written to stdout. To write the html to a file use the TestCafe build-in method:

$ testcafe chrome test_folder/ --reporter html:path/to/my/file.html

Contributing

If you'd like to contribute a feature or bugfix: Thanks! To make sure your fix/feature has a high chance of being included, please read the following guidelines:

  1. Post a pull request.
  2. Make sure there are tests! We will not accept any patch that is not tested. It's a rare time when explicit tests aren't needed. If you have questions about writing tests for testcafe-reporter-html, please open a GitHub issue.

Please see CONTRIBUTING.md for more details on contributing and running test.

Thank you to all the contributors!

By participating in this project, you agree to abide by the PICUS code of conduct.

LICENSE

MIT License - PICUS

testcafe-reporter-html's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

testcafe-reporter-html's Issues

HTML tags are not esacped in error details

I'm using TestCafe with TypeScrpt and I noticed that in some cases errors from TestCafe are cointaining type definitions which are treated by browser as opening HTML tag. Fo example:
let myArray: Array<object> = [];
This also affects a stacktrace present in an error, which sometimes contains lines similar to the one below:
at MyClass.<anonymous> (C:\Path\to\file.ts)
This causes that errors displayed in the browser are not 100% correct and entire HTML structure is jumbled (as some browsers are automatically closing unclosed tags at the end of a DOM structure)

How to generate these reports in jenkins server

I'm using this tool in my local and it's generating the reports, that's pretty fine, but I wanted to generate a similar kind of report in Jenkins. What is the procedure? I did follow the same way that I did on my local but it won't work. Is there any blog or documentation for the same?

Screenshots not displaying in report

I'm currently using version 1.4.4 and I'm not able to see screenshots in the HTML report that is generated.

This is how I have screenshots configured in my testcafe config file:

"screenshots" : {
    "takeOnFails": true,
    "path": "build/integration-tests/",
    "pathPattern": "failed_test_${TEST_INDEX}/${BROWSER}/${FILE_INDEX}.png"
  }

Is there a setting I'm missing or some other change needed to get this feature to work?

Can Screenshots be embedded in this report for failed tests?

Hi,

I have the following line in my package.json
"test-with-html-reports": "testcafe chrome TestCafe-Demo/tests/ --reporter html:TestCafe-Demo/reports/html -e --proxy https.mycom.test.com:7000 -S -s artifacts/screenshots",

As you can see, I am making screenshots in the folder "artifacts" when the test fails. Could this be somehow shown in the report. Does this reporter plugin support that ?

Suggestion: get rid of file saving functionality

Hello there!

Is there any significant why do you use your own report file saving mechanism instead of the one that comes with testcafe?

It seems like I could use command
testcafe --reporter html:public/index.html documentation
instead of creating tcr-html.config.js file.

Am I missing something?

Conflict using testcafe, doesn't work

I tried many times but testcafe didn't found tests.

$ npm install testcafe-reporter-html
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: This module relies on Node.js's internals and will break at some point. Do not use it, and update to [email protected].
npm WARN deprecated [email protected]: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.

> [email protected] postinstall /Users/renan.bastos/Desktop/git/orchestration/idns-api/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm WARN saveError ENOENT: no such file or directory, open '/Users/renan.bastos/Desktop/git/orchestration/idns-api/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/renan.bastos/Desktop/git/orchestration/idns-api/package.json'
npm WARN [email protected] requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN idns-api No description
npm WARN idns-api No repository field.
npm WARN idns-api No README data
npm WARN idns-api No license field.

+ [email protected]
added 660 packages from 778 contributors and audited 4740 packages in 50.169s
found 9 vulnerabilities (1 low, 8 high)
  run `npm audit fix` to fix them, or `npm audit` for details
$ TEST_ENV=stage testcafe 'firefox' functional/main.js -r html
Using locally installed version of TestCafe.
ERROR No tests to run. Either the test files contain no tests or the filter function is too restrictive.

Suggestion: have all code in src, not in lib folder. Get rid of output (lib/*.js) files

Currently the code in the output file lib/index.js is more up to date than the source code src/index.js. E.g. sorting, test numbers and url to failed tests (errors) are implemented in te output but nog in the source code.
It might be forgotten to commit the last changes in src/index.js (and update tests), and to remove lib/* from git?
Now, when I checkout, install and build, I get another version than the one published on npmjs.com

Video & metadata for tests

Hi,

I want to ask if you're planning to support showing meta data and videos in report. That could be nice for representing results to the management

Not able to implement the Report in Runner class

Please help in getting the reports generated through runner class

runner class ===
const createTestCafe = require ('testcafe');
let testcafe = null;

createTestCafe('localhost', 1337)
.then(tc => {
testcafe = tc;
const runner = testcafe.createRunner();

return runner
.src(['tests/my-demo.js'])
.browsers(['safari'])
.reporter('Reports/')
.run();
})
.then(failedCount => {
console.log('Tests failed: ' + failedCount);
testcafe.close();
});

====
Getting below error
TestCafe nimit$ node runner.js
Error: The provided "html:Reports/" reporter does not exist. Check that you have specified the report format correctly.
at /Users/nimit/TestCafe/node_modules/testcafe/src/runner/bootstrapper.js:146:27
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 0)
Nimits-MacBook-Pro:TestCafe nimit$ node runner.js
Error: The provided "Reports/" reporter does not exist. Check that you have specified the report format correctly.
at /Users/nimit/TestCafe/node_modules/testcafe/src/runner/bootstrapper.js:146:27
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 0)

Dependencies should be devDependencies

Hi,

When using the reporter in my project the dependencies in that project explode because of all the dependencies that come with the testcafe-reporter-html package. One such example is eslint. From my own project:

yarn why v1.19.1
[1/4] 🤔  Why do we have the module "eslint"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "testcafe-reporter-html#gulp-eslint" depends on it
   - Hoisted from "testcafe-reporter-html#gulp-eslint#eslint"
info Disk size without dependencies: "4.18MB"
info Disk size with unique dependencies: "14.73MB"
info Disk size with transitive dependencies: "36.93MB"
info Number of shared dependencies: 74

Upon inspection I noticed that none of the dependencies in the package are runtime dependencies. So I made PR #28 that moves all non-runtime dependencies to devDependency. Therefore they won't be included when using the package in another project.
Travis build has run successfully and successfully tested it with my local Testcafe project.

In a README.md have not a screenshot

In a title page of the project I can't find a screenshot of resulted html file.
I think you should add it to show why I need install your plugin.

NPM audit fails

Hi!

would it be possible to update paths/dependencies as currently npm audit reports several vulnerabilities in this package?

Thank You.

Report is written to file index.html by default

Readme states that report is returned by default to stdout, but in reality it is also saved to a file named index.html on a root level. It happens when I'm running TestCafe through programming interface (https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/runner.html#reporter).
Additionally when I specify outStream argument to write to file (saved in specific repository), it's being saved there properly but reporter still saves the same result to index.html file in root folder.

HTML report, screenshots and videos not generated when running Testcafe tests

Hello,

We want to change the automated test execution from Jenkins to GitHub.
I have managed to execute the tests and see in the console what is happening during the execution, but reports are not generated in the specified folders, so no artefacts are published.
I am doing the following steps:

  1. checkout repository
  2. setup node JS
  3. Install Test Cafe and create reports folders
    • npm install (in package.json it is defined the following reporter: "testcafe-reporter-html": "^1.4.6")
    • mkdir -p $SCREENSHOTS_DIR $VIDEOS_DIR $REPORTS_DIR => all variables are defined in the job like this:
      image
  4. Run tests:

image
image

  1. Upload artifacts:
    name: Upload artificts
    uses: actions/upload-artifact@v3
    if: always()
    with:
    name: TestReport
    path: |
    artifacts

The tests are executed, but the following warning appears on publish artefacts:
image

Do you have any idea what I am doing wrong?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.