Class: TestCentricity::Environ
- Inherits:
-
DataObject
show all
- Defined in:
- lib/testcentricity_web/data_objects/environment.rb
Instance Attribute Summary collapse
Attributes inherited from DataObject
#context, #current, #hash_table
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from DataObject
current, current=
Constructor Details
#initialize(data) ⇒ Environ
Returns a new instance of Environ.
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 98
def initialize(data)
@protocol = data['PROTOCOL']
@hostname = data['HOST_NAME']
@base_url = data['BASE_URL']
@user_id = data['USER_ID']
@password = data['PASSWORD']
@append = data['APPEND']
@app_id = data['APP_ID']
@api_key = data['API_KEY']
@option1 = data['OPTIONAL_1']
@option2 = data['OPTIONAL_2']
@option3 = data['OPTIONAL_3']
@option4 = data['OPTIONAL_4']
@dns = data['DNS']
@db_username = data['DB_USERNAME']
@db_password = data['DB_PASSWORD']
@a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
@locale = ENV['LOCALE'] || 'en'
@language = ENV['LANGUAGE'] || 'English'
super
end
|
Instance Attribute Details
#a11y_standard ⇒ Object
Returns the value of attribute a11y_standard.
80
81
82
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 80
def a11y_standard
@a11y_standard
end
|
Returns the value of attribute api_key.
89
90
91
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 89
def api_key
@api_key
end
|
Returns the value of attribute app_id.
88
89
90
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 88
def app_id
@app_id
end
|
Returns the value of attribute append.
87
88
89
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 87
def append
@append
end
|
Returns the value of attribute base_url.
84
85
86
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 84
def base_url
@base_url
end
|
Returns the value of attribute browser.
53
54
55
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 53
def browser
@browser
end
|
#browser_size ⇒ Object
Returns the value of attribute browser_size.
54
55
56
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 54
def browser_size
@browser_size
end
|
#db_password ⇒ Object
Returns the value of attribute db_password.
96
97
98
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 96
def db_password
@db_password
end
|
#db_username ⇒ Object
Returns the value of attribute db_username.
95
96
97
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 95
def db_username
@db_username
end
|
Returns the value of attribute device.
59
60
61
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 59
def device
@device
end
|
#device_name ⇒ Object
Returns the value of attribute device_name.
60
61
62
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 60
def device_name
@device_name
end
|
#device_orientation ⇒ Object
Returns the value of attribute device_orientation.
64
65
66
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 64
def device_orientation
@device_orientation
end
|
#device_os ⇒ Object
Returns the value of attribute device_os.
62
63
64
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 62
def device_os
@device_os
end
|
#device_os_version ⇒ Object
Returns the value of attribute device_os_version.
63
64
65
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 63
def device_os_version
@device_os_version
end
|
#device_type ⇒ Object
Returns the value of attribute device_type.
61
62
63
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 61
def device_type
@device_type
end
|
Returns the value of attribute dns.
94
95
96
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 94
def dns
@dns
end
|
Returns the value of attribute driver.
66
67
68
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 66
def driver
@driver
end
|
#external_page ⇒ Object
Returns the value of attribute external_page.
78
79
80
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 78
def external_page
@external_page
end
|
Returns the value of attribute grid.
67
68
69
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 67
def grid
@grid
end
|
Returns the value of attribute headless.
55
56
57
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 55
def headless
@headless
end
|
Returns the value of attribute hostname.
83
84
85
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 83
def hostname
@hostname
end
|
Returns the value of attribute language.
70
71
72
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 70
def language
@language
end
|
Returns the value of attribute locale.
69
70
71
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 69
def locale
@locale
end
|
Returns the value of attribute option1.
90
91
92
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 90
def option1
@option1
end
|
Returns the value of attribute option2.
91
92
93
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 91
def option2
@option2
end
|
Returns the value of attribute option3.
92
93
94
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 92
def option3
@option3
end
|
Returns the value of attribute option4.
93
94
95
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 93
def option4
@option4
end
|
Returns the value of attribute os.
58
59
60
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 58
def os
@os
end
|
Returns the value of attribute parallel.
72
73
74
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 72
def parallel
@parallel
end
|
Returns the value of attribute password.
86
87
88
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 86
def password
@password
end
|
Returns the value of attribute platform.
65
66
67
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 65
def platform
@platform
end
|
#portal_context ⇒ Object
Returns the value of attribute portal_context.
77
78
79
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 77
def portal_context
@portal_context
end
|
#portal_status ⇒ Object
Returns the value of attribute portal_status.
76
77
78
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 76
def portal_status
@portal_status
end
|
#process_num ⇒ Object
Returns the value of attribute process_num.
73
74
75
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 73
def process_num
@process_num
end
|
Returns the value of attribute protocol.
82
83
84
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 82
def protocol
@protocol
end
|
#session_code ⇒ Object
Returns the value of attribute session_code.
57
58
59
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 57
def session_code
@session_code
end
|
#session_state ⇒ Object
Returns the value of attribute session_state.
56
57
58
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 56
def session_state
@session_state
end
|
#signed_in ⇒ Object
Returns the value of attribute signed_in.
75
76
77
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 75
def signed_in
@signed_in
end
|
#test_environment ⇒ Object
Returns the value of attribute test_environment.
52
53
54
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 52
def test_environment
@test_environment
end
|
#tunneling ⇒ Object
Returns the value of attribute tunneling.
68
69
70
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 68
def tunneling
@tunneling
end
|
Returns the value of attribute user_id.
85
86
87
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 85
def user_id
@user_id
end
|
Class Method Details
165
166
167
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 165
def self.browser
@browser
end
|
.browser=(browser) ⇒ Object
161
162
163
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 161
def self.browser=(browser)
@browser = browser.downcase.to_sym
end
|
.browser_size ⇒ Object
173
174
175
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 173
def self.browser_size
@browser_size
end
|
.browser_size=(size) ⇒ Object
169
170
171
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 169
def self.browser_size=(size)
@browser_size = size
end
|
205
206
207
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 205
def self.device
@device
end
|
.device=(device) ⇒ Object
201
202
203
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 201
def self.device=(device)
@device = device
end
|
.device_name ⇒ Object
233
234
235
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 233
def self.device_name
@device_name
end
|
.device_name=(name) ⇒ Object
229
230
231
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 229
def self.device_name=(name)
@device_name = name
end
|
.device_orientation ⇒ Object
265
266
267
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 265
def self.device_orientation
@device_orientation
end
|
.device_orientation=(orientation) ⇒ Object
261
262
263
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 261
def self.device_orientation=(orientation)
@device_orientation = orientation.downcase.to_sym
end
|
.device_os ⇒ Object
241
242
243
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 241
def self.device_os
@device_os
end
|
.device_os=(os) ⇒ Object
237
238
239
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 237
def self.device_os=(os)
@device_os = os.downcase.to_sym
end
|
.device_os_version ⇒ Object
249
250
251
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 249
def self.device_os_version
@device_os_version
end
|
.device_os_version=(version) ⇒ Object
245
246
247
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 245
def self.device_os_version=(version)
@device_os_version = version
end
|
.device_type ⇒ Object
225
226
227
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 225
def self.device_type
@device_type
end
|
.device_type=(type) ⇒ Object
221
222
223
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 221
def self.device_type=(type)
@device_type = type.downcase.to_sym
end
|
273
274
275
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 273
def self.driver
@driver
end
|
.driver=(type) ⇒ Object
269
270
271
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 269
def self.driver=(type)
@driver = type
end
|
.external_page ⇒ Object
349
350
351
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 349
def self.external_page
@external_page
end
|
.get_screen_shots ⇒ Object
357
358
359
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 357
def self.get_screen_shots
@screen_shots
end
|
281
282
283
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 281
def self.grid
@grid
end
|
.grid=(type) ⇒ Object
277
278
279
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 277
def self.grid=(type)
@grid = type
end
|
181
182
183
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 181
def self.headless
@headless
end
|
.headless=(state) ⇒ Object
177
178
179
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 177
def self.headless=(state)
@headless = state
end
|
.is_android? ⇒ Boolean
257
258
259
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 257
def self.is_android?
@device_os == :android
end
|
.is_desktop? ⇒ Boolean
317
318
319
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 317
def self.is_desktop?
@platform == :desktop
end
|
.is_device? ⇒ Boolean
209
210
211
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 209
def self.is_device?
@device == :device
end
|
.is_ios? ⇒ Boolean
253
254
255
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 253
def self.is_ios?
@device_os == :ios
end
|
.is_mobile? ⇒ Boolean
313
314
315
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 313
def self.is_mobile?
@platform == :mobile
end
|
.is_signed_in? ⇒ Boolean
325
326
327
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 325
def self.is_signed_in?
@signed_in
end
|
.is_simulator? ⇒ Boolean
213
214
215
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 213
def self.is_simulator?
@device == :simulator
end
|
.is_web? ⇒ Boolean
217
218
219
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 217
def self.is_web?
@device == :web
end
|
297
298
299
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 297
def self.language
@language
end
|
.language=(language) ⇒ Object
293
294
295
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 293
def self.language=(language)
@language = language
end
|
305
306
307
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 305
def self.locale
@locale
end
|
.locale=(locale) ⇒ Object
301
302
303
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 301
def self.locale=(locale)
@locale = locale
end
|
197
198
199
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 197
def self.os
@os
end
|
193
194
195
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 193
def self.os=(os)
@os = os
end
|
141
142
143
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 141
def self.parallel
@parallel
end
|
.parallel=(state) ⇒ Object
137
138
139
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 137
def self.parallel=(state)
@parallel = state
end
|
309
310
311
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 309
def self.platform=(platform)
@platform = platform
end
|
.portal_context ⇒ Object
341
342
343
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 341
def self.portal_context
@portal_context
end
|
.portal_context=(portal_context) ⇒ Object
337
338
339
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 337
def self.portal_context=(portal_context)
@portal_context = portal_context
end
|
.portal_state ⇒ Object
333
334
335
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 333
def self.portal_state
@portal_status
end
|
.portal_state=(portal_state) ⇒ Object
329
330
331
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 329
def self.portal_state=(portal_state)
@portal_status = portal_state
end
|
.process_num ⇒ Object
149
150
151
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 149
def self.process_num
@process_num
end
|
.process_num=(num) ⇒ Object
145
146
147
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 145
def self.process_num=(num)
@process_num = num
end
|
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 365
def self.
= "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"\
" <b>Browser:</b>\t #{Environ.browser.capitalize}\n"
= "#{report_header} <b>Device:</b>\t\t #{Environ.device_name}\n" if Environ.device_name
= "#{report_header} <b>Device OS:</b>\t #{Environ.device_os} #{Environ.device_os_version}\n" if Environ.device_os
= "#{report_header} <b>Device type:</b>\t #{Environ.device_type}\n" if Environ.device_type
= "#{report_header} <b>Driver:</b>\t\t #{Environ.driver}\n" if Environ.driver
= "#{report_header} <b>Grid:</b>\t\t #{Environ.grid}\n" if Environ.grid
= "#{report_header} <b>OS:</b>\t\t\t #{Environ.os}\n" if Environ.os
= "#{report_header} <b>Locale:</b>\t\t #{Environ.locale}\n" if Environ.locale
= "#{report_header} <b>Language:</b>\t #{Environ.language}\n" if Environ.language
= "#{report_header} <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY']
= "#{report_header} <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
"#{report_header}\n\n"
end
|
.reset_contexts ⇒ Object
361
362
363
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 361
def self.reset_contexts
@screen_shots = []
end
|
.save_screen_shot(screen_shot) ⇒ Object
353
354
355
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 353
def self.save_screen_shot(screen_shot)
@screen_shots.push(screen_shot)
end
|
.session_code ⇒ Object
121
122
123
124
125
126
127
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 121
def self.session_code
if @session_code.nil?
characters = ('a'..'z').to_a
@session_code = (0..12).map { characters.sample }.join
end
@session_code
end
|
.session_id ⇒ Object
129
130
131
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 129
def self.session_id
@session_id
end
|
.session_state ⇒ Object
189
190
191
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 189
def self.session_state
@session_state
end
|
.session_state=(session_state) ⇒ Object
185
186
187
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 185
def self.session_state=(session_state)
@session_state = session_state
end
|
.session_time_stamp ⇒ Object
133
134
135
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 133
def self.session_time_stamp
@session_time_stamp
end
|
.set_external_page(state) ⇒ Object
345
346
347
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 345
def self.set_external_page(state)
@external_page = state
end
|
.set_signed_in(signed_in) ⇒ Object
321
322
323
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 321
def self.set_signed_in(signed_in)
@signed_in = signed_in
end
|
.test_environment ⇒ Object
153
154
155
156
157
158
159
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 153
def self.test_environment
if @test_environment.blank?
nil
else
@test_environment.downcase.to_sym
end
end
|
.tunneling ⇒ Object
289
290
291
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 289
def self.tunneling
@tunneling
end
|
.tunneling=(state) ⇒ Object
285
286
287
|
# File 'lib/testcentricity_web/data_objects/environment.rb', line 285
def self.tunneling=(state)
@tunneling = state
end
|