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

Screenshots saved under 'All Specs' directory when running all specs #2319

Closed
chrisbreiding opened this issue Aug 10, 2018 · 10 comments
Closed
Labels

Comments

@chrisbreiding
Copy link
Contributor

We want to save screenshots under a directory with the spec path, but when running all specs, all screenshots end up under an All Specs directory. We need to ensure each screenshot gets saved under its own spec's directory when running all specs.

See #2091 (comment)

@chrisbreiding chrisbreiding self-assigned this Aug 10, 2018
@chrisbreiding chrisbreiding added this to the Sprint 6 milestone Oct 9, 2018
@chrisbreiding chrisbreiding removed this from the Sprint 6 milestone Oct 15, 2018
@cdeutsch
Copy link

cdeutsch commented Nov 1, 2018

This has been a major pain point for me.

Related (or the root cause), Cypress.spec.name should always return the spec being run (ex my-subfolder/my-test.spec.ts), not All Specs

@brian-mann
Copy link
Member

This is really part of the refactor that needs to happen to All Specs. We don't really want to ever run All Specs the way we're currently doing it.

In fact this is hangover from when we implemented spec isolation and there is an open issue that discusses possible avenues for handling it better.

TLDR: when running all the specs it will "transition" between specs so that each still loads in isolation. That would fix this issue as well.

#1586

@ghost
Copy link

ghost commented Jul 15, 2019

I see that the assigned people were removed, is this on hold? Or do we have a timeline for this issue?

@jennifer-shehane
Copy link
Member

This issue is still in the 'ready for work' stage, which means no work has been done on this issue as of today, so we do not have an estimate on when this will be delivered.

@joby-aydin
Copy link

joby-aydin commented Oct 30, 2019

Mine is not under the specs actually and I do not have any issue with it.
image

@suchipi
Copy link

suchipi commented Feb 2, 2020

I'd like to contribute a fix for this bug. Where would I start?

@waniparag
Copy link

waniparag commented Aug 7, 2020

We have also seen a issue where in when we run a particular set of tests with spec for eg: if all tests under UI folder then if tests have been stored under multiple subfolders then path from mochawesome doesnt report correctly leading to screenshot not displaying in the mochawesome reports , My code looks like this // //adding screenshots to the report

const addContext = require('mochawesome/addContext');
Cypress.on('test:after:run', (test, runnable) => {
  if (test.state === 'failed') {
    const screenshotFileName = `${runnable.parent.title} -- ${test.title} (failed).png`;
    addContext(
      {
        test,
      },
      `assets/${Cypress.spec.name}/${screenshotFileName}`
    );
  }

folder structure is abc > def > ui\out\clinic\appointments_page_test.js\ then the screenshots by default dont go into the folder.

@vegerot
Copy link

vegerot commented Mar 16, 2021

@jennifer-shehane can I get some response from a project manager or engineer about the status of this? I am willing to contribute to this, with the proper guidance

@jennifer-shehane
Copy link
Member

@vegerot This is not a priority for our team currently, but we would review a PR to fix this. Check out our contributing doc.

@emilyrohrbough
Copy link
Member

Run All specs functionality was removed in Cypress 10.0.0. See #21628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants