lib/generic_test/page.rb in generic_test-0.1.0 vs lib/generic_test/page.rb in generic_test-0.1.1
- old
+ new
@@ -1,13 +1,20 @@
module GenericTest
+ # Represents a web page state at a particular point of time
class Page
# @return [Array] List of links
attr_accessor :links
attr_accessor :url
+ attr_accessor :html
+ attr_accessor :title
- def initialize(url, links)
- self.links = links
- self.url = url
- puts "Found #{links.count} links at #{url}"
+ # Store state of page when it is loaded
+ # @param [Watir::Browser] browser Watir browser
+ def initialize(browser)
+ self.links = browser.links
+ self.url = browser.url
+ self.html = browser.html
+ self.title = browser.title
+ puts "Found #{links.count} links at #{url} (#{title})"
end
end
end