Skip to content

Instantly share code, notes, and snippets.

@twalpole
Created November 24, 2017 17:48
Show Gist options
  • Save twalpole/ec7dafc36f0654931aa8e78b066d56b9 to your computer and use it in GitHub Desktop.
Save twalpole/ec7dafc36f0654931aa8e78b066d56b9 to your computer and use it in GitHub Desktop.
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.current_window.resize_to(400,300)
sleep 3
sess.current_window.resize_to(1024, 768)
sleep 3
sess.current_window.resize_to(400, 300)
sleep 3
sess.current_window.resize_to(1024, 768)
sleep 3
__END__
<!doctype html>
<html>
<head>
<title>Some title</title>
</head>
<body>
<input name="test"/>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment