Class: CucumberTree::Handler::Cookies

Inherits:
Base
  • Object
show all
Defined in:
lib/cucumber_tree/handlers/cookies.rb

Instance Attribute Summary

Attributes inherited from Base

#scenario, #world

Instance Method Summary collapse

Methods inherited from Base

#page

Instance Method Details

#load(snapshot) ⇒ Object



7
8
9
10
11
# File 'lib/cucumber_tree/handlers/cookies.rb', line 7

def load(snapshot)
  snapshot[:cookies].each do |name, value|
    page.cookies[name] = value
  end
end

#save(snapshot) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/cucumber_tree/handlers/cookies.rb', line 13

def save(snapshot)
  snapshot[:cookies] = {}.tap do |hash|
    page.cookies.each do |name, value|
      hash[name.to_sym] = value
    end
  end
end