Module: Capybara::Presenter

Defined in:
lib/capybara/presenter.rb,
lib/capybara/presenter/version.rb,
lib/capybara/presenter/configuration.rb,
lib/capybara/presenter/notifications.rb,
lib/capybara/presenter/capybara_extensions.rb

Overview

Main module for the Capybara::Presenter gem. Transforms standard Capybara system tests into presentation-ready demos with visual notifications and configurable delays.

Defined Under Namespace

Modules: CapybaraExtensions, ClassMethods, InstanceMethods, Notifications Classes: Configuration, Error

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.configurationObject



16
17
18
# File 'lib/capybara/presenter.rb', line 16

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



20
21
22
# File 'lib/capybara/presenter.rb', line 20

def configure
  yield(configuration) if block_given?
end

.included(base) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/capybara/presenter.rb', line 29

def self.included(base)
  base.extend(ClassMethods)
  base.include(InstanceMethods)

  # Show setup guidance when presenter mode is enabled
  return unless configuration.enabled

  show_setup_guidance
end

.reset_configuration!Object



24
25
26
# File 'lib/capybara/presenter.rb', line 24

def reset_configuration!
  @configuration = Configuration.new
end

.show_setup_guidanceObject

rubocop:disable Metrics/MethodLength



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/capybara/presenter.rb', line 40

def self.show_setup_guidance
  puts "\n    \u{1F3AC} Capybara::Presenter Setup Guidance:\n\n    For browser notifications to appear:\n    1. Use a non-headless driver (Chrome, Firefox, Safari)\n    2. Ensure browser opens visibly\#{' '}\n    3. Disable parallel testing: parallelize(workers: 1)\n\n    Environment variables:\n    - PRESENTER_DELAY=2.0 (action delays)\n    - PRESENTER_TEST_START_DELAY=2.0 (pause before each test)\n    - PRESENTER_NOTIFICATIONS=false (disable notifications)\n\n    \u{1F4A1} This gem works with your existing Capybara driver configuration\n\n  GUIDANCE\nend\n"