Mocha reporters don't support parallel mode, does one exist? - mocha.js

We're using Mocha 8.0 and are running it with the parallel feature.
Mochawesome reporter completely crashes in that mode. And the couple of very simple reporters like json or spec, well they don't do enough for us. We are looking for html output with screenshots we can throw in. Does anyone have any potential solutions? Thanks.
I'm wondering if writing a custom fork of Mochawesome or Allure reporter is the only way around this now.

Related

Cypress 10 - How to run all tests in one go?

I used to use Cypress 9 on previous projects.
By default, when running cypress open or cypress open --browser chrome used to run all tests for all React components.
However I installed Cypress 10 for the first time on a project that didn't have e2e tests yet. I added test specs, but I don't see any option to run all tests altogether.
It seems I have to run the tests one by one, clicking on each of them.
Can anyone please suggest how do I run all the tests automatically?
It's been removed in Cypress v10, here are the change notes related
During cypress open, the ability to "Run all specs" and "Run filtered specs" has been removed. Please leave feedback around the removal of this feature here. Your feedback will help us make product decisions around the future of this feature.
The feedback page to register your displeasure is here
You can create a "barrel" spec to run multiple imported specs.
I can't vouch for it working the same as v9 "Run all tests", but can't see any reason why not.
// all.spec.cy.js
import './test1.spec.cy.js' // relative paths
import './test2.spec.cy.js'
...
As #Constance says, reinstated in v11.20.
But still a very handy technique if you want to run a pre-defined subset of your tests.
In Cypress version 11.2.0 the Run All button has been reinstated.
You need to set experimentalRunAllSpecs to true in cypress.config.js.
Please see Configuration - End-to-End Testing
If Cypress Test Runner is not a must, I suggest to utilize the CLI/Node Cmd approach
You can trigger all the test(s) by npx cypress run(Still the video recording & screenshot on failed steps would be saved in the respective folders) to run all or with any other cypress flags to filter out specific spec files, or browser etc.
As per the feedback discussion there is a workaround the same as #Fody's answer that will achieve the same result as v9. Also worth noting though is the section on Continuous Integration and the Update 1 that includes a fix for preventing this workaround creating issues with the cypress run command.
Are there any current workarounds?
Yes. If you are impacted by the omission of this feature, it is possible to achieve the same level of parity as 9.x with a workaround Gleb Bahmutov explains here: https://glebbahmutov.com/blog/run-all-specs-cypress-v10/
This will still inherit the same problems as the previous implementation (which is why it was removed) but it will work in certain cases where the previous implementation was not problematic for your use case
https://github.com/cypress-io/cypress/discussions/21628#discussion-4098510
It was removed because people used it wrong.
The Test Runner is for debugging single tests. But by running all tests, then performance will quickly become a problem and crash the entire suite.
Running all tests should only be performed from the CLI.
Sources
https://github.com/cypress-io/cypress/issues/681
https://github.com/cypress-io/cypress/discussions/21628

JavaScript Mocha test debugging in WebStorm

I've just started using Mocha (+Chai) in WebStorm IDE for my Node.js project.
And I found out that I can't find familiar console pane, where I can type in expressions.
Also I see no easy way to re-run failed unit-test code in plain node.js (without mocha, because I need header with imports and Chai and I need to remove "describe", "it"...), so I can fix the code.
WebStorm is quite popular, Mocha and TDD too, so my question is:
How do you do TDD in WebStorm? How do you solve this problem?
Maybe I'm missing some button in IDE which opens console
Or maybe there is a way to simply run this unit-test separately in Node.js
somehow.
Or maybe you just live with this as it is and just
copy-paste code to some 'test.js' manually?

Debugging cucumber steps in WebStorm

I'm experimenting with Cucumber/WebdriverIO UI tests using Webstorm (NodeJs platform). At certain steps I would really love to stop it in debug mode, check the retrieved element and see what can I do with it.
But unfortunately the Debug button is disabled and I couldn't find anything specific in Webstorm documentation as well.
If I can achieve my original goal (stopping a step and experimenting with the elements) without using Webstorm's Debug mode, that's totally fine for me.
Debugging Cucumber specs is not currently supported, please vote for WEB-15146
I'm not sure how this would work with Cucumber but WebdriverIO now has a debug command you can use

Cucumber reporting and browser hiding

I'm using cucumber (ruby) + watir for running behavior driven tests, and I'm trying to do a couple of things for integrating it with Hudson CI:
Currently, the browser window pops up on the build slave each time the job runs. Is there a way to hide the browser window while the tests run?
I am using the jUnit formatter and having Hudson parse the test results. However, I'd like to print a test summary with the feature/scenario names and the test result (pass/fail) on the console window so that the email notification sent out lists the test summary. How do I do that?
Currently, cucumber prints a lot of debug output including deprecated function warnings. The -q flag doesn't seem to do anything for me. Is there a way I can stop cucumber from printing anything on the screen?
Edit: I'm running the tests on a Windows 7 desktop.

Is it possible to take screenshots inside Chutzpah?

Is it possible to take screenshots inside Chutzpah?
I can't seem to get to the underlying phantom object.
I understand now looking through the chutzpahRunner.js that the test itself is called via page.open() so appears to be in a different scope.
In the end I'm hoping to diff svg elements similar to how PhantomCSS does it with casperjs.
I'm new to phantomjs / chutzpah so maybe I'm missing something obvious.
From the co-ordinator of Chutzpah:
This is not something Chutzpah supports. Chutzpah is focused on
running js tests. I think CasperJS is a better fit to what you are
looking for.
Though it would be a cool feature, it's being discussed in the Chutzpah forum: Screenshots via phantomjs

Resources