Module: NetworkConditionsHelpers

Defined in:
lib/decidim/dev/test/rspec_support/network_conditions_helpers.rb

Instance Method Summary collapse

Instance Method Details

#with_browser_in_offline_modeObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/decidim/dev/test/rspec_support/network_conditions_helpers.rb', line 4

def with_browser_in_offline_mode
  page.driver.browser.network_conditions = { offline: true }

  # Wait for the browser to be offline
  sleep 1

  yield

  page.driver.browser.network_conditions = { offline: false }
end