question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Context not appearing in reports

See original GitHub issue

I’m attempting to use addContext with tests running in Cypress 2.10 (Windows 10) and the latest version of mochawesome (3.0.2 with reporter at 3.1.2), but the added context isn’t appearing in the report. I’ve added the following test as an example:

const addContext = require('mochawesome/addContext');

describe('example context missing', () => {
    it('should have context', function () {
        expect(1+1).to.eq(2);
        addContext(this, 'context');
    });
});

Here’s the expanded report section for that test: image

And here’s the JSON generated:

      {
        "uuid": "16c93dda-0555-41aa-9d6f-2742af6d8e57",
        "title": "example context missing",
        "fullFile": "",
        "file": "",
        "beforeHooks": [],
        "afterHooks": [],
        "tests": [
          {
            "title": "should have context",
            "fullTitle": "example context missing should have context",
            "duration": 4,
            "state": "passed",
            "speed": "fast",
            "pass": true,
            "fail": false,
            "pending": false,
            "code": "expect(1 + 1).to.eq(2);\naddContext(this, 'context');",
            "err": {},
            "isRoot": false,
            "uuid": "e2403d20-86f4-4730-a017-d20b4c68154b",
            "isHook": false,
            "skipped": false
          }
        ],
        "suites": [],
        "passes": [
          "e2403d20-86f4-4730-a017-d20b4c68154b"
        ],
        "failures": [],
        "pending": [],
        "skipped": [],
        "duration": 4,
        "root": false,
        "rootEmpty": false,
        "_timeout": 2000
      }

I’ve debugged addContext whilst the tests have been running and test.context is set to the string passed in, so the helper appears to be doing it’s work, it just isn’t showing up in the report.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mjhea0commented, Aug 11, 2018

I have mochawesome working here -> https://github.com/testdrivenio/cypress-mochawesome-s3

Essentially-

  1. cypress runs
  2. each spec generates a new report
  3. a custom script combines each mochawesome json file and calculates the stats
  4. html report is then generated
1reaction
StormPoopercommented, Jul 11, 2018

Ah, no, we aren’t currently paying for the dashboard service, the mochawesome report is so we have a nice viewable report within TeamCity, directly with the build in question.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSRS 2008 Report Context Menu not visible in Report Manager
In you scenario, the drop-down menu of the report is now visible, this is really strange, it's hard to say the root reason...
Read more >
2488825 - Access Context of Report Not Working
Go to the work center Business Analytics, view Design Reports. · Search for the report and click on Assign. · From the Show...
Read more >
Right click context menu not showing for table visual in report.
Right-clicking on a table visual in a report does not show the context menu when we first come to the report. If we...
Read more >
Solved: When I click on Flow Context in RITM it does not s...
Solved: I have set the property to TRACE still it doesn't load the flow and keeps showing the message - Flow reports not...
Read more >
Crystal Reports - Some fields not showing in Data Context
I use dataclasses to create my reports. When fields do not show in field explorer go to your dataclasses and change ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found