Skip to content

Instantly share code, notes, and snippets.

View douglasmartins7's full-sized avatar
🎯
Focusing

Douglas Martins douglasmartins7

🎯
Focusing
View GitHub Profile
@douglasmartins7
douglasmartins7 / regex.md
Created December 7, 2020 21:33 — forked from alexandreservian/regex.md
Metacaracteres Regex

Representantes

Meta Nome Função
. ponto um caractere qualquer
[] conjunto conjunto de caracteres permitidos
[^] conjunto negado conjunto de caracteres proibidos

Quantificadores

{
// Define o tema do VSCode
"workbench.colorTheme": "Dracula",
// Configura tamanho e família da fonte
"editor.fontSize": 18,
"editor.lineHeight": 24,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
@douglasmartins7
douglasmartins7 / wait_until.rb
Created June 4, 2019 20:29 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
@douglasmartins7
douglasmartins7 / facebook_login.feature
Created August 15, 2018 16:42 — forked from gunesmes/facebook_login.feature
Capybara and Cucumber: Handling iframe, Pop-ups and Facebook Login
Feature: Facebook Login
As An anonymous user
I Want to login the webpage
So That I can buy anything
Background: Member should open home page
Given I go to home page
@javascript
Scenario: Member should be able to login with Facebook
@douglasmartins7
douglasmartins7 / install.sh
Created May 25, 2018 14:28 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@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
@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 / 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 / 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=