Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporter - the file (filename) property is undefined #1495

Closed
leventecsordas opened this issue Mar 23, 2018 · 10 comments · Fixed by #3960 · May be fixed by qsays/grafana#1
Closed

Reporter - the file (filename) property is undefined #1495

leventecsordas opened this issue Mar 23, 2018 · 10 comments · Fixed by #3960 · May be fixed by qsays/grafana#1
Labels
pkg/server This is due to an issue in the packages/server directory type: bug

Comments

@leventecsordas
Copy link

leventecsordas commented Mar 23, 2018

Current behavior:

When I use junit or any other reporter the file property of the suite object from the runner.on('suite', function(suite) {}) listener is undefined.

Desired behavior:

The file property of the suite should be the name of the file which contains the given test suite.

How to reproduce:

In the example below I used junit reporter, but it can be reproduced with any reporter which contains filename in their report.

cypress run --spec [spec_file].js --reporter junit or cypress run --reporter junit

Bug:
The generated report doesn't contain the file property.

Expected:
You should have a file on the generated report.

Additional Info (images, stack traces, etc)

Suite object from the reporter:

image

Generated report without filename:

image

@wrseward
Copy link

Having this same issue as well.

This would be great to have as part of CircleCI test parallelization timings, as it requires the filenames to be present.

@jennifer-shehane jennifer-shehane added stage: needs investigating Someone from Cypress needs to look at this pkg/server This is due to an issue in the packages/server directory labels Jul 11, 2018
@paast
Copy link

paast commented Oct 26, 2018

Any news on this? Has anyone found a workaround for retrieving spec file names within a reporter?

@KittyGiraudel
Copy link
Contributor

That would be good to have the path to the spec file indeed. :)

@Tarjei400
Copy link

Would be nice to have it, especially beacouse we are using cypress-run to re run failed tests, and we have failed reports collected by Jenkins due to that

@egucciar
Copy link
Contributor

This bug prevents us from parallelizing Cypress in CircleCI by timings.

@ddesna
Copy link

ddesna commented Sep 3, 2019

I'm developing custom reporter and I would like to get screenshot of failed test. Without file name in mocha suite I could not access to cypress/screenshots failed test folder.

@BBE78
Copy link

BBE78 commented Nov 28, 2019

Hi, I'm also interested by a correction on this issue, any news? This missing file information is needed for SonarQube reporters.
I did find a workaround (by adding the spec file path to the root suite) but it alters the root suite name with useless data...

@BBE78
Copy link

BBE78 commented Nov 29, 2019

I've published a NPM package cypress-sonarqube-reporter to workaround this issue...

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Jan 9, 2020
chrisbreiding added a commit that referenced this issue Jan 15, 2020
* fix issue 1495 by adding cypress spec name to mocha suite

* pass file through to reporter

* comment out the log for file

* ensure file is in runnable_props due to changes upstream

* remove commented out log code

* delete mocha.coffee

* add e2e test

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 15, 2020

The code for this is done in cypress-io/cypress#3960, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Jan 15, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 24, 2020

Released in 3.8.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v3.8.3, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/server This is due to an issue in the packages/server directory type: bug
Projects
None yet
9 participants