cypress-skip-and-only-ui icon indicating copy to clipboard operation
cypress-skip-and-only-ui copied to clipboard

No buttons if tests are not run

Open archigo opened this issue 5 years ago • 4 comments

The buttons do not show up if you cancel the test run before it finishes.

It would be much more useful if you could open the tests you want, cancel them because you don't want to run them all, and then click the one you want.

As it is, whenever you want to change the test you run (if you use single test button) you have wait for all the tests to run before you can select a single test again.

archigo avatar Jul 04 '19 07:07 archigo

I had the same issue. However, even after running all tests, when I click the buttons nothing happens, it just expand/collapses the steps of that test :(

dialex avatar Aug 22 '19 13:08 dialex

Thanks for your great work, I find it very useful and even crucial feature for Cypress... But I just can't get the buttons to appear :( I use it with Angular, followed the install guide, and nothing. Any progress on this?

haskelcurry avatar Sep 04 '19 07:09 haskelcurry

@dialex @mtuzinskiy for the buttons not appearing at all, I suspect its a seperate issue.

For the buttons appearing after a run - this is also very annoying for us - if we have a spec that takes 8 minutes to run, waiting 8 minutes in order to control things makes the plugin not usable. It attaches after because it litterally attaches them using after -> https://github.com/bahmutov/cypress-skip-and-only-ui/blob/master/src/support.tsx#L61

And if you change it to before() and add retry behaviour, the buttons successfully render.. however it seems that cy.task() behaviour when tests have been stopped is to not execute the task. When the tests have all completed and you call cy.task() it runs.

I guess this can be solved the same way as the cypress snapshot plugin - it sets up its own websocket between the front end and its task to communicate so it doesn't need to use cy.task().

@bahmutov are there plans to make this plugin work better, or implement this in core (where it would probably be easier) ? or will this stay in userland and if so, would you accept my suggestion or do you have a better idea?

lukeapage avatar Sep 28 '19 17:09 lukeapage

@lukeapage I think this is very hacky solution (adding buttons after tests finish, etc). While this will stay userspace I want to implement a feature in Cypress core that would give YOUR plugins file a list of all tests found in the spec files after it has been processed by Mocha but before Cypress starts running them. See this branch https://github.com/cypress-io/cypress/tree/let-user-change-tests and this blog post how one could dynamically filter Mocha tests https://glebbahmutov.com/blog/filter-mocha-tests/

bahmutov avatar Sep 28 '19 18:09 bahmutov