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



12
13
14
15
16
# File 'lib/cyperful/framework_injections.rb', line 12

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

#go_backObject



23
24
25
26
# File 'lib/cyperful/framework_injections.rb', line 23

def go_back
  super
  Cyperful.current&.drive_iframe
end

#refreshObject



18
19
20
21
# File 'lib/cyperful/framework_injections.rb', line 18

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

#visit(url) ⇒ Object



7
8
9
10
# File 'lib/cyperful/framework_injections.rb', line 7

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