add cool splash screen

This commit is contained in:
John Bintz 2012-11-26 16:35:28 -05:00
parent b5b3a180bc
commit 24d7eccfe1

View File

@ -1,5 +1,6 @@
require 'capybara'
require 'capybara/selenium/driver'
require 'base64'
module PersistentSelenium
class Browser < Capybara::Selenium::Driver
@ -26,7 +27,7 @@ module PersistentSelenium
def set_app_host(host)
@app_host = host
browser.navigate.to('about:blank')
browser.navigate.to("data:text/html;base64,#{Base64.encode64(starting_page)}")
end
def reset!
@ -40,6 +41,45 @@ module PersistentSelenium
end
end
end
def starting_page
<<-HTML
<html>
<head>
<title>Persistent Selenium -- Starting up...</title>
<style>
body {
background: #444;
}
* {
font-family: Verdana, Helvetica, sans-serif;
}
td {
background: #ccc;
width: 50%;
text-align: center;
border: solid #333 1px;
border-radius: 5px;
padding: 10px;
}
</style>
</head>
<body>
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<h1>Persistent Selenium</h1>
<h2>Starting up...</h2>
</td>
</tr>
</table>
</body>
</html>
HTML
end
end
end