-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
3.5.0 - it.only no longer works changing while test is open when you have a global after() #5441
Comments
@lukeapage Your issue can be addressed more quickly if you can provide the exact test code for us to run to see the issue. Can you provide? Working on following your steps to recreate currently. |
This is not reproducible in Cypress without the https://github.com/bahmutov/cypress-skip-and-only-ui plugin. Please open an issue in that repo. The below code works. context('Connectors', () => {
it.only('test 1', () => {
cy.visit('https://example.cypress.io/commands/connectors')
cy.get('.connectors-each-ul>li')
})
it('test 2', () => {
cy.visit('https://example.cypress.io/commands/connectors')
cy.get('.connectors-its-ul>li')
})
after(() => {
cy.log('after')
})
}) |
this reproduces it: |
its not always straight away, but if you try changing |
it actually happens at the end of executing the test where it has a |
@jennifer-shehane please re-open this |
I use webstorm, but I reproduced it also with notepad++ (see screenshot).
Because your screenshot is after the It may be that this bug occurs when editing the test whilst it is running rather than after it has finished (so a wait may help?) I am on windows, but by the looks of the js exception, I would be surprised if it was os specific. I can reproduce in chrome and electron. |
I get this in the chrome console
And after I get that error, on the next edit of my text editor and save - the spec window is broken forever |
Yah, I am doing this and can't recreate. Do you have manual saving on in your IDE? Some IDEs auto-save as you type after some delay, just wondering if that is an aspect. I only have manual saving on. Thanks for sending the console error, that is helpful. |
Only manual saving and as i said, I tried 2 editors |
I can try it on mac tomorrow to see if its windows specific |
Hmm, could not recreate this on Mac. Tried adding skip ony ui plugin - but the plugin does not seem to work at all. |
I can reproduce on mac too - but it was harder - I added wait commands and then switched between it and it.only 5 or 6 times whilst the command is waiting and then it breaks. So it probably is not OS dependent but timing dependent. Maybe you're on faster macs than me or something along those lines. This is again just using my PR to cypress-test-tiny. |
Note that when it breaks the timer continues forever and No commands were issues during test is present under both tests. Editing the file again does not fix it. This is relatively low priority because we can just stop using skip and only ui plugin, but if I were to need a global |
This is no longer reproducible in 4.2.0 |
Oops, this is reproducible, forgot to read all my steps - it doesn't happen straight away but only after a few times of editing the spec file. |
I'm still not able to reproduce this. I was suspecting that this PR in 4.2.0 should have fixed this. #6620 Honestly, there's nothing we can do without being able to reproduce this though. |
Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please comment in this issue with a reproducible example and we will consider reopening the issue. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. |
Current behavior:
When I change one test to
it.only
I end up with:The error is here:
where
r.hookName
isundefined
.Desired behavior:
Works as in 3.4.3
Steps to reproduce: (app code and test code)
Note: workaround, closing the window and re-opening will work
It seems to be caused by having a global
after
: https://github.com/bahmutov/cypress-skip-and-only-ui/blob/master/src/support.tsx#L61so I'm raising here as it seems like its more likely a global cypress issue, but of course it could be skip and only ui
Versions
windows, cypress 3.5.0, running in electron
The text was updated successfully, but these errors were encountered: