Created
February 1, 2011 23:10
-
-
Save fsouza/806930 to your computer and use it in GitHub Desktop.
Arquivos da apresentação de testes de aceitação com Splinter e Lettuce, realizada no Giran Siege.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#language:pt-br | |
Funcionalidade: Contar recursos da Giran | |
Para fazer uma apresentação legal no Giran Siege | |
Como um recurso da Giran | |
Eu gostaria de mostrar como contar os recursos | |
Cenário: Contando recursos do site | |
Dado que estou na página inicial do site da Giran | |
Quando eu clico no link "Time" | |
Então eu devo ver "9" recursos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from lettuce import step, world | |
@step(u'that I am on Giran\'s homepage') | |
def given_that_i_am_on_giran_s_homepage(step): | |
world.browser.visit('http://www.giran.com.br') | |
@step(u'I click on "(.*)" link') | |
def when_i_click_on_group1_link(step, link_text): | |
world.browser.find_link_by_text(link_text).first.click() | |
@step(u'I should see "(\d+)" resources') | |
def then_i_should_see_group1_resources(step, resources_count): | |
count = int(resources_count) | |
resources = world.browser.find_by_css_selector('div.member') | |
assert len(resources) == count | |
@step(u'que estou na página inicial do site da Giran') | |
def dado_que_estou_na_pagina_inicial_do_site_da_giran(step): | |
world.browser.visit('http://www.giran.com.br') | |
@step(u'eu clico no link "(.*)"') | |
def quando_eu_clico_no_link_group1(step, texto_link): | |
world.browser.find_link_by_text(texto_link).first.click() | |
@step(u'eu devo ver "(\d+)" recursos') | |
def entao_eu_devo_ver_group1_recursos(step, quantidade_recursos): | |
count = int(quantidade_recursos) | |
resources = world.browser.find_by_css_selector('div.member') | |
assert len(resources) == count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Count Giran Resources | |
In order to make a nice presentation on Giran Siege | |
As a Giran resource | |
I want to show how to count the resources | |
Scenario: Counting real data | |
Given that I am on Giran's homepage | |
When I click on "Time" link | |
Then I should see "9" resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lettuce import world, before, after | |
from splinter.browser import Browser | |
@before.all | |
def setup_browser(): | |
world.browser = Browser('webdriver.firefox') | |
@after.all | |
def teardown_browser(total): | |
world.browser.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment