WebStorm run npm script in tool window (Protractor) - protractor

I would like to be able to run an npm script in the Protractor tool window rather than npm. This is easily doable creating a new Protractor Run/Debug config but I need to add a command line argument which the Run config doesnt currently support.
More specifically I am trying to run
protractor --capabilities.chromeOptions.args=--headless --capabilities.chromeOptions.args=--disable-gpu
Would like to do this without modifying the protractor config file.
Essentially, I want to be able to do this without having to provide multiple config files in my project. One for headless, one without.

There is currently no way to specify cmd options in Protractor run configuration, please follow WEB-25165 for updates

Related

VSCode: How to run npm scripts from the command pallete?

I just recently discovered the npm scripts section in VSCode. Now I'm wondering, is there also a way to run npm scripts from the command pallete?
I wasn't able to find any documentation on this, besides defining and launching build and test tasks. In a few results from Google, people were able to run npm scripts by typing > npm: taskname, but for some reason this won't work for me. I suspect this changed when VSCode natively implemented the script runner.

VSCode - Automatically pick debugger

I have an Ansible workspace where I'm writing YML, PowerShell, and Python. Because of how things are set up where I work, I can't directly debug the YML files, so I need a custom launch configuration to run the files the way they are needed.
I'd love to just assign this to only YML extensions and leave the default debugger for Python and PowerShell files, as I switch between them quite often.
My current setup has a debug.ps1 file that will automatically switch between what it should launch based on the file that was debugged, but the Python files launch without the help of the Python debugger. I'd love for some way to either make that script launch the Python debugger, or make some sort of pre-debug task that tells VSCode what debugger to use.
Is there any way to do this?
Thanks!

How to execute a npm/yarn script when testing a VSCode extension?

I'm writing a VSCode extension which I bundle with esbuild, as suggested in VSCode docs. Following the docs, I added new script entries in my package.json, including:
"esbuild": "yarn run esbuild-base -- --sourcemap"
Now I must run yarn run esbuild, then hit f5 each time I want to test my extension. This is a source of confusion, because if I forget the first part, I'm going to test my old code.
To avoid this I wonder if it's possible to automatically run yarn run esbuild when I press f5.
Create a task to perform the yarn call
add this task as a preLaunchTask to your debug launch config
Or maybe you can setup an npm-watch script

Is this possible to configure WebStorm to start webdriver-manager to execute Protractor script?

I am using WebStorm IDE to work with Protractor. So far, I am starting webdriver-manager from command prompt and executing the script in WebStorm.
Is there a way to start and keep running webdriver-manager from WebStorm itself? If Yes, Please let me know the steps.
You can configure it as External tool in Settings | Tools | External Tools and then use menu action/assigned shortcut to start it:
If you don't like to start server manually, you can set up your protractor configuration accordingly:
If you have a standalone server installed, you can start it automatically by specifying seleniumServerJar in protractor.conf.js - see http://www.protractortest.org/#/server-setup#standalone-selenium-server, Starting the Server from a Test Script
Another option is using directConnect - see http://www.protractortest.org/#/server-setup#connecting-directly-to-browser-drivers

why karma is not in the path after installing?

I would like to try using karma to run some javascript unit tests. However, after installing using npm install -g karma
I typed karma, the system prompt that karma cannot be found. Do I need to add karma to the path?
Yes. I'm guessing you're on Windows, which doesn't automatically put the folder containing your globally installed node_modules on your $PATH. You'll have to go into Windows' Advanced System settings and edit your path manually.