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
require "rubygems" | |
require "pages" | |
module SearchTestHelper | |
def classic_search(configuration,text_to_search, expected_result) | |
home = Search::HomePage.new(configuration) | |
home.visit | |
home.input_search(text_to_search) |
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 | |
Funcionalidade: Leitor de tipos de Triângulo | |
Para conhecer o tipo de um triangulo | |
Como um aluno da matemática | |
Eu quero informar os tamanhos do lado de um triangulo e saber qual o tipo do triangulo | |
NARRATIVA | |
Um triângulo com todos os lados iguais é chamado Equilátero |
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 | |
Funcionalidade: Leitor de tipos de Triângulo | |
Para conhecer o tipo de um triângulo | |
Como um aluno da matemática | |
Eu quero informar os tamanhos do lado de um triângulo e saber qual o tipo do triângulo | |
NARRATIVA | |
Um triângulo com todos os lados iguais é chamado Equilátero |
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
// Namespaces usados | |
// Used namespaces | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using WebApplication1; | |
// Nossa classe de testes | |
// Our test class | |
[TestClass] | |
public class TrianguloTeste | |
{ |
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
gem list | cut -d ' ' -f 1 | tee gems.txt | xargs gem uninstall -I -a && for path in $(echo `gem env path` | tr ":" "\n"); do rm -rf ${path}/specifications/* ${path}/cache/*; done && cat gems.txt | xargs gem install | |
rm gems.txt |
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
require "watir-webdriver" | |
b = Watir::Browser.new | |
b.goto "http://www.republicavirtual.com.br/cep/exemplos.php" | |
b.text_field(:id => "campoCEP").value = "<SEU CEP AQUI>" | |
b.button(:value => "buscar cep").click | |
puts Watir::Wait.until {b.div(:id => "resultado").text.include? "sucesso"} |
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
# copy and paste this into your terminal to start an IRB session and use Capybara's DSL to write tests interactively | |
# Thanks to Tom Clements | |
# http://tom-clements.com/blog/2012/02/25/capybara-on-the-command-line-live-browser-testing-from-irb/ | |
irb | |
require 'capybara/dsl' | |
include Capybara::DSL | |
Capybara.default_driver = :selenium | |
visit "http://127.0.0.1:3000" | |
visit "http://www.google.com" #etc... |
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
require "watir-webdriver" | |
b = Watir::Browser.new | |
b.goto "http://www.geradordecpf.org/" | |
arr = Array.new | |
5000.times do |i| | |
b.button(:value => "Gerar").click | |
arr.push(b.text_field(:id => "numero").value) |
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
require "rspec/core/formatters/base_text_formatter" | |
class WatirHtmlFormatter < RSpec::Core::Formatters::BaseTextFormatter | |
end | |
def extra_failure_content(failure) | |
content = [] | |
content << "<span>" | |
file_name = save_html | |
content << link_for(file_name) |
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
rspec --require ./watir_html_formatter.rb --format WatirHtmlFormatter --out output/index.html test/bar_spec.spec |
OlderNewer