Wednesday, May 22, 2013

How to setup Jenkins for python for tests

How to configure jenkins to run python tests after every commit or by schedule:
Download and install java on your computer.
Download last stable version of jenkins for your operating system from the official site
Run with the following command:
java -jar jenkins.war
Assuming that you already have virtualenv and create your virtual environment
$virtualenv mytestenv
$source mytestenv/bin/activate
Install dependencies for python, in our case: nose and nosexunit (for writing and running tests),
pip install nose
pip install nosexunit
pip install selenium

open a browser and go to http://127.0.0.1:8080 jenkins web interface
install git plugin

Create new job and select run bash:
Put the path to your git working copy: /home/yourname/your_repository

And add the following script:
#!/bin/bash -ex
source /home/andrii/Downloads/mytestdir/bin/activate
nosetests tests.py --with-nosexunit

And add it for reporting:
target/NoseXUnit/core/*.xml

Tuesday, May 21, 2013

How to run webdriver remotely on virtual machine with python

To run webdriver remotely using Python + VBox we need to run selenium standalone server on each machines Master and Slaves with different roles.
Master(Hub)
Slave1(Node)
...
Slave1(Node)

Run selenium server on Master PC with a hub role
>java -jar selenium-server-standalone-2.28.0.jar -role hub
Run selenium instance on Slave VBox with webdriver or node role
>java -jar selenium-server-standalone-2.28.0.jar -role webdriver -hub http://<Hub IP address>:4444/grid/register -browser browserName=chrome, platform=WINDOWS
Run selenium instance on Slave VBox with webdriver or node role
>java -jar selenium-server-standalone-2.28.0.jar -role webdriver -hub http://<Hub IP address>:4444/grid/register -browser browserName=firefox, platform=LINUX
Run selenium instance on Slave VBox with webdriver or node role
>java -jar selenium-server-standalone-2.28.0.jar -role webdriver -hub http://<Hub IP address>:4444/grid/register -browser browserName=safari, platform=MAC
Run webdriver commands on Master PC
>from selenium import webdriver
>browser_win = webdriver.Remote(command_executor='http://localhost:4444/wd/hub', desired_capabilities={'browserName':'firefox', 'platform':'WINDOWS'})
>browser_nix = webdriver.Remote(command_executor='http://localhost:4444/wd/hub', desired_capabilities={'browserName':'firefox', 'platform':'LINUX'})
>browser_mac = webdriver.Remote(command_executor='http://localhost:4444/wd/hub', desired_capabilities={'browserName':'firefox', 'platform':'MAC'})
>browser_nix.get('http://google.com')

Now we're able to write tests which can be executed on remote and/or virtual machines.

Saturday, February 23, 2013

Online tools

http://en.linoit.com/ - Sticky and Photo Sharing for you
https://www.guerrillamail.com/ - Disposable Temporary E-Mail Address
https://join.me/ - free screen sharing and online meetings
http://gyazo.com/en - screen grabbing tool
http://www.online-convert.com/ - Convert media files online from one format into another
http://caniuse.com - Compatibility tables for support of HTML5, CSS3, SVG and more in desktop and mobile browsers
http://www.ustream.tv - live streaming platform
http://new.livestream.com/ -  live streaming platform
http://www.online-stopwatch.com/ - Online Stopwatch tool
http://www.hidemyass.com/ - web proxy
http://goo.gl/ - Google URL Shortener
http://webwhiteboard.com - online whiteboard
http://qrcode.kaywa.com/ - QR code generator
http://2epub.com - converts various e-book formats.
http://2zip.org - allows to extract archives online and convert many 'exotic' formats to ZIP.
http://puzzleware.net/codehtmler/default.aspx - is a simple program that translates plain text code into a colorized HTML version of the code
http://www.diffchecker.com/ - online text diff

Online development tools


http://sandbox.onlinephpfunctions.com/ - php playground
http://jsbeautifier.org/ - javascript beautifier 
http://regex101.com/ - regexp playground
http://regexpal.com/ - a JavaScript regular expression tester
http://jsoneditoronline.org/ - json online editor
http://rubular.com/ - regexp playground
http://gskinner.com/RegExr/ - regexp playground
http://www.debuggex.com/ - regexp playground
http://www.regexper.com/ - regexp playground
http://regexponline.com/ - regexp playground
http://jsfiddle.net/ - online editor for snippets build from HTML, CSS and JavaScript
http://sqlfiddle.com/ - a tool for easy online testing and sharing of database problems and their solutions.
http://refiddle.com/ - regexp playground
https://koding.com/ - software development in the browser
http://codepen.io/ - is all about front end code inspiration and education through sharing
http://dabblet.com -  is an interactive playground for quickly testing snippets of CSS and HTML code.
http://cssdesk.com/ - css playground
http://jsdo.it/ - is an online editor where you can try running your codes as you write.
https://tinker.io/ -  is a quick and easy tool for writing and sharing code
http://tinkerbin.com/ - lets you play around with HTML, JavaScript and CSS without creating files or uploading to servers
https://thimble.webmaker.org/en-US/editor - makes it ridiculously simple to create your own web pages. Write and edit HTML and CSS right in your browser. Instantly preview your work. Then host and share your finished pages with a single click. Easy
http://liveweave.com - is a HTML5, CSS3 & JavaScript playground
http://code.google.com/apis/ajax/playground/ - Code Playground
https://compilr.com - online platform that allows developers to write and learn code all from the comfort of their web browser
https://c9.io/ - is an online platform for development; the code is open-sourced on GitHub, free to adapt and use for everyone, anywhere, anytime.
https://api.divshot.com - work easier with twitter Bootstrap
http://www.bestwebfonts.com/ - web fonts
http://editor.method.ac/ - SVG editor
http://cedvel.com/ - application for designing grid systems
http://cssdeck.com/ - is a place where you can quickly create some experiments (or testcases) that involves HTML, CSS, JS code.

Do you know some useful online tools?