Class: Maze::Configuration
- Inherits:
-
Object
- Object
- Maze::Configuration
- Defined in:
- lib/maze/configuration.rb
Overview
MazeRunner configuration
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Farm access key.
-
#always_log ⇒ Object
Always log all received requests to the console at the end of a scenario.
-
#android_app_files_directory ⇒ Object
Folder to push app files to on Android.
-
#app ⇒ Object
The app that tests will be run against.
-
#app_activity ⇒ Object
The appActivity to be set in the Appium capabilities.
-
#app_bundle_id ⇒ Object
Bundle ID of the test application.
-
#app_package ⇒ Object
The appPackage to be set in the Appium capabilities.
-
#appium_logfile ⇒ Object
The location of the appium server logfile.
-
#appium_server_url ⇒ Object
URL of the Appium server.
-
#appium_version ⇒ Object
Appium version to use.
-
#apple_team_id ⇒ Object
Apple Team Id.
-
#aspecto_repeater_api_key ⇒ Object
API key to use when repeating requests to Bugsnag.
-
#aws_public_ip ⇒ Object
Enables awareness of a public IP address on Buildkite with the Elastic CI Stack for AWS.
-
#bind_address ⇒ Object
Mock server bind address.
-
#browser ⇒ Object
Test browser type.
-
#browser_version ⇒ Object
Test browser version.
-
#bs_local ⇒ Object
Location of the BrowserStackLocal binary (if used).
-
#bugsnag_repeater_api_key ⇒ Object
API key to use when repeating requests to Bugsnag.
-
#capabilities ⇒ Object
Appium capabilities.
-
#capabilities_option ⇒ Object
Appium capabilities provided via the CL.
-
#captured_invalid_requests ⇒ Object
The server endpoints for which invalid requests should be captured and cause tests to fail.
-
#client_mode_validation ⇒ Object
Sets whether validation should be run in client mode.
-
#custom_validators ⇒ Object
readonly
Custom validators to use for a given endpoint.
-
#device ⇒ Object
Test device type.
-
#device_id ⇒ Object
Device id for running on local iOS devices.
-
#device_list ⇒ Object
A list of devices to attempt to connect to, in order.
-
#document_server_bind_address ⇒ Object
Document server bind address.
-
#document_server_port ⇒ Object
Document server port.
-
#document_server_root ⇒ Object
Document server root.
-
#enable_bugsnag ⇒ Object
Enables bugsnag reporting.
-
#enable_retries ⇒ Object
Whether retries should be allowed.
-
#enforce_bugsnag_integrity ⇒ Object
Whether presence of the Bugsnag-Integrity header should be enforced.
-
#farm ⇒ Object
Device farm to be used, one of: :bs (BrowserStack) :local (Using Appium Server with a local device) :none (Cucumber-driven testing with no devices).
-
#file_log ⇒ Object
Write received requests to disk for all scenarios.
-
#https ⇒ Object
Whether the mock server should use https.
-
#locator ⇒ Object
Element locator strategy, :id or :accessibility_id.
-
#log_requests ⇒ Object
Console logging of received requests for a test failure.
-
#null_port ⇒ Object
Terminating server bind port.
-
#os ⇒ Object
OS.
-
#os_version ⇒ Object
OS version.
-
#port ⇒ Object
Mock server port.
-
#receive_no_requests_wait ⇒ Object
Time in seconds to wait in the ‘I should receive no requests` step.
-
#receive_requests_slow_threshold ⇒ Object
Time after which requests are deemed to be slow to be received and a warning is logged for.
-
#receive_requests_wait ⇒ Object
Maximum time in seconds to wait in the ‘I wait to receive int error(s)/session(s)/build(s)` steps.
-
#sb_local ⇒ Object
Location of the SmartBear binary (if used).
-
#selenium_server_url ⇒ Object
URL of the Selenium server.
-
#skipped_validators ⇒ Object
readonly
Whether default validation should be skipped for a given endpoint.
-
#span_timestamp_validation ⇒ Object
Whether timestamp validation should be performed on spans.
-
#start_appium ⇒ Object
Whether an appium server should be started.
-
#start_tunnel ⇒ Object
Whether the device farm secure tunnel should be started.
-
#unmanaged_traces_mode ⇒ Object
Enables unmanaged trace mode.
-
#username ⇒ Object
Farm username.
Instance Method Summary collapse
-
#add_validator(endpoint, &validator) ⇒ Object
Consumes a block that will be triggered when a request is received for a specific endpoint This will prevent any existing default validation from triggering.
-
#initialize ⇒ Configuration
constructor
Set default values.
- #legacy_driver=(value) ⇒ Object
-
#legacy_driver? ⇒ Boolean
Whether the legacy (JSON-WP) Appium driver should be used.
-
#skip_default_validation(endpoint) ⇒ Object
Sets whether to skip default validation for a given endpoint.
Constructor Details
#initialize ⇒ Configuration
Set default values
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/maze/configuration.rb', line 8 def initialize self.receive_no_requests_wait = 30 self.receive_requests_wait = 30 self.receive_requests_slow_threshold = 10 self.enforce_bugsnag_integrity = true self.captured_invalid_requests = Set[:errors, :sessions, :builds, :uploads, :sourcemaps] self.android_app_files_directory = nil self. = true self.unmanaged_traces_mode = false self.client_mode_validation = true @legacy_driver = false end |
Instance Attribute Details
#access_key ⇒ Object
Farm access key
165 166 167 |
# File 'lib/maze/configuration.rb', line 165 def access_key @access_key end |
#always_log ⇒ Object
Always log all received requests to the console at the end of a scenario
236 237 238 |
# File 'lib/maze/configuration.rb', line 236 def always_log @always_log end |
#android_app_files_directory ⇒ Object
Folder to push app files to on Android
146 147 148 |
# File 'lib/maze/configuration.rb', line 146 def android_app_files_directory @android_app_files_directory end |
#app ⇒ Object
The app that tests will be run against. Could be one of:
-
a local file path
-
a BrowserStack url for a previously uploaded app (bs://…)
-
on macOS, the name of an installed or previously executed application
134 135 136 |
# File 'lib/maze/configuration.rb', line 134 def app @app end |
#app_activity ⇒ Object
The appActivity to be set in the Appium capabilities
180 181 182 |
# File 'lib/maze/configuration.rb', line 180 def app_activity @app_activity end |
#app_bundle_id ⇒ Object
Bundle ID of the test application
159 160 161 |
# File 'lib/maze/configuration.rb', line 159 def app_bundle_id @app_bundle_id end |
#app_package ⇒ Object
The appPackage to be set in the Appium capabilities
183 184 185 |
# File 'lib/maze/configuration.rb', line 183 def app_package @app_package end |
#appium_logfile ⇒ Object
The location of the appium server logfile
223 224 225 |
# File 'lib/maze/configuration.rb', line 223 def appium_logfile @appium_logfile end |
#appium_server_url ⇒ Object
URL of the Appium server
189 190 191 |
# File 'lib/maze/configuration.rb', line 189 def appium_server_url @appium_server_url end |
#appium_version ⇒ Object
Appium version to use
186 187 188 |
# File 'lib/maze/configuration.rb', line 186 def appium_version @appium_version end |
#apple_team_id ⇒ Object
Apple Team Id
208 209 210 |
# File 'lib/maze/configuration.rb', line 208 def apple_team_id @apple_team_id end |
#aspecto_repeater_api_key ⇒ Object
API key to use when repeating requests to Bugsnag
76 77 78 |
# File 'lib/maze/configuration.rb', line 76 def aspecto_repeater_api_key @aspecto_repeater_api_key end |
#aws_public_ip ⇒ Object
Enables awareness of a public IP address on Buildkite with the Elastic CI Stack for AWS.
82 83 84 |
# File 'lib/maze/configuration.rb', line 82 def aws_public_ip @aws_public_ip end |
#bind_address ⇒ Object
Mock server bind address
29 30 31 |
# File 'lib/maze/configuration.rb', line 29 def bind_address @bind_address end |
#browser ⇒ Object
Test browser type
174 175 176 |
# File 'lib/maze/configuration.rb', line 174 def browser @browser end |
#browser_version ⇒ Object
Test browser version
177 178 179 |
# File 'lib/maze/configuration.rb', line 177 def browser_version @browser_version end |
#bs_local ⇒ Object
Location of the BrowserStackLocal binary (if used)
156 157 158 |
# File 'lib/maze/configuration.rb', line 156 def bs_local @bs_local end |
#bugsnag_repeater_api_key ⇒ Object
API key to use when repeating requests to Bugsnag
79 80 81 |
# File 'lib/maze/configuration.rb', line 79 def bugsnag_repeater_api_key @bugsnag_repeater_api_key end |
#capabilities ⇒ Object
Appium capabilities
125 126 127 |
# File 'lib/maze/configuration.rb', line 125 def capabilities @capabilities end |
#capabilities_option ⇒ Object
Appium capabilities provided via the CL
128 129 130 |
# File 'lib/maze/configuration.rb', line 128 def capabilities_option @capabilities_option end |
#captured_invalid_requests ⇒ Object
The server endpoints for which invalid requests should be captured and cause tests to fail
73 74 75 |
# File 'lib/maze/configuration.rb', line 73 def captured_invalid_requests @captured_invalid_requests end |
#client_mode_validation ⇒ Object
Sets whether validation should be run in client mode
115 116 117 |
# File 'lib/maze/configuration.rb', line 115 def client_mode_validation @client_mode_validation end |
#custom_validators ⇒ Object (readonly)
Custom validators to use for a given endpoint
91 92 93 |
# File 'lib/maze/configuration.rb', line 91 def custom_validators @custom_validators end |
#device ⇒ Object
Test device type
168 169 170 |
# File 'lib/maze/configuration.rb', line 168 def device @device end |
#device_id ⇒ Object
Device id for running on local iOS devices
217 218 219 |
# File 'lib/maze/configuration.rb', line 217 def device_id @device_id end |
#device_list ⇒ Object
A list of devices to attempt to connect to, in order
171 172 173 |
# File 'lib/maze/configuration.rb', line 171 def device_list @device_list end |
#document_server_bind_address ⇒ Object
Document server bind address
45 46 47 |
# File 'lib/maze/configuration.rb', line 45 def document_server_bind_address @document_server_bind_address end |
#document_server_port ⇒ Object
Document server port
48 49 50 |
# File 'lib/maze/configuration.rb', line 48 def document_server_port @document_server_port end |
#document_server_root ⇒ Object
Document server root
42 43 44 |
# File 'lib/maze/configuration.rb', line 42 def document_server_root @document_server_root end |
#enable_bugsnag ⇒ Object
Enables bugsnag reporting
70 71 72 |
# File 'lib/maze/configuration.rb', line 70 def enable_bugsnag @enable_bugsnag end |
#enable_retries ⇒ Object
Whether retries should be allowed
67 68 69 |
# File 'lib/maze/configuration.rb', line 67 def enable_retries @enable_retries end |
#enforce_bugsnag_integrity ⇒ Object
Whether presence of the Bugsnag-Integrity header should be enforced
64 65 66 |
# File 'lib/maze/configuration.rb', line 64 def enforce_bugsnag_integrity @enforce_bugsnag_integrity end |
#farm ⇒ Object
Device farm to be used, one of: :bs (BrowserStack) :local (Using Appium Server with a local device) :none (Cucumber-driven testing with no devices)
140 141 142 |
# File 'lib/maze/configuration.rb', line 140 def farm @farm end |
#file_log ⇒ Object
Write received requests to disk for all scenarios
230 231 232 |
# File 'lib/maze/configuration.rb', line 230 def file_log @file_log end |
#https ⇒ Object
Whether the mock server should use https
26 27 28 |
# File 'lib/maze/configuration.rb', line 26 def https @https end |
#locator ⇒ Object
Element locator strategy, :id or :accessibility_id
122 123 124 |
# File 'lib/maze/configuration.rb', line 122 def locator @locator end |
#log_requests ⇒ Object
Console logging of received requests for a test failure
233 234 235 |
# File 'lib/maze/configuration.rb', line 233 def log_requests @log_requests end |
#null_port ⇒ Object
Terminating server bind port
35 36 37 |
# File 'lib/maze/configuration.rb', line 35 def null_port @null_port end |
#os ⇒ Object
OS
211 212 213 |
# File 'lib/maze/configuration.rb', line 211 def os @os end |
#os_version ⇒ Object
OS version
214 215 216 |
# File 'lib/maze/configuration.rb', line 214 def os_version @os_version end |
#port ⇒ Object
Mock server port
32 33 34 |
# File 'lib/maze/configuration.rb', line 32 def port @port end |
#receive_no_requests_wait ⇒ Object
Time in seconds to wait in the ‘I should receive no requests` step
55 56 57 |
# File 'lib/maze/configuration.rb', line 55 def receive_no_requests_wait @receive_no_requests_wait end |
#receive_requests_slow_threshold ⇒ Object
Time after which requests are deemed to be slow to be received and a warning is logged for
61 62 63 |
# File 'lib/maze/configuration.rb', line 61 def receive_requests_slow_threshold @receive_requests_slow_threshold end |
#receive_requests_wait ⇒ Object
Maximum time in seconds to wait in the ‘I wait to receive int error(s)/session(s)/build(s)` steps
58 59 60 |
# File 'lib/maze/configuration.rb', line 58 def receive_requests_wait @receive_requests_wait end |
#sb_local ⇒ Object
Location of the SmartBear binary (if used)
153 154 155 |
# File 'lib/maze/configuration.rb', line 153 def sb_local @sb_local end |
#selenium_server_url ⇒ Object
URL of the Selenium server
192 193 194 |
# File 'lib/maze/configuration.rb', line 192 def selenium_server_url @selenium_server_url end |
#skipped_validators ⇒ Object (readonly)
Whether default validation should be skipped for a given endpoint
104 105 106 |
# File 'lib/maze/configuration.rb', line 104 def skipped_validators @skipped_validators end |
#span_timestamp_validation ⇒ Object
Whether timestamp validation should be performed on spans
85 86 87 |
# File 'lib/maze/configuration.rb', line 85 def @span_timestamp_validation end |
#start_appium ⇒ Object
Whether an appium server should be started
220 221 222 |
# File 'lib/maze/configuration.rb', line 220 def start_appium @start_appium end |
#start_tunnel ⇒ Object
Whether the device farm secure tunnel should be started
143 144 145 |
# File 'lib/maze/configuration.rb', line 143 def start_tunnel @start_tunnel end |
#unmanaged_traces_mode ⇒ Object
Enables unmanaged trace mode.
88 89 90 |
# File 'lib/maze/configuration.rb', line 88 def unmanaged_traces_mode @unmanaged_traces_mode end |
#username ⇒ Object
Farm username
162 163 164 |
# File 'lib/maze/configuration.rb', line 162 def username @username end |
Instance Method Details
#add_validator(endpoint, &validator) ⇒ Object
Consumes a block that will be triggered when a request is received for a specific endpoint This will prevent any existing default validation from triggering.
98 99 100 101 |
# File 'lib/maze/configuration.rb', line 98 def add_validator(endpoint, &validator) @custom_validators ||= {} @custom_validators[endpoint] = validator end |
#legacy_driver=(value) ⇒ Object
199 200 201 |
# File 'lib/maze/configuration.rb', line 199 def legacy_driver=(value) @legacy_driver = value end |
#legacy_driver? ⇒ Boolean
Whether the legacy (JSON-WP) Appium driver should be used
195 196 197 |
# File 'lib/maze/configuration.rb', line 195 def legacy_driver? @legacy_driver end |
#skip_default_validation(endpoint) ⇒ Object
Sets whether to skip default validation for a given endpoint
109 110 111 112 |
# File 'lib/maze/configuration.rb', line 109 def skip_default_validation(endpoint) @skipped_validators ||= {} @skipped_validators[endpoint] = true end |