Comments (7)
If you run npm ls mochawesome-report-generator
, what version is installed?
from mochawesome-report-generator.
If you run
npm ls mochawesome-report-generator
, what version is installed?
from mochawesome-report-generator.
So using the JSON above with the CLI works. Can you provide a simple test that reproduces the issue?
from mochawesome-report-generator.
Hmm you're correct. the above JSON works correctly. Here's an updated one which is giving me issues.
{
"stats": {
"suites": 2,
"tests": 4,
"passes": 3,
"pending": 1,
"failures": 0,
"start": "2018-10-04T17:29:22.538Z",
"end": "2018-10-04T17:32:39.970Z",
"duration": 197432,
"testsRegistered": 3,
"passPercent": 150,
"pendingPercent": 33.3,
"other": 0,
"hasOther": false,
"skipped": 0,
"hasSkipped": false,
"passPercentClass": "success",
"pendingPercentClass": "danger"
},
"suites": {
"uuid": "7f4ab000-c7fb-11e8-9143-33aa91f517b9",
"title": "",
"fullFile": "",
"file": "",
"beforeHooks": [],
"afterHooks": [],
"tests": [],
"suites": [{
"uuid": "9851cc5c-02ed-4b43-ae34-c4406270abf9",
"title": "Image Diff 1",
"fullFile": "",
"file": "",
"beforeHooks": [],
"afterHooks": [],
"tests": [{
"title": "Draw Polygon and check for Image diff. Test should fail",
"fullTitle": "Image Diff 1 Draw Polygon and check for Image diff. Test should fail",
"duration": 0,
"state": "pending",
"pass": false,
"fail": false,
"pending": true,
"code": "",
"err": {},
"isRoot": false,
"uuid": "f66916af-e8f6-4cb8-a1b2-c2b8e77898e4",
"isHook": false,
"skipped": false,
"timedOut": false
}],
"suites": [],
"passes": [],
"failures": [],
"pending": ["f66916af-e8f6-4cb8-a1b2-c2b8e77898e4"],
"skipped": [],
"duration": null,
"root": false,
"rootEmpty": false,
"_timeout": 2000
}, {
"uuid": "c0d62fb7-1bef-421b-b069-1cc62a6751da",
"title": "Parcel Tests",
"fullFile": "",
"file": "",
"beforeHooks": [],
"afterHooks": [],
"tests": [{
"title": "Parcel Copied 1.1: Verify Parcel is copied",
"fullTitle": "Parcel Tests Parcel Copied 1.1: Verify Parcel is copied",
"duration": 67585,
"state": "passed",
"speed": "slow",
"pass": true,
"fail": false,
"pending": false,
"code": "\ncy.searchAddress(address);\ncy.get(\".js-popout_card\").click();\n// Poput should appear\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-SubjectSummary\\\"]\").then(function ($modal) {\n var display = $modal.css(\"display\");\n cy.expect(display).to.equal(\"block\");\n});\ncy.wait(5000);\ncy.get(\"body\").screenshot(\"notCopied\");\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-SubjectSummary\\\"] .ui-icon-closethick\").click();\n// Popout should not appear.\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-SubjectSummary\\\"]\").then(function ($modal) {\n var display = $modal.css(\"display\");\n cy.expect(display).to.equal(\"none\");\n});\ncy.wait(5000);\n// Compare the snapshots test should fail.\ncy.get(\"body\").screenshot(\"Copied\");\n// Close all dialogs\ncy.get(\".js-close_card > .fa\").click();",
"err": {},
"isRoot": false,
"uuid": "0fe4de10-91a0-4fc3-933d-726478ea36e3",
"isHook": false,
"skipped": false,
"timedOut": false
}, {
"title": "Shared Documents 1.2: Manage Documents command. Upload a file and save.",
"fullTitle": "Parcel Tests Shared Documents 1.2: Manage Documents command. Upload a file and save.",
"duration": 12851,
"state": "passed",
"speed": "slow",
"pass": true,
"fail": false,
"pending": false,
"code": "\ncy.searchAddress(address);\ncy.get(\".title\").contains(\"Shared Documents\").click();\ncy.get(\".command_name\").contains(\"Manage Documents\").scrollIntoView().click();\ncy.get(\".ui-dialog-title\").contains(\"Attachments\").should(\"be.visible\");\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-4\\\"] > .ui-dialog-buttonpane > .ui-dialog-buttonset > :nth-child(1) > .ui-button-text\").contains(\"Add\").last().click();\ncy.upload_file2(\"TestAutomation.csv\", \"#attach_doc_browse_file\");\ncy.get(\"#attach_doc_desc\").type(\"Testing upload\");\ncy.get(\".ui-dialog-title\").contains(\"Attach a file\").should(\"be.visible\").then(function ($modal) {\n var id = $modal.attr(\"id\");\n // Click the Ok Button\n cy.get(\"[aria-labelledby=\" + id + \"] .ui-button-text\").contains(\"OK\").click();\n});\ncy.get(\"#attach_doc_list_dialog a\").contains(\"TestAutomation.csv\").should(\"be.visible\");\n// Remove the created attachment.\ncy.get(\"#attach_doc_list_dialog [title=\\\"Remove from list\\\"]\").click();\ncy.get(\".ui-button-text\").contains(\"Yes\").click();\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-4\\\"] > .ui-dialog-buttonpane > .ui-dialog-buttonset > :nth-child(2) > .ui-button-text\").contains(\"Close\").click();",
"err": {},
"isRoot": false,
"uuid": "9216292d-16ce-4e84-bbb8-2b36ac466c0b",
"isHook": false,
"skipped": false,
"timedOut": false
}, {
"title": "Shared Notes: Manage Notes. Upload a note and save.",
"fullTitle": "Parcel Tests Shared Notes: Manage Notes. Upload a note and save.",
"duration": 12724,
"state": "passed",
"speed": "slow",
"pass": true,
"fail": false,
"pending": false,
"code": "\ncy.searchAddress(address);\ncy.get(\".title\").contains(\"Shared Notes\").click();\ncy.get(\".command_name\").contains(\"Manage Notes\").scrollIntoView().click();\ncy.get(\".ui-dialog-title\").contains(\"Notes\").should(\"be.visible\");\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-3\\\"] > .ui-dialog-buttonpane > .ui-dialog-buttonset > :nth-child(1) > .ui-button-text\").contains(\"Add\").last().click({\n force: true\n});\ncy.get(\".editAttributeLabel\").contains(\"Title\").next().clear().type(title);\ncy.get(\".editAttributeLabel\").contains(\"type\").next().clear().type(noteType);\ncy.get(\".editAttributeLabel\").contains(\"Note\").next().clear().type(note);\ncy.get(\".editAttributeSubmit\").click();\ncy.get(\"#AddNotesListDiv label u\").first().contains(title).should(\"be.visible\");\n// Remove the created attachment.\ncy.get(\"#AddNotesListDiv [title=\\\"Remove from list\\\"]\").click();\ncy.get(\"[aria-labelledby=\\\"ui-dialog-title-3\\\"] > .ui-dialog-buttonpane > .ui-dialog-buttonset > :nth-child(2) > .ui-button-text\").contains(\"Close\").click();",
"err": {},
"isRoot": false,
"uuid": "6f9b953b-17e4-4ab7-886e-8a366cdb3ff2",
"isHook": false,
"skipped": false,
"timedOut": false
}],
"suites": [],
"passes": ["0fe4de10-91a0-4fc3-933d-726478ea36e3", "9216292d-16ce-4e84-bbb8-2b36ac466c0b", "6f9b953b-17e4-4ab7-886e-8a366cdb3ff2"],
"failures": [],
"pending": [],
"skipped": [],
"duration": 93160,
"root": false,
"rootEmpty": false,
"_timeout": 2000
}],
"passes": [],
"failures": [],
"pending": [],
"skipped": [],
"duration": 0,
"root": true,
"rootEmpty": true,
"_timeout": 2000
},
"copyrightYear": 2018
}
I was able to isolate the issue and it occurs at:
"state": "pending",
If this is either "pending" or "skipped" the report cannot be created.
from mochawesome-report-generator.
Ok, so the change to allow pending
and skipped
states is straightforward. But here's what's odd, I can't seem to find any place in mocha's codebase where the test state would ever be set to pending
or skipped
. Same inside mochawesome. From what I can tell state
should only ever be passed
or failed
. Can you provide a repo with some sample tests that gets the JSON to look like that?
from mochawesome-report-generator.
Ok, so the change to allow
pending
andskipped
states is straightforward. But here's what's odd, I can't seem to find any place in mocha's codebase where the test state would ever be set topending
orskipped
. Same inside mochawesome. From what I can tellstate
should only ever bepassed
orfailed
. Can you provide a repo with some sample tests that gets the JSON to look like that?
https://github.com/stephenchan9/cypressTest
I am running my tests using Cypress. Here's a small test for the issue.
from mochawesome-report-generator.
I am running my tests using Cypress.
Ah, that's a key detail. Looks like Cypress alters the mocha output so it can end up slightly different from what mochawesome expects.
from mochawesome-report-generator.
Related Issues (20)
- Feature: Statistics on suite
- Snapshots stopped showing up on reports after upgrade to v6.0.1 HOT 1
- Add option to avoid use of custom fonts (assets) HOT 1
- How can I get the title of my spec file/describe as my HTML report file namne HOT 5
- Unlimit mochawesome report files above 1000 and rename them HOT 1
- .html extension duplication in 6.1.0 HOT 6
- Please consider progressive enhancement to avoid blank pages when CSPs don't allow JS HOT 3
- Pattern UKStagingJsonReports/.jsons/*.json matched no report files HOT 8
- formatDuration raises sometimes an "Expected a finite number" exception (and it displays a blank screen) HOT 1
- Report shows passed steps as pending HOT 3
- Failures array empty in report
- Asset folder is getting generate even after --inline=true argument
- Copy Text from Test Header
- Please add line number for soure code displaying HOT 1
- Failing to use [name] for reportFilename HOT 1
- Test result file types/interfaces
- Unable to format the "context" section of the mochawesome report
- Ability to show hooks duration in the generated report
- Assets not placed in correct directory
- Reduce the file size mochawesome report
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mochawesome-report-generator.