cucumber / vscode

Official Visual Studio Code Extension for Cucumber
MIT License
62 stars 16 forks source link

Run scenarios #69

Open aslakhellesoy opened 2 years ago

aslakhellesoy commented 2 years ago

🤔 What's the problem you're trying to solve?

I don't want to leave my editor to run scenarios

✨ What's your proposed solution?

A keyboard shortcut for running the scenario on the current line, or all the scenarios, or all the scenarios in a directory, or filtered by tags etc etc.

This would run Cucumber with the message formatter, send the messages to a temporary file, parse the contents of that file (using this class) and decorate lines in the code with a background indicating the status. Errors can be expanded straight in the editor. Stack trace elements would be links.

How to execute Cucumber depends on the Cucumber implementation, so the editor would have to know how to deal with each implementation. We should provide a setting to allow users to override how Cucumber is run.

gasparnagy commented 2 years ago

I have just payed with the https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp extension for Robot Framework. They integrate with the tests tab of vscode... pretty nice.

image

sijakret commented 1 year ago

I was just wondering about a feature like this as well. It would increase ergonomics quite a bit!

Could be implemented very similarly to how npm scripts are made runnable from the code

image

So when you hover over one of

It could show a direct way to execute the corresponding test(s). For instance via a configurable commandline or vscode command. Is something like this on the roadmap?

yaffol commented 1 year ago

This feature would be huge for me. I really want to write my tests as executable specifications, and we are doing that on the backend, but I'm not yet happy with the tooling for the frontend. I am using VSCode and playwright for most of the frontend e2e tests, and I don't yet find a combination of toolchains that works ergonomically enough to honestly recommend it to other members of the team, so I don't yet adopt BDD on the frontend.

Something really nice about Cypress was the DX of the cy:open Watcher - and the VSCode test explorer is close to that. If this (test explorer integration) were working with the cucumber-vscode extension, I would feel I could hand the integration over to the rest of the team as it gives clear visibility of the tests.

I realise you can always see test output by dropping to the terminal, but there is strong ergonomics behind not having to leave you IDE, especially for frontend development, in my experience.

Artalus commented 2 months ago

+1 for a better integration of Feature files with VS Code Test Explorer capabilities. Would love to see the list of scenarios in the side tab, as well as to have a neat Run Test | Debug Test lens-button above the scenario name...

nextlevelbeard commented 2 months ago

+1 Would also love to see being able to define a custom command in the extension settings Useful for using Cucumber with other frameworks like webdriverIO

kieran-ryan commented 2 months ago

@Artalus and @nextlevelbeard, appreciate the bump on this - improves insight into the desire for this feature - would be a significant enhancement. @nextlevelbeard if you could also pop a thumbs up (👍) on the top-level comment that would be great.

We are quite reliant on community contributions at present, which can be a challenge with larger features such as this. Ways to help can include signposting relevant implementation details, linking other extensions matching elements of your desired functionality; or of course, opening a pull request (even if only contains small or partial implementation details) - which can greatly increase the chances of this work being picked up, and that we could support on.

Thanks for your interest and engagement in the project - hope you can continue to raise these points, it is very much valued.

68267a commented 1 week ago

I'm new to both Cucumber AND Java, so I'm not sure what I'm asking.

I was messing with the 10-minute tutorial and I noticed that IntelliJ can run and debug each scenario individually. It feels like VS Code should be able to do that as well, but I don't know how to set it up. See screenshot.

Is this the same topic/issue/conversation? Thanks

image-1