I'm trying to build a test framework using mocha + webdriver.io.
I've chosen wdio test runner and all tests are running good via CLI but I want to configure WebStorm IDE to run single test in debug mode and can't understand how to do it.
As I understood there is no WebStorm support for this directly and I need to configure default Node.js run with valid parameters in order to trigger wdio runner with my test case.
Check https://alippai.github.io/ for a brief guide. It's running the tests with the mocha executable instead of the default wdio.
The next config is working for me (wdio+jasmine)
Related
I have unit tests set up with Karma and Mocha. Karma is important here because some of the functionality I'm testing needs a web browser (even if a fake headless one). But much of the code can run either in a browser or Node.js. For debugging tests it would be much easier to skip launching Karma and use Mocha directly most of the time.
I can do that easily enough if running the whole test suite, but I'd like to be able to use the convenience of the little green play-button style arrows for individual tests. Unfortunately, even for a single unit test, these always launch Karma now.
Disabling the Karma plugin doesn't help. Instead, that makes all of the green arrows go away, with no easy access to either Karma or Mocha.
Is there a way to configure IDEA so that these convenience arrows ignore Karma, and directly run Mocha tests instead?
The logic used for determining what test runner is available for a given test file is based on dependencies declarations in package.json nearest to the current file.
Note that if you have a single package.json, with both karma and mocha included, and there is a karma config in your project, karma is preferred - see https://youtrack.jetbrains.com/issue/WEB-26070#comment=27-2088951. To force using Mocha test runner for files in a certain directory, create a Mocha run configuration with Test directory: set to this directory - when running tests from gutter in this folder, mocha will be used.
I need to create UI automation tests with a protractor, I have successfully setuped everything from http://www.protractortest.org/#/ and can successfully run the test from the command line, but for debugging and for more comfort of coding I want to use VS2019 for both editing and run/debugging.
Everything that I found is pointing to VS code and couldn't find anything for Visual Studio.
You can use the NPM Task runner plugin for that.
But before you need to add protractor conf.js script in the package.json file.
I'm creating e2e test using WebdriverIO.
As I understand test-runner calling sequence is smth like
NPM (package.json) -> WDIO (wdio.conf.js) -> Mocha (via "wdio-mocha-framework")
As far as i know, Wdio is designed for using built-in test-runner. But is there way for call wdio from mocha? This is needed for debug in IDE and run test separately.
You can use 'standalone' mode to require the test runner via Mocha.
There are a bunch of examples of standalone mode on their github page.
We run a CI environment with Jenkins and the Project using ExtJS 5.1.1.
I try using Chutzpah test runner, using mocha framework JavaScript unit test.
With JavaScript test without ExtJS 5.1.1 testing run successfully.
But JavaScript with reference ext-all.js, there are no success. We have time out error in Blanket.js (error blanket_mocha.js line 5141) testing are not succeed and coverage.xml won't generate.
I'm looking for other way how run JavaScript test (ExtJS) in Jenkins with mocha framework and have code coverage report generate.
We already have Grunt run in Jenkins to do JavaScript combine and minify.
Is this possible to using Grunt to run mocha test and generate coverage.xml in Jenkins?
Please help me out if there is some other way to achieve the same thing. Any suggestion are highly appreciated.
Is there a way to get JavaScript tests to do continuous integration with MSBuild or in Visual Studio? What I want to do is have it so anytime my JavaScript or my JavaScript tests change they are built again and ran and if they fall below certain values of acceptance criteria (code coverage, assertions passing, test's passing, etc.) it'll fail my build. Anyone know how to do this?
Thanks!
It looks like Chutzpah has a command-line runner, so you can create a PowerShell script which gets called from your build server to run the tests. See the Chutzpah documentation for more information. I'm not sure how you would integrate the test results with TFS.
I've used a Command Line build step to run my javascript tests with chutzpah.
Add this and point to something like
$(Build.SourcesDirectory)\packages\Chutzpah.4.0.3\tools\chutzpah.console.exe
or whereever you have chutzpah setup to be run on build server. You can then add an argument to tell the chutzpah console where the tests are
$(Build.SourcesDirectory)\YourApp.UnitTests\Tests**strong text**