Skip to content

Instantly share code, notes, and snippets.

View vivipoit's full-sized avatar
🤓
🔊 🎶🎵 work work work work work 🎶🎵

Vivi Poit vivipoit

🤓
🔊 🎶🎵 work work work work work 🎶🎵
View GitHub Profile
@marcoslebron
marcoslebron / capybara_form_submit.rb
Last active May 7, 2020 11:30
I was trying to submit a form without button using just Capybara and Rspec
class Capybara::Session
def submit(element)
Capybara::RackTest::Form.new(driver, element.native).submit({})
end
end
#in the test
fill_in 'Search', with: 'dice'
form = find '#search-form' # find the form
@mars
mars / register_chrome_with_window_size.rb
Created October 13, 2013 01:58
Set window size for Capybara/Selenium/chromedriver
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app,
browser: :chrome,
desired_capabilities: {
"chromeOptions" => {
"args" => %w{ window-size=1024,768 }
}
}
)
end