Skip to content

Instantly share code, notes, and snippets.

@harvgill
harvgill / create_documentation.rb
Created April 5, 2011 17:45
Parses all your cucumber feature files and outputs a sexy html file. Just drop this file in the same folder as your features folder, and run it. Gives you an overall view of everything you have automated.
def print_header
@out.puts '<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Automation Documentation</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".feature_body").hide();
@harvgill
harvgill / css_selector_builder
Created April 4, 2011 22:44
CSS Selector Builder
I've heard people needing help with figuring out how to replace xpath with css_selectors. Here's some javascript that helps you build cssSelectors. Copy/paste this javascript into your browser address bar to see a cool cssbuilder. Bookmark it onto your bookmarks toolbar for quick and easy access.
javascript:(function(){var%20s=document.createElement('div');s.innerHTML='Loading...';s.style.color='black';s.style.padding='20px';s.style.position='fixed';s.style.zIndex='9999';s.style.fontSize='3.0em';s.style.border='2px%20solid%20black';s.style.right='40px';s.style.top='40px';s.setAttribute('class','selector_gadget_loading');s.style.background='white';document.body.appendChild(s);s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('src','http://www.selectorgadget.com/stable/lib/selectorgadget.js?raw=true');document.body.appendChild(s);})();
--Harv