WebStorm, setting JavaScript Debug with another task running before - webstorm

In WebStorm I can very easy setup JavaScript Debug and then when I run this configuration, IDE opens the Chrome browser and all breakpoints are active. The problem begins when I need to run specific tasks prior to starting debugging, for example running npm build script. When I define it in Before launch (see the picture below), the Chrome browser not being opened when I activate this debug configuration but being opened after I stop it.
This requires from me, manually run a project from command line and then run Browser Debug
Can I define the additional tasks in a way that Chrome will be opened as usually?
Thank you.

A process added to Before launch section has to return an exit code, the main process is waiting for it to start and thus doesn't start until the first process terminates. This is the way Before launch is designed - it's supposed to be used to run some sort of pre-processing before running the main process. You can add a build task (a script that builds your app and then exits) to this section; but start:dev likely doesn't exit, it starts the server your application is hosted on, and it has to be running to make your application work, doesn't it? Please remove your npm script from Before launch, start it separately or use the Compound configuration to start both npm script and Javascript Debug run configuration concurrently

Related

Django test api while api is running in dev environment [duplicate]

I have looked at this question but I am not sure I got it correctly or not.
I have opened pycharm and one python script and its running (it's topic modeling).
Also I have another python script in which I opened in another pycharm in the same server. I also run it.
Now these two program are running in the same server, I should mention that I have not changed any configuration neither server nor pycharm.
Do you think its ok in this way? or one script technically won't run(in terms of progressing I mean it just show its running but practically wont run) until the other script finished?
Edit Configurations -> Allow parallel run. Done
First, PyCharm will create independent processes on the server, so both scripts will run. You can check it with something like htop - search for processes and verify that they're running.
Second, you don't have to open second PyCharm window to run the second script. You can run both of them from the single one. There are at least two ways: with run configurations or by spawning multiple terminal windows and running scripts from there.
From the Run/Debug Configurations windows you can add a Compound configuration that contains multiple configurations that will run in parallel. The Allow parallel run option for child configurations make no difference in this case.
The default behaviour was changed starting from version 2018.3. You can allow multiple runs by selecting Allow parallel run within the Edit Configurations menu.

Execute nodejs Script as child process (not from other script)

I am trying to find a way of running my Nodejs app in the background. I did a lot of research and I am aware of them (node-windows, forever, nssm, ...).
During this what came to my mind was to create my OWN service wrapper in c++ which executes the script (windows) as a child process.
Therefore my question: Is it possible? and what are the possibilities to communicate with the node.exe executing my script? In Google in find tons of articles about the node "childprocess" module but nothing where the node.exe is the childprocess.
BTW: In one of the answers here on SO I found a solution with the sc.exe, but when I am installing the node.exe with the script it gets terminated because it does not respond to the SCM commands. Did this ever work?
Thank you alot in advance
You can make the process run in background using pm2
pm2 start app.js --watch
This will start the process and will also look for changes in the file. More about watch flag

Selenium PhantomJS is it the same as running IE

I need to run my Selenium Python test script for IE.
If i ran it using a headless browser PhantomJS, is it going to be different than running it for IE?
I am asking because I am having a problem running my Selenium Python test script from a batch file from task scheduler.
I can run my batch file on it's own and that runs ok. But when i run it from Task Scheduler the browser does not open so the test fails.
The dev says Task Scheduler runs in the background with a headless browser.
If i used PhantomJS it won't be the same as IE?
I need to test it using IE but the batch file which runs my Selenium test won't open the browser from task scheduler.
My batch file is as follows:
set TEST_HOME=%~dp0
cd %~dp0
SET PATH=%PATH%;G:\test_runners\selenium_regression_test_5_1_1\IEDriverServer\64bit
cd %~dp0selenium_regression_test_5_1_1
set PYTHONPATH=%~dp0selenium_regression_test_5_1_1
c:\Python27\Scripts\nosetests.exe "%~dp0selenium_regression_test_5_1_1\Regression_TestCase\split_into_parts\RegressionProject_TestCase_Part1.py" --with-html --html-file="%~dp0selenium_regression_test_5_1_1\TestReport\SeleniumTestReport_part1.html"
I appreciate some help on this.
Thanks, Riaz
That's the same as asking, is the ouput the same in IE and in Firefox? Not exactly, visually it will look the same but in the source code some elements are adapted to the browser you're using.
Phantomjs is a browser on it's own, so, some elements can be hidden or not even loaded but it's rare. A good example of this is Twitter. I noticed during some tests that the click on the twit box to write some text behaves differently in phantomjs than in other browsers!
The reason why task scheduler doesn't let you use IE is because you can't use any graphical environments during the lifetime of the proccess.

WebStorm run command or program on project open

Is there any way to run external program or command after I open project in WebStorm?
I've created new external tool which runs database server, and after I click on it in menu, it runs the server and everything works, but I'd like to start this tool automatically on project start. And it'd be awesome if it could also open web browser to certain url which would be database admin tool.
If you can launch your desired task using Grunt/Gulp/npm task or any other Run/Debug Configuration then yes -- there is Startup Tasks functionality available at Settings/Preferences | Tools | Startup Tasks.
Note that you cannot execute External Tools entry directly or launch any DOS/shell command this way.
The easiest way of using this would be creating Grunt/Gulp task that would do your actual job. There you can use exec() method to execute custom command.

Buildbot : how to manually launch a build?

We are using BuildBot (http://buildbot.net/) to build our C++ project.
Is there any way to run the exact build commands from the command line that are executed when you hit the "force build" button on the web UI? I'm trying to debug a build problem that is present on our build server but not on our local machines, and don't want to spam the email list each time it fails.
Thank you,
Sean
To run a command COMMAND [ARG]... in a clean environment use env --ignore-environement COMMAND [ARG]....
I assume buildbot sends an http request to the buildbot server asking it to build when you hit the force build button. So if you work out what it's senfing you can send the same thing using wget or python or whatever?
That may or may not do what you're trying to do? I guess there's a difference between running buildbot builds from the cmd line and duplicating a buildbot build without using buildbot.