Getting Started
Where to get Pyccuracy from?

Pyccuracy is officially hosted in github.


The repository can be found at http://github.com/heynemann/pyccuracy/.


Right now Pyccuracy only supports usage from the source code.

You can get ahold of the source code using git to get it or get the latest stable version from Pyccuracy PyPI page (be advised that even though Pyccuracy has releases in PyPI it won't work with easy_install).


Before we get the source code for Pyccuracy, though, we need to setup some dependencies.


If you need any git-related help, github has a lot of resources here.


lXml Dependency

In order to generate reports Pyccuracy is dependent on lXml, a library used for parsing, generating XML files and for XSLT transformations.


Install using apt-get

In order to obtain lXml, in Debian do:


            sudo apt-get install lxml
        

That should be it. For other OS's or distributions, we still have to figure out how to install lXml (want to contribute the tutorial?).


PyoC and Selenium Dependencies

Pyccuracy is dependent on PyoC, which is an IoC Container for Python.

It is also dependent on Selenium, which is a browser automation framework in Java with Python Bindings.

You have two ways of installing both PyoC and Selenium: easy_install or creating a symbollic link for the source code (or adding to PYTHONPATH in Windows).


Easy Install

To install using easy_install you need to have setuptools installed. There's a whole guide on how to do it here.


After having it properly installed, just run:


Linux

	        sudo easy_install selenium        
	        sudo easy_install pyoc
        

Windows

	        easy_install selenium
	        easy_install pyoc
        

Source Code

To install using the source code you'll need to download the source code for PyoC and Selenium.

This guide assumes you have git up and running. For more info on how to do that, just check the github guides page.


PyoC Source Code

For PyoC you can clone the git repository at http://github.com/heynemann/pyoc/.


In order to clone the git repository, do:


Linux

            In a terminal window:
            cd /folder/with/sources/
            git clone git://github.com/heynemann/pyoc.git pyoc
        

Windows

            In a command window:
            cd c:\folder\with\sources\
            git clone git://github.com/heynemann/pyoc.git pyoc
        
Selenium Source Code

Selenium source code can be retrieved from their website at Selenium HQ. Download Selenium RC, and inside it you can find the selenium.py file. This is the file we'll have to link to Python.


Linking Source to Python

After having both source trees for PyoC and Selenium, do:


Linux
The shell script below assumes /usr/lib/python2.5/site-packages as your site-packages folder for the current python install.
It also assumes /folder/with/sources/pyoc as the folder where you're keeping the pyoc source code, and /folder/with/sources/selenium as the folder that contains selenium.py.

Also, the comments enclosed in parenthesis ARE NOT part of the commands and have clarification purposes.


            In a terminal window:
            cd /usr/lib/python2.5/site-packages	        
            sudo ln -s /folder/with/sources/pyoc/pyoc (yeah that's right, pyoc appears twice here)
            sudo ln -s /folder/with/sources/selenium (again, this is the folder where selenium.py is)
        

Windows


In Windows, the easiest way to do this is to add the folders where you have both source codes to the PYTHONPATH environment variable.

If you are not sure how to do that, here you can find a tutorial on setting environment variables in windows.



Pyccuracy Source Code

Assuming you have all the dependencies working so far, we'll now get Pyccuracy Source code. As I said before, it can be retrieved from the git repository or PyPI. Let's explore each.


Git Repository

To retrieve the source code from the git repository, we'll just issue some git commands. This guide assumes you have git up and running. For more info on how to do that, just check the github guides page.


Linux

            In a terminal window:
            cd /folder/with/sources/
            git clone git://github.com/heynemann/pyccuracy.git pyccuracy
        

Windows

            In a command window:
            cd c:\folder\with\sources\
            git clone git://github.com/heynemann/pyccuracy.git pyccuracy
        

PyPI - Python Package Index

To get the content from PyPI, just access Pyccuracy's PyPI page and download the .tar.gz file with the whatever version source code you want.


Then unzip it to the /folder/with/sources/pyccuracy (or c:\folder\with\sources\pyccuracy in windows) folder and you're done.


Linking Pyccuracy to Python

The last step to have Pyccuracy installed is having its code linked to Python. This step is very similar to the PyoC one.


After having the source trees for Pyccuracy in the right place, do:


Linux
The shell script below assumes /usr/lib/python2.5/site-packages as your site-packages folder for the current python install.
It also assumes /folder/with/sources/pyccuracy as the folder where you're keeping the pyccuracy source code.

Also, the comments enclosed in parenthesis ARE NOT part of the commands and have clarification purposes.

The last step is so you can use pyccuracy_console.py easily anywhere in your OS.


            In a terminal window:
            cd /usr/lib/python2.5/site-packages	        
            sudo ln -s /folder/with/sources/pyccuracy/pyccuracy (yeah that's right, pyccuracy appears twice here)
            cd /usr/bin
            sudo ln -s /folder/with/sources/pyccuracy/pyccuracy/pyccuracy-console.py pyccuracy-console
        

Windows


In Windows, the easiest way to do this is to add the folders where you have pyccuracy source code to both the PYTHONPATH and PATH environment variables.

If you are not sure how to do that, here you can find a tutorial on setting environment variables in windows.



Conclusion

At this point you should have Pyccuracy up and running.


Next Step - Browser Driver Dependencies



 
Pyccuracy is an open-source Python project with an OSI license.

The entry barrier for coding in Pyccuracy is really small, since the codebase is itself small as you can see in the stats above.

If you think you can contribute, join our dev list, check our JIRA server for the open tickets for the current release and start coding.