How to fix ' Disconnected, because no message in 10000 ms.' error while trying to run karma unit test? - protractor

I am getting 'Disconnected, because no message in 10000 ms' error while trying to run karma unit tests. This error triggered only after the installation of webdriver-manager ( to run protractor) and ran unit tests successfully before this installation.
I assumed that the error might be hitting since webdriver is up and running. So,I passed command 'webdriver-manager shoutdown' to stop it. but,it showed that no server is up and running.
My requirement is to run both protractor functional test and karma unit tests in same machine without any error.

Found the solution for this issue by myself.
Solution: Install angular cli using the command 'npm install -g #angular/cli'.
I am able to execute both karma unit tests and protractor functional tests in my system without any issue after installing angular cli.

Related

Cypress / Visual Studio Code / Cypress failed to start

I am junior QA Tester, started working with Cypress and IDE Visual Studio, after updating Cypress 5.2.0, I got a strange error like the following:
It looks like this is your first time using Cypress: 5.2.0
✖ Verifying Cypress can run /Users/viktoriiahanke/Library/Caches/Cypress/5.2.0/Cypress.app
→ Cypress Version: 5.2.0
Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Command was killed with SIGKILL (Forced termination): /Users/viktoriiahanke/Library/Caches/Cypress/5.2.0/Cypress.app/Contents/MacOS/Cypress --no-sandbox --smoke-test --ping=563
----------
Platform: darwin (19.6.0)
Cypress Version: 5.2.0
I have already tried to delete Cypress and install it with npm from the beginning, but Cypress itself is working, when I download it manually , but when I try to start it in console or in Visual Studio Console it is not opening, writing me that I miss dependencies like above.
Did anyone have such problem before?
Run this command in the terminal export NODE_TLS_REJECT_UNAUTHORIZED=0
and then try installing again.
I think it had been updated from a previous version, 3.1.3. Go into cache and delete all versions of cypress then re-install.
Maybe that there are missing some vital folders/files like integration, cypress.json... Try to run the 'npm install' command in the terminal for installing the dependencies.
Also, maybe if you start from an existing project, it will be fine (run npm install command also).

How can I solve error in teamcity (Nunit)?

Recently our NUnit build configuration has occasionally stopped halfway through the tests, but the overall build outcome is successful . When I look at the build log, the last test that actually got executed shows:
Process exited with code -100 (Step: tests (NUnit))
and then the build stops. Under "Failure Conditions". Our NUnit Consol is 3.10.0 .
Below is our NUnit configuration image.
I've found this comment in the TeamCity YouTrack. Seems, dotnet projects aren't supported in NUnit build step.
Try to use .NET CLI build step with "dotnet test" command to run tests in this project. Does it work?

How to debug envoy unit tests on VScode mac

I am working with envoy (https://github.com/envoyproxy/envoy). I got this project to build and debug on mac in VSCode using --spawn_strategy=standalone --genrule_strategy=standalone flags when I do bazel build.
However, when I try the same with bazel test, I can't get it to run without sandbox. When I run the command:
bazel test //:test_name --spawn_strategy=standalone --genrule_strategy=standalone
It runs the whole test and shows which tests passed and which ones failed.
But when I run the binary from /bazel-bin/ as ./test_name, it gives me an error saying: Caught Abort trap: 6, suspect faulting address. I am assuming this is because of some missing env variables created in sandbox - I have also tried just using --strategy=TestRunner=standalone. Is it possible to run it standalone? so that I can debug in an IDE such as VScode. Thank you!

Continuous Integration: Codeship + Gulp (Jasmine)

My Continuous Integration works pretty great using Codeship except one thing: stop deploying and alert us when unit tests are failing.
Here is our current commands:
npm install
npm install bower
bower install
gulp test
gulp build
The problem is whether gulp test end with success or fail, the gulp build builds.
I succeed to console.log() my gulp test exit status but I have no idea about how to make Codeship listen to this exit status.
The build on Codeship will fail as soon as any command exits with an exit code other than zero.
Please make sure this is the case with running gulp test.
(You can also reach out to us via support#codeship.com if any other questions come up!)
Using #mlocker answer and this discussion on Github, I've found a workaround that works fine for me:
gulp.task('test', function (done) {
karma.start({}, function(exitStatus){
done(exitStatus ? "There are failing unit tests" : undefined);
});
});
The trick here is that if the exitStatus is different from 0, you'll get a formatError on "There are failing unit tests" which will exit gulp test with 1 making Codeship to stop and consider the build as failed.
maybe you can try chaining the test and build tasks?
gulp test && gulp build

Protractor / Chrome - UnknownError: The process has not exited yet therefore no result is available

Trying to run a Protractor test but am receiving the following command line error when trying to test in Chrome.
UnknownError: The process has not exited yet therefore no result is available ...
The test successfully runs in Firefox, i.e. when the protractor.conf.js file is set as such:
capabilities: {
'browserName': 'firefox'
}
I'm currently using ChromeDriver 2.10, which seems to have something to do with the issue (https://github.com/angular/protractor/issues/1424). However, I'm unclear how to configure Protractor to use a different version of ChromeDriver.
So, reverting to ChromeDriver 2.9 was as easy as downloading it from here (http://chromedriver.storage.googleapis.com/index.html?path=2.9/) and extracting the zip into /usr/local/lib/node_modules/protractor/selenium.
That fixed the immediate issue of not being able to run the test in Chrome. Still waiting on a fix for 2.10, I suppose.