Skip to content

Instantly share code, notes, and snippets.

@seraphlnWu
Created May 14, 2013 09:49
Show Gist options
  • Save seraphlnWu/5574856 to your computer and use it in GitHub Desktop.
Save seraphlnWu/5574856 to your computer and use it in GitHub Desktop.
Pyccuracy is a test tool that provide its own DSL for writing test cases just like human language. And the next is a simple introduction about it.
= PREPARE =
[X] Install tools
[X] install Pyccuracy
* pip install selenium
* pip install pyccuracy
[X] install selenium
* git clone http://github.com/heynemann/pyccuracy
the selenium.jar is under the pyccuracy/lib/ path.
* java -jar selenium-server.jar
* if you have not a java runtime, then installed one.
[X] install lxml
* pip install lxml
[X] install firefox
= Create a test case =
{{{
As a Yahoo User
I want to search Yahoo
So that I can test my installation of Pyccuracy
Scenario 1 - Searching for Python Testing Cookbook
Given
I go to "http://www.yahoo.com"
When
I fill "p" textbox with "Python Testing Cookbook"
And I click "search-submit" button and wait
Then
I see "Python Testing Cookbook - Yahoo! Search Results" title
}}}
* attentions
* file name must follow test_xxx.acc (xxx is your own file name parts, and the #acc# is the postfix of file)
* run command: pyccuracy_console -p test.acc
= Details =
* after run the test case, You will find a new firefox opened and load http://yahoo.com
* next, It will input the given keyword "Python Testing Cookbook"
* finally, You will see the results page of Yahoo search engine.
*
* After all of these steps, pyccuracy will generate a report.html, You can open this file and see the detail infomation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment