Class: WatchDoge::Configuration
- Inherits:
-
Object
- Object
- WatchDoge::Configuration
- Defined in:
- lib/watchdoge/configuration.rb
Defined Under Namespace
Classes: Hooks
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#chrome_version ⇒ Object
Returns the value of attribute chrome_version.
-
#cookie_pool ⇒ Object
Returns the value of attribute cookie_pool.
-
#default_worker_options ⇒ Object
readonly
Returns the value of attribute default_worker_options.
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#firefox_version ⇒ Object
Returns the value of attribute firefox_version.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#host ⇒ Object
Returns the value of attribute host.
-
#notifications ⇒ Object
Returns the value of attribute notifications.
-
#regression_dir ⇒ Object
Returns the value of attribute regression_dir.
-
#sign_in_proc ⇒ Object
Returns the value of attribute sign_in_proc.
-
#sign_out_proc ⇒ Object
Returns the value of attribute sign_out_proc.
-
#web_drivers_dir ⇒ Object
Returns the value of attribute web_drivers_dir.
-
#worker_options ⇒ Object
Returns the value of attribute worker_options.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/watchdoge/configuration.rb', line 53 def initialize # base_dir is where WatchDoge stuff operating include installation or configuration @base_dir = if defined? Rails Rails.root.to_s else Dir.pwd end # webdrivers binaries installation directory @web_drivers_dir = @base_dir + "/.webdrivers" # framwork that Worker used, default to selenium @engine = Watir::Browser # options for worker @default_worker_options = { # default window-size of worker width: 1280, height: 768, # using Firfox as default browser browser: :firefox, # default to headless headless: true, # connection timeout threshold(seconds) timeout: 120 } @worker_options = {} # where all cookie saved (as yaml) @cookie_pool = @base_dir + '/.doge_cookie' # map of notification sources # key: must be stringify of its class name # value: hash struct, will passed to constructor while push message @notifications = { # slack_webhook: { # incoming_url: SLACK_WEBHOOK # } # mattermost: { # host: HOST, # channel_id: CHANNEL_ID, # auth_token: AUTH_TOKEN # } } # host for relative URL in regression test. @host = '' # regression directory contains reference images and scenario scripts @regression_dir = if defined?(Rails) @base_dir + "/test/watchdoge" else @base_dir + "/watchdoge" end @hooks = WatchDoge::Configuration::Hooks.new # Proc for #sign_in_as(resource) in regression scenario # worker: WatchDoge instance that executing scnario # resource: passed whatever you want @sign_in_proc = -> (worker, resource) {} @sign_out_proc = -> (worker, resource) {} # specific webdriver version, default to latest if nil @chrome_version = nil @firefox_version = nil end |
Instance Attribute Details
#base_dir ⇒ Object
Returns the value of attribute base_dir.
31 32 33 |
# File 'lib/watchdoge/configuration.rb', line 31 def base_dir @base_dir end |
#chrome_version ⇒ Object
Returns the value of attribute chrome_version.
50 51 52 |
# File 'lib/watchdoge/configuration.rb', line 50 def chrome_version @chrome_version end |
#cookie_pool ⇒ Object
Returns the value of attribute cookie_pool.
36 37 38 |
# File 'lib/watchdoge/configuration.rb', line 36 def @cookie_pool end |
#default_worker_options ⇒ Object (readonly)
Returns the value of attribute default_worker_options.
38 39 40 |
# File 'lib/watchdoge/configuration.rb', line 38 def @default_worker_options end |
#engine ⇒ Object
Returns the value of attribute engine.
35 36 37 |
# File 'lib/watchdoge/configuration.rb', line 35 def engine @engine end |
#firefox_version ⇒ Object
Returns the value of attribute firefox_version.
51 52 53 |
# File 'lib/watchdoge/configuration.rb', line 51 def firefox_version @firefox_version end |
#hooks ⇒ Object
Returns the value of attribute hooks.
46 47 48 |
# File 'lib/watchdoge/configuration.rb', line 46 def hooks @hooks end |
#host ⇒ Object
Returns the value of attribute host.
43 44 45 |
# File 'lib/watchdoge/configuration.rb', line 43 def host @host end |
#notifications ⇒ Object
Returns the value of attribute notifications.
41 42 43 |
# File 'lib/watchdoge/configuration.rb', line 41 def notifications @notifications end |
#regression_dir ⇒ Object
Returns the value of attribute regression_dir.
44 45 46 |
# File 'lib/watchdoge/configuration.rb', line 44 def regression_dir @regression_dir end |
#sign_in_proc ⇒ Object
Returns the value of attribute sign_in_proc.
47 48 49 |
# File 'lib/watchdoge/configuration.rb', line 47 def sign_in_proc @sign_in_proc end |
#sign_out_proc ⇒ Object
Returns the value of attribute sign_out_proc.
48 49 50 |
# File 'lib/watchdoge/configuration.rb', line 48 def sign_out_proc @sign_out_proc end |
#web_drivers_dir ⇒ Object
Returns the value of attribute web_drivers_dir.
33 34 35 |
# File 'lib/watchdoge/configuration.rb', line 33 def web_drivers_dir @web_drivers_dir end |
#worker_options ⇒ Object
Returns the value of attribute worker_options.
39 40 41 |
# File 'lib/watchdoge/configuration.rb', line 39 def @worker_options end |