Giter Site home page Giter Site logo

Comments (7)

adamgruber avatar adamgruber commented on June 4, 2024

If you run npm ls mochawesome-report-generator, what version is installed?

from mochawesome-report-generator.

stephenchan9 avatar stephenchan9 commented on June 4, 2024

If you run npm ls mochawesome-report-generator, what version is installed?

from mochawesome-report-generator.

adamgruber avatar adamgruber commented on June 4, 2024

So using the JSON above with the CLI works. Can you provide a simple test that reproduces the issue?

from mochawesome-report-generator.

stephenchan9 avatar stephenchan9 commented on June 4, 2024

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.

adamgruber avatar adamgruber commented on June 4, 2024

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.

stephenchan9 avatar stephenchan9 commented on June 4, 2024

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?

https://github.com/stephenchan9/cypressTest
I am running my tests using Cypress. Here's a small test for the issue.

from mochawesome-report-generator.

adamgruber avatar adamgruber commented on June 4, 2024

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)

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.