behave-vsc
behave-vsc copied to clipboard
Add setting for running Behave from alternate current working directory
Hi! Thanks for your hard work to make this extension work well! I'm trying to use it with a repository where we've stored our tests in a less-than-ideal place:
Repository root
| - autotest
| - product1
| - features
| - product2
| - features
I'm able to use the setting behave-vsc.featuresPath
to get the extension to recognize my tests, which is great.
Unfortunately, when I run the tests from the "tests" left panel, behave runs from the repository root folder. My tests expect to be run from the product1
folder or product2
folder, and they contain relative links to other files which don't work when behave is run from the repository root directory.
To fix this, I can see three solutions:
First, I could fix my project layout. I'll probably do that 😅
Second: The vscode extension could expose a setting to allow me to adjust the current working directory (cwd) so behave runs from the correct folder. I believe that value is currently set here, but it isn't exposed as an extension variable. This seems easy, and is the main reason why I'm making this issue
Third: A more complicated, but probably also good option would be to allow users to define launch configurations in their .vscode/launch.json file. I've seen another extension allow this: in that case, as long as one of the launch configuration have a specific name it gets used instead of the default config. I believe the default debugging config currently lives here.