This is my first time using Angular (and Karma), so please excuse me if this is a total beginner's question: that's what I am.
I'm trying to run the Angular-phonecat tests, as described in Step 02 - Writing and Running Tests
My code is checked out directly from the step 2 branch (git checkout -f step-2)
When running the test (angular-phonecat\scripts> test), I'm given the following message:
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599 (Windows 7)]: Connected on socket Jw-2z-zZ-pytGNN-SHRM
Chrome 30.0.1599 (Windows 7): Executed 0 of 0 ERROR (0.472 secs / 0 secs)
There is no more information given, and I cannot find any log the would detail the problem (nothing in /test or its sub-directories, nor in /logs). I also cannot find a log for karma in general - is there one?
You need to add this line to karma.conf.js
exclude: ['app/lib/angular/angular-scenario.js'],
Theres an issue relating to this problem here: https://github.com/angular/angular-phonecat/issues/71
Hi i started today with angular and karma aswell, im on a mac and i have the same problem.
I joined the IRC channel #angularjs at freenode and asked for some help and this is the answer that i got.
[16:59] <Wirde> Hi, I just started with the Angular-phonecat tutorial, after installing karma and the adapters I got too step 2 but when I try to run the unit tests it gives me the error: Executed 0 of 0 ERROR (0.327 secs / 0 secs). Can some please tell me whats wrong?
[17:00] <dmco> Wirde: I think phonecat is wonky after some 1.2rcX upgrades
[17:01] <dmco> Wirde: Another guy was complaining about issues with it yesterday
[17:02] <Wirde> dmco: hi, thanks for the answer, how do you suggest i proceed? Is there another good way to learn about karma and testing with angular?
[17:02] <rdepena> http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html#karma
[17:02] <dmco> Wirde: One easy way would be to scaffold a new project using Yeoman and the AngularJS generator
[17:02] <rdepena> this is a great source
[17:02] <dmco> ^^ Wirde that is a good link too
[17:03] <Wirde> dmco: rdepena: Thank you for the help! I will check it out :D
Not sure if this is the response that you wanted or if its enought but i tought i might share it.
Related
After some time I needed to do changes on GAE Python (2.7) First Generation app, but when I develop and run locally, it's basically nonusable due to a very slow start.
These are printed logs:
INFO 2019-10-18 07:56:35,533 devappserver2.py:278] Skipping SDK update check.
INFO 2019-10-18 07:56:35,595 api_server.py:275] Starting API server at: http://localhost:36159
INFO 2019-10-18 07:56:35,599 dispatcher.py:270] Starting module "default" running at: http://127.0.0.1:8080
INFO 2019-10-18 07:56:35,600 admin_server.py:152] Starting admin server at: http://localhost:8000
INFO 2019-10-18 08:01:01,644 instance.py:294] Instance PID: 28496
What I notice that the last line (instance.py) is printed after ~5 minutes and only after that app responds to requests, not before. Interesting that the admin server (localhost:8000) is available right away. Of course, when I do some code change it automatically reloads and it repeats again.
Things I tried/found out:
it behaves like that on my all GAE projects Python First Gen.
tried to create a bare minimal version (webapp2 with one URL), clean virtualenv, still the same behavior
tried to reinstall Google Cloud SDK. delete the whole google-cloud-sdk folder and install again, no changes
tried to install older version of Cloud SDK
used clean VM and it works ok!!!, so it looks like there could be something wrong with my system (outside of SDK), but I'm not sure what.
It's interesting that the pause between the last two log lines is always about 5 minutes, not sure why exactly that time.
Python 2.7.14
OS: OpenSuse Leap 15.0
I'm running out of ideas so any advice would be appreciated.
I solved this accidentally.
I wanted to run Jupyter notebook, but I got the error:
error: [Errno 99] Cannot assign requested address
after debugging in /tornado/netutil.py, I noticed that it tries to work with IP 192.168.1.50 which I wasn't sure where did that come from, (probably I set it since I was playing with my home network some time ago), but when I deleted it from /etc/hosts, Jupyter, as well as GAE, works ok.
What a coincidence :)
I am facing issue while running grunt, it throwing me following issue:
ERROR [launcher]: PhantomJS2 failed 2 times (timeout). Giving up.
DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers
Warning: Task "karma:continuous" failed. Use --force to continue.
I tried to run npm install phantomjs
Which is successful. After that i run npm install as well but again getting above issue
This is because you will need to run the PhantomJS standalone version for karma to connect to it.
I would suggest a better option according to my opinion, which is to use karma-phantomjs2-launcher. You can get that by: npm install --save-dev karma-phantomjs2-launcher.
Please note that it is not a stable version. If it suits your requirement, you can use karma-phantomjs-launcher, which works perfectly fine. But it does not have support for PhantomJS 2.
I got solution for this, if we get this error so first need to check karm.conf.js file, there you have to search for key browsers and in that section you have to see whether PhantomJS2 is defined or not.It would be something like this:
browsers : [
'PhantomJS2'
],
In my case it was there but still i was getting error, i then checked my hosts file which you can find in C:\Windows\System32\drivers\etc if you are using windows machine and i placed
127.0.0.1 localhost and there i go.... its worked for me.
I have basic Galen testing set up on a responsive Angular site, running through a simple test on desktop and tablet versions of the site.
I did not build this site and cannot say if Galen ever fully worked properly on the website. I did myself upgrade Galen from v1.6.3 to v2.2.1 in NPM, which included updating syntax etc in the .test file and two .gspec files.
Almost everything appears to be working fine by the Gulp command I am running in Mac terminal:
GALEN_URL=http://localhost:3000/MYSITE/ gulp test:galen-local
This runs the test locally (vs SauceLabs). Via terminal, I see the two tests run, with test criteria printed out, and I get a note that there is a failure on tablet version (it's an easy CSS-related fix for tablet version, and I'm not worried about that). Also, I am getting the HTML reports for those two tests, written to a local directory.
My problem is the following error message I get after the tests run:
========================================
Failed tests:
Login page on tablet device
Suite status: FAIL
Total tests: 2
Total failed tests: 1
Total failures: 3
There were failures in galen tests
[13:51:04] 'test:galen-local' errored after 11 s
[13:51:04] Error in plugin 'gulp-shell'
Message:
Command `./node_modules/.bin/galen test tests/galen/tests/local.test --htmlreport galen-reports -DwebsiteUrl=http://localhost:3000/MYSITE/ -DsauceUser=USERNAME -DsauceKey=SAUCEKEY` failed with exit code 1
What is failed with exit code 1? I have searched Galen docs, searched the web, and I can't figure out what might be going wrong. I have no idea what that means.
I can provide more code if needed, but the website is relatively sophisticated and things are abstracted out across many files.
thanks for any assistance
I think I might have answered my own question just now...
When I removed the test criteria that were failing for tablet version, I got the following in terminal with no "command" error message:
========================================
Suite status: PASS
Total tests: 2
Total failed tests: 0
Total failures: 0
[14:24:16] Finished 'test:galen-local' after 11 s
I presume the command error message was just a reflection that tests in the overall suite were failing. Still, it seems odd to me that such an error message would appear after a Total failed tests: 1 Total failures: 3 message already made clear that certain tests in the tablet version were failing. And I still don't know what specifically the "error code 1" above means.
If anyone has any insight, feel free to chime in. Otherwise, I'll mark this as THE answer at some point, if I don't just delete the entire question.
Hi I'm trying to get the test script running on the angular tutorial (step 2, writing and running test part 1) but I'm stuck at trying to run the karma server but when I run the command in the GitBash terminal I get this error
John#JOHN-PC ~/angular-phonecat ((step-2))
$ ./scripts/test.sh
Starting Karma Server (http://karma-runner.github.io)
-------------------------------------------------------------------
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
ERROR [launcher]: Cannot start Chrome
Can not find the binary C:\Users\John\AppData\Local\Google\Chrome\Applic
ation\chrome.exe
Please set env variable CHROME_BIN
any idea what this means
here's the link to the tutorial http://docs.angularjs.org/tutorial/step_02
As Cristian Ternus had already pointed out you will have to set the correct value of the CHROME_BIN env variable. Dont copy the path as it is provided in the comment. You will have to find out where crome.exe is present on your machine. Please refer http://bardevblog.wordpress.com/2013/07/28/setting-up-angularjs-angular-seed-node-js-and-karma/ which is a nice tutorial about running angular test cases. Step 8 in the tutorial is addressing your issue.
Do you have Google Chrome installed? If not, install it.
If it's installed, is it in that path (C:\Users\John\AppData\Local\Google\Chrome\Applic
ation\chrome.exe)?
If not, set the environment variable CHROME_BIN to the path of chrome.exe.
I know that there is documentation on the ghostdriver wiki on how to attach it to a selenium grid. For those that don't know you can find it here
I've compiled the special phantomjs twice, tried to attach it to selenium servers local, and remote using both Selenium versions 2.24 and 2.25 to no avail. It starts up Ghostdriver locally just like you expect, but there's certainly no registering going on.
I tried both ip/localhost:4444 and ip/localhost:4444/grid/register with no results. I also thought perhaps it just didn't show up on the grid console and tried to run tests against it anyway, which failed stating there was nothing populating the grid.
I've tried this on both CentOS 6 and Ubuntu 12.04 with no luck.
I'm out of ideas. Has anyone else had problems like this?
I had exactly the same problem and fixed it with using the lastest version of selenium-grid.
The good website: https://code.google.com/p/selenium/wiki/Grid2 (this is no longer http://selenium-grid.seleniumhq.org/).
Here the steps (version 2.31.0):
Download the selenium-server:
wget https://selenium.googlecode.com/files/selenium-server-standalone-2.31.0.jar
Launch selenium grid server:
java -jar selenium-server-standalone-2.31.0.jar -role hub
In a new terminal, launch GhostDriver:
phantomjs --webdriver=5555 --webdriver-selenium-grid-hub=http://localhost:4444
Check out available remote control on http://localhost:4444/grid/console.
You should see something like that:
listening on http://127.0.0.1:5555
test session time out after 300 sec.
Supports up to 1 concurrent tests from:
phantomjs
I was testing this commands on CentOS 6.3, I hope it works for you!