class Symbiont::Page
Attributes
url[R]
Public Class Methods
new(&block)
click to toggle source
Calls superclass method
# File lib/symbiont/capybara/page.rb, line 29 def initialize(&block) super instance_eval(&block) if block end
url_is(url)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 16 def url_is(url) @url = url.to_s end
url_matcher()
click to toggle source
# File lib/symbiont/capybara/page.rb, line 24 def url_matcher @url_matcher || url end
url_matches(url)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 20 def url_matches(url) @url_matcher = url end
Public Instance Methods
displayed?()
click to toggle source
# File lib/symbiont/capybara/page.rb, line 69 def displayed? fail Symbiont::Errors::NoUrlMatchForDefinition if url_matcher.nil? true end
perform(*args)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 56 def perform(*args) view(*args) self end
secure?()
click to toggle source
# File lib/symbiont/capybara/page.rb, line 74 def secure? !current_url.match(/^https/).nil? end
url()
click to toggle source
# File lib/symbiont/capybara/page.rb, line 61 def url self.class.url end
url_matcher()
click to toggle source
# File lib/symbiont/capybara/page.rb, line 65 def url_matcher self.class.url_matcher end
view(content = {}, &block)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 38 def view(content = {}, &block) self.ready = false if content.is_a?(String) @page = Capybara.string(content) else location = url fail Symbiont::Errors::NoUrlForDefinition if location.nil? visit url end when_ready(&block) if block_given? end
Also aliased as: load
Private Instance Methods
element_does_not_exist?(*identifier)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 92 def element_does_not_exist?(*identifier) has_no_selector?(*identifier) end
element_exists?(*identifier)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 88 def element_exists?(*identifier) has_selector?(*identifier) end
find_all(*identifier)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 84 def find_all(*identifier) all(*identifier) end
find_first(*identifier)
click to toggle source
# File lib/symbiont/capybara/page.rb, line 80 def find_first(*identifier) find(*identifier) end