Module: Capybara::Simulated

Defined in:
lib/capybara/simulated.rb,
lib/capybara/simulated/node.rb,
lib/capybara/simulated/trace.rb,
lib/capybara/simulated/driver.rb,
lib/capybara/simulated/errors.rb,
lib/capybara/simulated/browser.rb,
lib/capybara/simulated/version.rb,
lib/capybara/simulated/minitest.rb,
lib/capybara/simulated/sourcemap.rb,
lib/capybara/simulated/v8_runtime.rb,
lib/capybara/simulated/asset_cache.rb,
lib/capybara/simulated/script_cache.rb,
lib/capybara/simulated/runtime_shared.rb,
lib/capybara/simulated/stack_resolver.rb,
lib/capybara/simulated/webauthn_state.rb,
lib/capybara/simulated/worker_runtime.rb,
lib/capybara/simulated/quickjs_runtime.rb,
lib/capybara/simulated/trace_persistence.rb,
lib/capybara/simulated/whitespace_normalizer.rb

Defined Under Namespace

Modules: MinitestTrace, RuntimeShared, ScriptCache, SleepHook, TracePersistence, WhitespaceNormalizer Classes: AssetCache, Browser, Driver, FrameNotSupported, Node, QuickJSRuntime, Sourcemap, StackResolver, StaleElement, Trace, V8Runtime, WebauthnState, WorkerRuntime

Constant Summary collapse

JS_ENGINES =

Canonical list of JS-engine identifiers. Used by:

  • Browser#build_runtime to dispatch to the right Runtime class
  • Browser#detect_js_engine to pick a default when neither CSIM_JS_ENGINE nor js_engine: is given (order = preference, so V8 wins ties because it's faster per-spec)
  • vs-world's csim_rspec.rb / csim_minitest.rb to validate YAML engine: keys at load time
%i[v8 quickjs].freeze
USER_SLEEP_THRESHOLD_S =

User-intent sleep(n) from a test forwards to the active driver so any setTimeout(n') callbacks the user is waiting on fire on the next tick. The JS clock is otherwise wall-clock-independent for determinism; this is the bridge that lets reload-style specs still pace via sleep.

Capybara's internal sleep(retry_interval) is 10–50 ms and doesn't represent test-author intent; forwarding it would add per-poll drain overhead. Test pacing sleeps (e.g. sleep(0.3)) land above the threshold.

0.1
VERSION =
'0.6.0'

Class Attribute Summary collapse

Class Attribute Details

.next_driver_user_agentObject

Returns the value of attribute next_driver_user_agent.



26
27
28
# File 'lib/capybara/simulated.rb', line 26

def next_driver_user_agent
  @next_driver_user_agent
end

.next_driver_viewportObject

Returns the value of attribute next_driver_viewport.



26
27
28
# File 'lib/capybara/simulated.rb', line 26

def next_driver_viewport
  @next_driver_viewport
end