Created
November 21, 2017 04:38
-
-
Save twalpole/2b9852cbbe01dc6b14916283398fceb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('phone_number', with: '0987654321') | |
sess.assert_selector(:field, 'phone_number', with: '0987654321') | |
__END__ | |
<!doctype html> | |
<html> | |
<head> | |
<title>Some title</title> | |
<script src="https://code.jquery.com/jquery-2.2.4.js"></script> | |
<script src="https://raw.githubusercontent.com/isocra/TableDnD/master/js/jquery.tablednd.js"></script | |
</head> | |
<body> | |
<input name="phone_number"/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment