Skip to content

Instantly share code, notes, and snippets.

View douglasmartins7's full-sized avatar
🎯
Focusing

Douglas Martins douglasmartins7

🎯
Focusing
View GitHub Profile
def select_date_flight_package(type, month, day)
#passa o valor do id para um novo objeto type
type = capture_date(type)
#acessa o objeto input e clica nele
find("##{type}").click
#pika-next = next month seta
find('.pika-next').click while has_no_text?(month)
#pika-lendar calendar all. Ele altera a volta true no mes que passou na variavel
within('.pika-lendar', text: month) do
#acessa o pika lendar dentro tem uma tag td que possui um dia que ao encontra-lo com o objeto day clica nele
@douglasmartins7
douglasmartins7 / all
Created August 10, 2017 16:14
.bat for WINDOWS(_Script para automação)
echo ... 0ff
title .:: Abrir All Cenarios CVC Responsivo::.
echo direcionamento 1
cd %~dp0Workspace_Jenkins\ruby_responsivo\cenarios_aereo
start /wait cmd /c "Aereo_Responsivo.bat & exit"
echo direcionamento 2
cd %~dp0Workspace_Jenkins\ruby_responsivo\cenarios_hoteis
@douglasmartins7
douglasmartins7 / capybara cheat sheet
Last active September 18, 2017 19:11 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
text = variavel local
@text = variavel de estancia
@@text = variavel de classe
$text = variavel global
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
@douglasmartins7
douglasmartins7 / Ruby Download Parse JSON
Created September 22, 2017 22:53 — forked from timsavery/Ruby Download Parse JSON
Example For Downloading and Parsing JSON (Ruby)
require "rubygems"
require "json"
require "net/http"
require "uri"
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
@douglasmartins7
douglasmartins7 / capirb.txt
Created November 23, 2017 12:37 — forked from peterkappus/capirb.txt
Quick start for using Capybara in IRB with Chromedriver
# 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/
# I prefer using chrome...
# First you need to install the chromedriver https://sites.google.com/a/chromium.org/chromedriver/downloads
# Unzip, and move the executable somewhere in your path...
# e.g.
mv ~/Downloads/chromedriver /usr/local/bin
@douglasmartins7
douglasmartins7 / pry.rb
Created January 31, 2018 17:34 — forked from aalvesjr/pry.rb
Tutorial para usar PRY
# instalar a GEM pry
gem install pry pry-doc
# executa console
pry
# curiosidades:
# auto-complete com TAB
# entrar no contexto do objeto com cd <objeto>
# possui paginação automatica
#tipos de condicionais
#primeira maneira - default
a = 1
if a == 1
puts "oi"
end
#tudo em uma linha
puts "oi" if a == 1
# Operadores logicos - utilizamos dentro de um if, unless, while
###################################################################
#Comparação
==
a = 2
if a == 2
puts "faça algo"
end
#While - enquanto - precisa de uma valvular de escape
#valvula de escape
index = 0
#enquanto o que o index for menor que 5 imprima ele
while index < 5
puts index
index +=1
end
#imprime de 0 a 4