Skip to content
guilhermechapiewski edited this page Sep 13, 2010 · 7 revisions

Assuming that you have installed Pyccuracy following the installation guide, this is the simplest way to run your first Pyccuracy test:

Setting up Selenium Server

Download selenium-server.jar from our repository. To run, type:

$ java -jar selenium-server.jar

Pyccuracy uses GNU Make to run and stop Selenium. If want to see how we do it, please take a look at the selenium_up and selenium_down tasks of our Makefile.

Creating a simple test file

Save the following code in a file called test.acc (that is the extension for Pyccuracy Acceptance test files):

As a Google User
I want to search Google
So that I can test Pyccuracy

Scenario 1 - Searching for Hello World
Given
    I go to "http://www.google.com"
When
    I fill "q" textbox with "Hello World"
    And I click "btnG" button and wait
Then
    I see "Hello World - Google Search" title

Scenario 2 - Searching for Monty Python
Given
    I go to "http://www.google.com"
When
    I fill "q" textbox with "Monty Python"
    And I click "btnG" button and wait
Then
    I see "Monty Python - Google Search" title

Run it!

The tests are executed using pyccuracy_console command line tool. To run your test, type:

$ pyccuracy_console -u http://google.com

The only parameter needed is -u, that is the initial URL that Pyccuracy should go to start executing the tests.

To run using a different browser (e.g. Safari), type:

$ pyccuracy_console -u http://google.com -b safari

Learn more and explore

To see all options available for pyccuracy_console, type:

$ pyccuracy_console ---help

To see all the actions available for Pyccuracy (that is, the things you can do with Pyccuracy, like clicking buttons, fill textboxes and so on), you can use the pyccuracy_help command line tool. For instance, to see all the textbox actions, you can type:

$ pyccuracy_console ---term textbox

To see all options available for pyccuracy_help, type:

$ pyccuracy_help ---help

Also make sure you take a look at the “Actions Reference” section.