2. Behave
• Ferramenta baseada em Behavior Driven Development (BDD)
• Utilizado para criar especificações em linguagem natural (Gherkin) com associação a uma linguagem de
automação(no nosso caso python 3.4)
Feature: Title (one line describing the story/feature)
As a [role] I want [feature] So that [benefit]
Scenario: Title1 (for Behaviour 1)
Given [context or setup]
And [some more context]...
When [event occurs]
Then [expected outcome]
And [another outcome]...
Scenario: Title2 (for Behaviour 2) ...
3. Testar as operações da calculadora
Link: https://juliemr.github.io/protractor-demo/
6. Selenium
• Se comunica diretamente com o browser para simular interações do usuário
• Dispõe de uma api que prove vários métodos para localizar elementos na tela, por ex:
◦ find_element_by_id
◦ find_element_by_name
◦ find_element_by_xpath
◦ find_element_by_link_text
◦ find_element_by_partial_link_text
◦ find_element_by_tag_name
◦ find_element_by_class_name
◦ find_element_by_css_selector
◦ …
9. Page Object
• Padrão usado para diminuir o impacto de mudanças do HTML das páginas nos testes automáticos
• Separação entre código de teste e código específico da página
• Deve encapsular toda a lógica de interação com o site testado
18. Orientações para aprendizado
* Códigos para o projeto apresentado => https://github.com/augustaraposo
* Behave => http://jenisys.github.io/behave.example/
* Selenium with python => http://selenium-python.readthedocs.org/getting-started.html
* Curso de python do Codecademy => https://www.codecademy.com/pt/learn
* Livro de python gratuito => http://learnpythonthehardway.org/
*Documentação do python 3.X => https://docs.python.org/3.4/tutorial/index.html