PhantomJS ReferenceError: Can't find variable: performance - phantomjs

I am trying to run jasmine test cases using Karma and PhantomJS as the browser.
I get the following error:
ReferenceError: Can't find variable: performance' since I have performance APIs provided by Microsoft dev tools added in my code.
How to get rid of this error? Also, how can I prevent PhantomJS from giving any JavaScript errors when running unit test cases?

Performance timing API is now supported by PhantonJS 2 you can use the karma-phantomjs2-launcher Karma launcher https://www.npmjs.com/package/karma-phantomjs2-launcher.

Related

Tests started failing with new version of testcafe where a http call to load a script has returned 500 Internal server error

I have testcafe tests working fine until version 1.14.0 and with the upgrade of the version to the latest (> 1.14.0), the tests have started to fail and the from console/network calls of the browser, I could see that one of the call to get the js file, has failed with 500 Internal server error and a blank white screen was loaded.
Note that the same works fine with testcafe <= 1.14.0 and the same call has went fine. And there was no other more information from the dev tools for the fail or there was no information in the application's logs as well.
The tests were run on chrome 92 with testcafe cli.

"Error" sign in terminal when a run a test

Why does this sign Error: No tests to run. Either the test files contain no tests or the filter function is too restrictive. always come out, if I already do these tests in the TestCafe Studio and did not give an error?
Also, I follow the Pluralsight course, wrote the same code an make the same steps, but still doesn't work.
The TestCafe window pops out but closes automatically after finishing the loading.
Why should I do, or try?
All fixed, was a version misunderstanding... with TestCafe 0.3.0 work immediately. Run
npm install testcafe-blink-diff#0.3.0 to install that version.
Also, I wasn't paying attention, cause the code I need it was on JavaScript, and I was writing down in TypeScript.
For some reason, my google chrome version was a problem too, so I change
Browser: Chrome 75.0.3770 / Windows 10.0.0 to Chrome 76.0.3809 / Windows 10.0.0

Is there a way to run nightwatch on Safari v12.1?

My mac auto-updated safari to v12.1, but now I can't run my nightwatch tests against safari. I just always get the error: "Request body does not contain required parameter 'capabilities'.". I think it's related to this issue: https://github.com/SeleniumHQ/selenium/issues/6431
Is there anything I can update or do inside of nightwatch to get the tests to run again?
Turns out safari made some huge breaking changes in v12. They removed support for the Selenium JSON wire protocol and now only support w3c WebDriver protocol. There isn't much you can do from a nightwatch config standpoint to fix this. Just try to find the w3c equivalent command for what you are trying to do and use that instead.
Ref: https://developer.apple.com/documentation/webkit/macos_webdriver_commands_for_safari_12_and_later

Protractor "window.angular is undefined" error with PhantomJS

All of my tests run without issue in Chrome or Firefox, but when Protractor is used, I'm getting the following error message:
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/nexttick.js:41
goog.global.setTimeout(function() { throw exception; }, 0);
^
Error while waiting for Protractor to sync with the page: "window.angular is undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See http://git.io/v4gXM for details"
Going to http://git.io/v4gX results in a 404 error.
I'm encountering this same error message whether using
$ webdriver-manager start or
$ phantomjs --webdriver=9515
Using Protractor v3.0.0 and PhantomJS 2.1.1
I've seen similar queries for this issue:
Error while waiting for Protractor to sync with the page: "window.angular is undefined
The stated answer is we're trying to make phantomJS go to a page that isn't Angular, but that is definitely not our situation, as the page is Angular.
"window.angular is undefined." when using protractor for automated testing?
Here the supplied answer is use Protractor 3.0 and specify Jasmine2. Those are our currently supplied settings.
Protractor running tests on PhantomJS
States this issue was fixed in a prior Protractor release, but it appears to be back again.
I'm re-asking this question because the previous answers are now obsolete and irrelevant.

Intern 2.0 test stuck after running client.html page

I have a local selenium server (2.42.2) running with Chromedriver and Firefox. It seems to get stuck after loading and running client.html. I can see that my functional suite code runs in node, far enough to execute the main body. Anything in registerSuite never gets called.
Here are the selenium logs:
http://pastebin.com/KKg5ycvW
I can see the browsers in the selenium sessions page, but they don't appear to be doing anything.
Try opening up a new browser window and paste in the url that you see in the existing selenium ones. Then open up dev tools and see what console errors you are getting.
Intern's runner seems to get stuck in an infinite loop if any uncaught javascript errors are thrown during unit tests if the 'reporter' hasn't been setup yet.
This has been raised as an issue in intern's github repository.