Skip to content

Instantly share code, notes, and snippets.

@twalpole
Created May 12, 2019 18:29
Show Gist options
  • Save twalpole/6711ad9aedf4449d5edb01890726e81b to your computer and use it in GitHub Desktop.
Save twalpole/6711ad9aedf4449d5edb01890726e81b to your computer and use it in GitHub Desktop.
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'selenium-webdriver'
gem 'capybara'
gem 'puma'
gem 'byebug'
end
require "capybara/dsl"
html = DATA.read
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] }
sess = Capybara::Session.new(:selenium_chrome, app)
sess.visit('/')
sess.fill_in("Date d'expiration", with: "something")
sleep 10
__END__
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Snippet</title>
</head>
<body>
<label for="name">Date d'expiration</label>
<input id="name"/>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment