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

Component testing "Open in IDE" link broken #21684

Closed
sync-by-unito bot opened this issue May 30, 2022 · 18 comments
Closed

Component testing "Open in IDE" link broken #21684

sync-by-unito bot opened this issue May 30, 2022 · 18 comments
Assignees
Labels
CT Issue related to component testing type: bug

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented May 30, 2022

Mirror of #17272

Current behavior

When trying to open my test on the right line, using the "Open in IDE" link, nothing happens.

This is what I see:

!125167656-488ccc00-e167-11eb-917f-eca13426d666.mov|width=100%!

NOTE: It does not depend on Webpack or Vite, both link fail the same way.

Desired behavior

I would like to be taken to my test on the correct line

Test code to reproduce

Versions

Cypress 9.1.1

┆Issue is synchronized with this Jira Bug by Unito
┆Attachments: 125167656-488ccc00-e167-11eb-917f-eca13426d666.mov
┆author: Bart Ledoux
┆epic: CT Post Unification Release
┆friendlyId: UNIFY-655
┆priority: Low
┆sprint: Unification Release Backlog
┆taskType: Bug

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Mark Noonan commented:

Bart Ledoux I think our resolution is to remove this button for now right?

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Bart Ledoux commented:

It is sad but we don’t have a choice.

The option would probably be more useful in ct than in e2e.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Zach Bloomquist commented:

This is also broken in e2e with the unified runner. Why is there not a choice for removing it?

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Bart Ledoux commented:

Zach Bloomquist solution is to remove it in 10.0 without option to turn it on

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Zach Bloomquist commented:

Bart Ledoux Is there a technical blocker? You said “we don’t have a choice”, I’m not sure what this is referring to, this worked before right?

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Bart Ledoux commented:

It is using a big ol’ hack from how chromium presents stack traces in iframes. Unfortunately this option is not really available in CT as we are missing one context frame for the driver.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Bart Ledoux commented:

The way I would implement this is :

  • in open mode
  • use babel to parse the current spec file
  • add a parameter to each describe/it/context to give cypress the exact line and column where to focus
  • Use this context parameter instead of the stack trace to open the ide

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Bart Ledoux commented:

For reference here is the line where I believe this links target is calculated in 9.0

https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cypress/mocha.ts#L361 ( https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cypress/mocha.ts#L361|smart-link )

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Mark Noonan commented:

Chris Baus talk with Brian, he may have a better way of doing this so we can keep it

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Chris Baus commented:

Chris Baus High impact of unknown scope

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Brian Mann commented:

I’m working on this FYI

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Chris Baus commented:

Brian Mann Is this still being worked on? It has been in progress for awhile. We are trying to clear out everything in progress

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Lachlan Miller commented:

I’d like to pick this up, I’ll see where Brian Mann is at.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Brian Mann commented:

Lachlan Miller this is due to CT stack traces - its the same issue and is referenced above. Once stack traces works, this will automatically work. It’s just another “issue” cropping up from the root cause.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Brian Mann commented:

Before anyone picks up this issue - please come talk to me. The root/parent issue is CT Stack Traces - once that is fixed all the subsequent issues go away.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Lachlan Miller commented:

Right, gotcha Brian Mann . For some reason I thought this was just about going to the spec, not the specific line, since the ticket said “I would like to be taken to my test on the first line”. I’m going to change this to the “correct line”.

@rmmanseau
Copy link

the open in IDE button is still broken in 10.10.0 for me, is this issue being prioritized? Accurate stack traces & the ability to jump to the failing assert are pretty essential features for a testing framework

@lmiller1990
Copy link
Contributor

@rmmanseau This is working for me now -- I think fixed in #23916. I tested and this works on all my machines (windows/macos/linux) on Cy 11 and 12.

If you are still having an issue, it might be worth creating a new one and sharing

  1. cypress version
  2. os
  3. anything else relevant

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing type: bug
Projects
None yet
Development

No branches or pull requests

3 participants