wdio-vscode-service icon indicating copy to clipboard operation
wdio-vscode-service copied to clipboard

Question: Is it possible to dynamically change the workspacePath?

Open kgartland-rstudio opened this issue 7 months ago • 1 comments

I have a project that requires a different workspacePath for each spec. I know I can set an environment variable for the path outside the configuration and pass it in, however then I'd have to define which spec to run and which path and then loop through all my specs. I'd rather use the webdriver logic to control that aspect.

I was hoping for a way to do something like this inside the wdio.conf.ts file:

switch (spec) {
 case 'first_spec':
    workspacePath = "/my/path/to/first_content/"
    break;
case 'second_spec':
   workspacePath = "/my/path/to/second_content/"
   break;
...

Any ideas how I could do that? It doesn't look like I have access to update the wdio:vscodeOptions anywhere.

kgartland-rstudio avatar Jul 11 '24 14:07 kgartland-rstudio