Module: PrependCapybaraSession

Defined in:
lib/cyperful/framework_injections.rb

Overview

we need to override the some Capybara::Session methods because they control the top-level browser window, but we want them to control the iframe instead

Instance Method Summary collapse

Instance Method Details

#current_urlObject



36
37
38
39
40
# File 'lib/cyperful/framework_injections.rb', line 36

def current_url
  url = Cyperful.current&.internal_current_url
  return url if url
  super
end

#go_backObject



47
48
49
50
# File 'lib/cyperful/framework_injections.rb', line 47

def go_back
  super
  Cyperful.current&.drive_iframe
end

#refreshObject



42
43
44
45
# File 'lib/cyperful/framework_injections.rb', line 42

def refresh
  return if Cyperful.current&.internal_visit(current_url)
  super
end

#visit(url) ⇒ Object



31
32
33
34
# File 'lib/cyperful/framework_injections.rb', line 31

def visit(url)
  return if Cyperful.current&.internal_visit(url)
  super
end