I am trying to follow the AngularJS Fundementals series on PluralSight. The instructor has downloaded and opened up Angular Seed, and runs the e2e-test.sh file with no problems.
I use the regular Windows Command window, and so I attempt to follow his lead but with e2e-test.bat.
But it isn't working for me, here is what I get:
Have you installed Karma? http://karma-runner.github.io/0.10/index.html
npm install -g karma
If this installs ok you should be able to check the version from the command line:
karma --version
I'm taking the same course and I ran into the same issue.
You need to use the Node.js command prompt instead of the Windows Command Prompt.
If you have Windows 8, go to the Start page (hit the Windows key), then type "Node".
The Node.js command prompt will be one of the results.
Then from there you can install karma, karma junit reporter, etc. and run the test scripts.
Related
Recenlty I have started with some Jenkins tutorials to learn about this tool.
As an excersise I would like to start my Angular project and run some protractor e2e tests on it.
Normally I would open terminal window, type : npm install, npm start and run protractor tests. I have one issue though to execute this on Jenkins.
Command 'npm start' will run my angular application on localhost:4200. That require some time and after that this terminal window is "frozen" there is information that my application is running on localhost but if I want to run tests I need to open another terminal window and type command there.
I don't know how to do this in Jenkins because when I run my project and observe logs, I can see that my project is running and everything is OK, but I cannot type any command to run test because this terminal window is busy with info:
webpack: compiled successfully.
Can I somehow open another terminal window during Jenkins build and run command there?
Use & at the end of the command that will run it in background and didn't freeze the terminal.
But As per me I don't think if you are running cmd through Jenkins will froze the terminal.
Each build step is a separate process that Jenkins spawns off. They don't share anything, neither current directory, nor environment variables set/changed within the build step in-spite you hard coded the location. Each new build step starts by spawning a new process off the parent process (the one running Jenkins)
Please share some screenshot if & didn't work for you.
Stackoverflow helped me a lot to reach that point but now I'm completely stuck, here is my problem :
I'm currently developing several tests to check a website. I code with Java in Eclipse, using testNG plugin with ReportNG for report, all of this using Windows 7 pro.
My tests work, and my report is well generated, so now I have to put it on Jenkins for my company so they will run my tests every X hours.
In order to launch my tests, I have made a file, named Run.bat, which runs the Java code, I tested it and it works, here is the code :
Run.bat
set classpath=blex_test_v1\bin;blex_test_v1\lib\*
java org.testng.TestNG blex_test_v1\blex_test_v1.xml
I now try to launch the tests on Jenkins, creating a new job and configuring it with the build section :
Run.bat
And this is my problem, I've tried everything (relative path, only the name of the file etc...) I always get this error :
java.io.IOException: Cannot run program "cmd" (in directory "/var/jenkins_home/jobs/blex_functional_test/workspace"): error=2, No such file or directory
So I checked the Jenkins workspace but my Run.bat is in it :
Workspace
I have read that Jenkins is in Linux so it might cause problem with bat files, so I tried to create a script but I didn't succeed either ..
So my question is : How can I run my test on Jenkins using my file Run.bat ? What am I doing wrong here ?
Thanks a lot !
Finally I can add an answer :
Jenkins is installed on a Unix machine so you can't run a bat file, it has to be a bash script.
To create a bash script, refer here.
Then you have to make sure that the plugin Xvfb is installed (and works) on the computer where Jenkins is installed.
I use testNG with reportNg and it doesn't work with the last firefox version so you I use firefox v34.0.5 and this version must be installed also on the Jenkins computer.
If you want to open the report after the execution, install another plugin and configure it (report HTML or something like that)
God it took me about a week but it's good to see it working !
The dronekit Getting Started page suggests installing WinPython to use dronekit-Python on Windows because it includes the dependencies. I already have a working Python installation and I prefer not to risk messing it up with WinPython. What are the dependencies I need to install?
As of DKPY 2.0 this is outdated. Also, I might move to making a MavProxy module depending on whether or not the unpaid devs decide to stay when 3DR stops funding Dronekit
I've written a procedure to help with this problem which I've pasted. 3DR claims they're going to fix it, but in the mean time I hope this will help.
This setup is for Windows 64-bit systems only, although similar procedures will work with 32-bit.
Install MAVProxy and run it once before reaching step 5.
Install Notepad++.
Install Python v2.7.
Inside the Python folder, run WinPython Control Panel and select Advanced->Register Python.
Inside the same folder, run WinPython Command Prompt and input the following four commands:
• pip uninstall python-dateutil
• pip install droneapi
• pip install console
• echo module load droneapi.module.api >> %HOMEPATH%\AppData\Local\MAVProxy\mavinit.scr
Install WX Python. It should be the 64-bit Python 2.7 version.
Download and install OpenCV 2.4.11 to any folder
• Copy/paste the file cv2.pyd from OpenCV\build\python\2.7\x64\ to \python-2.7.6.amd64\Lib\site-packages.
Steps 8 through 11 apply to SITL only
Follow the online documentation for setting up Cygwin for SITL in Windows
Go to C:\cygwin\home\Your Username\ardupilot\Tools\autotest\
Open sim_vehicle.sh in Notepad++
• Change line 429 from…
cygstart -w "/cygdrive/c/Program Files (x86)/MAVProxy/mavproxy.exe" $options --cmd="$extra_cmd" $*
to...
cygstart -w "/cygdrive/c/Users/YOUR USERNAME HERE/Desktop/WinPython-64bit-2.7.6.4/python-2.7.6.amd64/Dronekit/Scripts/mavproxy.py" $options --cmd="$extra_cmd" $*
Note: This location changes depending on where you installed WinPython. For me, it was the desktop.
Start simulations as you would normally for SITL. To run Python scripts during the simulations, use the command
• api start Path to script\script_name
To use the code to connect to an actual copter, open WinPython Command Prompt
• Navigate to the folder which contains the scripts you wish to test
• Type mavproxy.py --master=”com##”,57600
• Run your script by typing into the MAVProxy terminal
o api start script_name
The angular doc recommends Protractor for e2etesting.
http://docs.angularjs.org/guide/dev_guide.e2e-testing
I didn't find any doc about running it on Windows.
Can Protractor run on Windows?
**
Update:
I have some experience on Selenium using C# code to call functions in some selenium dlls to control IE brower.
But what are the relationship between Protractor, Selenium and NodeJS?
Is Protractor an tool(exe) or a lib(dll) or a JS lib(like Jasmine)?
Yes, you can run it on windows.
I hope this guide will help you:
http://www.ng-newsletter.com/posts/practical-protractor.html
You should Start Selenium local server and use this basic configuration for run protractor (Depending routes):
chromeDriver: './node_modules/protractor/selenium/chromedriver',
specs: ['test/e2e/**/*_spec.js'],
chromeOnly: true,
chromeDriver: './node_modules/protractor/selenium/chromedriver',
seleniumAddress: 'http://0.0.0.0:4444/wd/hub'
Yes at least it should. It runs on node and node runs on windows. However sometimes projects have windows issues, the most common cause IMO is hardcoding of / etc.. If the library uses node path and similar os independent apis then all is fine.
I have ran protractor on windows without any issues. But not extensively.
Prerequisites & Installation:
Prerequisites
Node.js (Latest Version)
Download NodeJS
Install NodeJs
To test Node.Js installation properly open command prompt and execute the command.
Java Development Kit(JDK)
Download the JDK
Install JDK from
Installation
Install Protractor Globally
Open the command prompt and type following command to install protractor globally.
npm install -g protractor
This will install two command line tools, protractor and webdriver-manager. Try running below command to check protractor version.
protractor –version
The webdriver-manager is a helper tool to easily get an instance of a Selenium Server running. Use it to download the necessary binaries with:
webdriver-manager update
Now start up a server with:
webdriver-manager start
What is the best way to run silverlight unit tests automatically using team city?
I have found StatLight which we had working well when we used cc.net, and it says that it has support for teamcity. Does this just mean the test results output file is compatible with teamcity? Do I need to create a command line runner to run the tests? If so how do I get the test results into team city?
Thanks
TeamCity has an extensibility feature where you can output special commands to the console and the TeamCity agent will capture the commands and publish the results within TeamCity.
If you get StatLight running on your desktop - do a regular console-run. Then do another run by giving it the "--teamcity" parameter. Notice the difference in the output?
In TeamCity you can setup a Command Line Build Runner
Command executable: "<Path to statlight.exe>"
Command parameters: "-x=%system.teamcity.build.checkoutDir%\PathToXap\SilverlightClient.Tests.xap --teamcity"
Hope this helps.
There's also a StatLight TeamCity plugin that adds a test runner.
You can try using Lighthouse Silverlight Unit Test Runner, it works with every Build Server including TeamCity and CCNet because it by default produces NUnit compatible xml results file:
http://lighthouse.codeplex.com/