Skip to content

Instantly share code, notes, and snippets.

View joey-g's full-sized avatar

Joey Gryder joey-g

View GitHub Profile
@joey-g
joey-g / ancestor_descendant.html
Created February 20, 2015 16:42
Automation Training Week 3
<!--
In the example below, attempting to access the individual input element in
the second div is possible using an ancestor/descendant selector. If we
only selected the input with the class "test_class" with:
document.querySelector('input.test_class');
We wouldn't be guaranteed to receive a unique element, as this selector
would match both input elements.
@joey-g
joey-g / object_examples.rb
Created February 13, 2015 16:33
Automation Training Week 2
# McDonalds Example --------------------------
class McDonalds
def initialize(location)
@location = location
end
def get_location
return @location
@joey-g
joey-g / property_detail_attributes.rb
Created February 9, 2015 14:50
Script for pulling window.bt.listings.models attributes.
# Helper for accessing window.bt.listings.models object on page. Uses detail_attribute
# param to access specific field on found property's details object.
def property_detail_attribute(detail_attribute)
detail_script = <<-CMD
matched_property =
$.grep(window.bt.listings.models,
function(m) {
return m.id == #{@property_id};
})[0];
if (matched_property) {
@joey-g
joey-g / cat.rb
Created February 6, 2015 19:39
Automation Training - Cat Class
# The class 'Cat' defines the blueprint of what an instantiated Cat
# object will eventually look like. In this case, a Cat object would
# have two attributes (name and color), and one function (or verb) that
# can be called on that object (eat_food).
class Cat
# Attributes that describe the Cat class.
attr_reader :name
attr_reader :color