Debugging individual protractor files with WebStorm - testing

I want to be able to right click on an individual protractor test, click debug or run and have it execute. I can do this from the command line but I want to be able to debug with WebStorm to leverage the debugger.
By default when right clicking and debugging a file webstorm runs:
runnerw.exe "C:\Program Files\nodejs\node.exe"
--debug-brk=57698 --nolazy myspec.js
Can I have it run the following substituting the filename which I've selected:
node node_modules\protractor\bin\protractor protractor.dev.conf.js
--specs "/specs/myspec.js"
As a crappy work around I have the following:
This runs a single file but I need to edit the configuration each time to change the spec i'm testing.
protractor.dev.conf.js --specs "myproject/specs/test0043.js"
Does WebStorm allow you to dynamically substitute the test file?
Thanks

Can I do have it run the following substituting the file I've selected:
node node_modules\protractor\bin\protractor protractor.dev.conf.js
--specs "/specs/myspec.js"
and can you run the same not using WebStorm (in command line)? If you can, it's not a problem to do the same in webstorm

try ddescribe and iit
iit('should ...')
Will run only those tests marked with iit.
ddescribe will only run the tests under that suite(s)
Try the ddescriber plugin http://plugins.jetbrains.com/plugin/7233?pr=phpStorm

Related

Can't navigate to Karma test file from Tests Run tab in IntelliJ Ultimate

I have an Angular project with Karma/Jasmine tests files. I configured my IntelliJ IDEA (2022.2.4 (Ultimate Edition)) to run Karma tests, which works mostly fine.
One thing that doesn't work is opening the Tests Run tab and navigating to the source for a test by clicking on the test name.
For example on the screenshot below, I expect that clicking on the test marked in red would open the corresponding project-menu-component.spec.ts file to the corresponding it(), but nothing actually happens when I click:
I have the following settings:
Jump to source doesn't work for specs with dynamically generated names. Related ticket: WEB-26625, please vote for it to get notified on updates

Getting 'Could not find test files' Error when attempting to run TestCafe tests

I'm trying to run some TestCafe tests from our build server, but getting the following error...
"Could not find test files at the following location: "C:\Testing\TestCafe".
Check patterns for errors:
tests/my-test.ts
or launch TestCafe from a different directory."
I did have them running or able to be found on this machine previously, but others have taken over the test coding and changed the structure a bit when moving it to a Git repository. Now when I grab the tests from Git and try to run, the problem presents itself. I'm not sure if there is something in a config file that needs adjustment but don't know where to start looking.
The intention is to have it part of our CI process, but the problem is also seen when I attempt to run the tests from the command line. The build process does install TestCafe, but there is something strange around this as well.
When the build failes with the can't find tests error, if I try to run the following command in the proper location...
tescafe chrome tests/my-test.ts
... I get, 'testcafe' is not recognized as an internal or external command,
operable program or batch file.
Just can't understand why I can't get these tests running. TestCafe setup was pretty much easy previously.
ADDENDUM: I've added a screenshot of the working directory where I cd to and run the testcafe command as well as the tests subdirectory containing the test I'm trying to run.
Any help is appreciated!!
testcafe chrome tests/my-test.ts is just a template; it isn't a real path to your tests. This error means that the path that you set in CLI is wrong, and there aren't any tests. You need to:
Find out where you start CLI. Please attach a screenshot to your question.
Define an absolute path to tests or a path relative to the place where CLI was started. Please share a screenshot of your project tree where the directory with tests is open.
Also, you missed t in the tescafe chrome tests/my-test.ts command. It should be tesTcafe chrome tests/my-test.ts. That is why you get the "'tescafe' is not recognized as an internal or external command" error.
I was able to get things working by starting from scratch. I uninstalled TestCafe and cleaned the working folder. During next build it was fine. I'm sure I've tried this several times, but it just started working.
One positive that came out of it was that I discovered a typo in a test file name, which was also causing issues finding the test I was using to check testing setup.
Thanks for helping!!

Cucumber-java test steps execute twice in IntelliJ

Normally I run Cucumber-Jvm tests using Run/Debug configuration. Once I tried to run one tests using Run window by selecting the scenario (right click and run)
From that point on wards I see each time when I run test using Edit Configuration I see steps run twice.
I am using IntelliJ Community version
Anyone had this issue before could be any settings change.
Right click on the Play button on your .feature file and select the last choice 'Create Scenario ...'. On the Program arguments box you should have CucumberJvm5SMFormatter only ONCE. I had:
--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name "^My Scenario$"
Simply, I deleted the second line:
--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name "^My Scenario$"
and it ran perfectly!
Also depends on number of examples you have provided in cucumber
You have probably another test with the same name

SpecRun.exe: run .feature or .playlist file from command line

Good day. I have a several .feature files:
1.feature
2.feature
1.playlist
2.playlist
etc.
I can run they separatelly in visual studio:
-any feature file in debug mode
-any playlist with Test Explorer.
But if i need to run one of they from command line, what i should do?
If i use SpecRun.exe run
SpecRun.exe run %profile%.srprofile "/baseFolder:%~dp0\bin\Debug" /log:specrun.log
this performs launch of ALL scenarios in ALL .feature files.
Have a look at the command line switches of the SpecRun.exe here http://specflow.org/plus/documentation/SpecFlowPlus-Runner-Command-Line/
You are looking for /filter to filter your execution to a single scenario.
The format of it is documented here: http://specflow.org/plus/documentation/SpecFlowPlus-Runner-Profiles/#Filter

Is it possible to launch more than one Webstorm instance using the command-line launcher?

Webstorm can be launched from the command line using the command wstorm. However, would it be possible to launch more than one instance? Usually, the second time I run wstorm, it doesn't open another Webstorm for me and does nothing.
In OS X, this is apparently caused by an outdated wstorm (a Python script at /usr/local/bin/wstorm). I verified the solution indicated in this ticket with WebStorm 2016.1.3:
Go to Tools > Create Command-line Launcher....
UPDATE Nov-2016: As of WebStorm 2016.3, the default name of the launcher changed from wstorm to webstorm. If you prefer wstorm instead, make sure to edit the script name before clicking OK:
Just run:
WebStorm.exe "Full\path\to\the\project\that\contains\the\.idea\folder\of\your\project"
The project will run in the same instance but in a separted window as described here: https://www.jetbrains.com/webstorm/help/opening-multiple-projects.html
NOTE: This was tested on WebStorm 9.0.3 and may not work on previous versions.