Class: TestCentricity::Environ

Inherits:
DataObject show all
Defined in:
lib/testcentricity_apps/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.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 125

def initialize(data)
  @user_id	     = data['USER_ID']
  @password	     = data['PASSWORD']
  @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']
  @ios_app_path  = data['IOS_APP_PATH']
  @ios_ipa_path  = data['IOS_IPA_PATH']
  @ios_bundle_id = data['IOS_BUNDLE_ID']
  @ios_test_id   = data['IOS_TEST_ID']
  @android_apk_path = data['ANDROID_APK_PATH']
  @android_app_id   = data['ANDROID_APP_ID']
  @android_test_id  = data['ANDROID_TEST_ID']
  @deep_link_prefix = data['DEEP_LINK_PREFIX']
  @mac_bundle_id = data['MAC_BUNDLE_ID']

  super
end

Instance Attribute Details

#android_apk_pathObject

Returns the value of attribute android_apk_path.



117
118
119
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 117

def android_apk_path
  @android_apk_path
end

#android_app_idObject

Returns the value of attribute android_app_id.



118
119
120
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 118

def android_app_id
  @android_app_id
end

#android_test_idObject

Returns the value of attribute android_test_id.



119
120
121
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 119

def android_test_id
  @android_test_id
end

#api_keyObject

Returns the value of attribute api_key.



104
105
106
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 104

def api_key
  @api_key
end

#app_idObject

Returns the value of attribute app_id.



103
104
105
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 103

def app_id
  @app_id
end

#app_session_idObject

Returns the value of attribute app_session_id.



77
78
79
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 77

def app_session_id
  @app_session_id
end

#appium_driverObject

Returns the value of attribute appium_driver.



89
90
91
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 89

def appium_driver
  @appium_driver
end

#db_passwordObject

Returns the value of attribute db_password.



111
112
113
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 111

def db_password
  @db_password
end

#db_usernameObject

Returns the value of attribute db_username.



110
111
112
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 110

def db_username
  @db_username
end

Returns the value of attribute deep_link_prefix.



121
122
123
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 121

def deep_link_prefix
  @deep_link_prefix
end

#default_max_wait_timeObject

Returns the value of attribute default_max_wait_time.



120
121
122
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 120

def default_max_wait_time
  @default_max_wait_time
end

#deviceObject

Returns the value of attribute device.



79
80
81
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 79

def device
  @device
end

#device_nameObject

Returns the value of attribute device_name.



80
81
82
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 80

def device_name
  @device_name
end

#device_orientationObject

Returns the value of attribute device_orientation.



84
85
86
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 84

def device_orientation
  @device_orientation
end

#device_osObject

Returns the value of attribute device_os.



82
83
84
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 82

def device_os
  @device_os
end

#device_os_versionObject

Returns the value of attribute device_os_version.



83
84
85
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 83

def device_os_version
  @device_os_version
end

#device_typeObject

Returns the value of attribute device_type.



81
82
83
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 81

def device_type
  @device_type
end

#dnsObject

Returns the value of attribute dns.



109
110
111
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 109

def dns
  @dns
end

#driverObject

Returns the value of attribute driver.



87
88
89
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 87

def driver
  @driver
end

#driver_nameObject

Returns the value of attribute driver_name.



88
89
90
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 88

def driver_name
  @driver_name
end

#ios_app_pathObject

Returns the value of attribute ios_app_path.



113
114
115
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 113

def ios_app_path
  @ios_app_path
end

#ios_bundle_idObject

Returns the value of attribute ios_bundle_id.



115
116
117
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 115

def ios_bundle_id
  @ios_bundle_id
end

#ios_ipa_pathObject

Returns the value of attribute ios_ipa_path.



114
115
116
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 114

def ios_ipa_path
  @ios_ipa_path
end

#ios_test_idObject

Returns the value of attribute ios_test_id.



116
117
118
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 116

def ios_test_id
  @ios_test_id
end

#languageObject

Returns the value of attribute language.



92
93
94
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 92

def language
  @language
end

#localeObject

Returns the value of attribute locale.



91
92
93
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 91

def locale
  @locale
end

#mac_bundle_idObject

Returns the value of attribute mac_bundle_id.



123
124
125
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 123

def mac_bundle_id
  @mac_bundle_id
end

#option1Object

Returns the value of attribute option1.



105
106
107
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 105

def option1
  @option1
end

#option2Object

Returns the value of attribute option2.



106
107
108
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 106

def option2
  @option2
end

#option3Object

Returns the value of attribute option3.



107
108
109
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 107

def option3
  @option3
end

#option4Object

Returns the value of attribute option4.



108
109
110
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 108

def option4
  @option4
end

#osObject

Returns the value of attribute os.



78
79
80
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 78

def os
  @os
end

#parallelObject

Returns the value of attribute parallel.



94
95
96
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 94

def parallel
  @parallel
end

#passwordObject

Returns the value of attribute password.



102
103
104
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 102

def password
  @password
end

#platformObject

Returns the value of attribute platform.



86
87
88
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 86

def platform
  @platform
end

#portal_contextObject

Returns the value of attribute portal_context.



99
100
101
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 99

def portal_context
  @portal_context
end

#portal_statusObject

Returns the value of attribute portal_status.



98
99
100
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 98

def portal_status
  @portal_status
end

#process_numObject

Returns the value of attribute process_num.



95
96
97
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 95

def process_num
  @process_num
end

#screen_sizeObject

Returns the value of attribute screen_size.



85
86
87
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 85

def screen_size
  @screen_size
end

#session_codeObject

Returns the value of attribute session_code.



76
77
78
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 76

def session_code
  @session_code
end

#session_stateObject

Returns the value of attribute session_state.



75
76
77
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 75

def session_state
  @session_state
end

#signed_inObject

Returns the value of attribute signed_in.



97
98
99
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 97

def signed_in
  @signed_in
end

#test_environmentObject

Returns the value of attribute test_environment.



74
75
76
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 74

def test_environment
  @test_environment
end

#tunnelingObject

Returns the value of attribute tunneling.



90
91
92
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 90

def tunneling
  @tunneling
end

#user_idObject

Returns the value of attribute user_id.



101
102
103
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 101

def user_id
  @user_id
end

Class Method Details

.app_session_idObject



154
155
156
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 154

def self.app_session_id
  @app_session_id
end

.appium_driverObject



325
326
327
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 325

def self.appium_driver
  @appium_driver
end

.appium_driver=(driver_instance) ⇒ Object



321
322
323
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 321

def self.appium_driver=(driver_instance)
  @appium_driver = driver_instance
end

.default_max_wait_timeObject



202
203
204
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 202

def self.default_max_wait_time
  @default_max_wait_time
end

.default_max_wait_time=(timeout) ⇒ Object



198
199
200
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 198

def self.default_max_wait_time=(timeout)
  @default_max_wait_time = timeout
end

.deviceObject



226
227
228
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 226

def self.device
  @device
end

.device=(device) ⇒ Object



222
223
224
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 222

def self.device=(device)
  @device = device
end

.device_nameObject



255
256
257
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 255

def self.device_name
  @device_name
end

.device_name=(name) ⇒ Object



251
252
253
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 251

def self.device_name=(name)
  @device_name = name
end

.device_orientationObject



292
293
294
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 292

def self.device_orientation
  @device_orientation
end

.device_orientation=(orientation) ⇒ Object



287
288
289
290
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 287

def self.device_orientation=(orientation)
  orientation = orientation.downcase.to_sym if orientation.is_a?(String)
  @device_orientation = orientation
end

.device_osObject



263
264
265
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 263

def self.device_os
  @device_os
end

.device_os=(os) ⇒ Object



259
260
261
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 259

def self.device_os=(os)
  @device_os = os.downcase.to_sym
end

.device_os_versionObject



271
272
273
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 271

def self.device_os_version
  @device_os_version
end

.device_os_version=(version) ⇒ Object



267
268
269
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 267

def self.device_os_version=(version)
  @device_os_version = version
end

.device_typeObject



247
248
249
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 247

def self.device_type
  @device_type
end

.device_type=(type) ⇒ Object



242
243
244
245
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 242

def self.device_type=(type)
  type = type.downcase.to_sym if type.is_a?(String)
  @device_type = type
end

.driverObject



308
309
310
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 308

def self.driver
  @driver
end

.driver=(type) ⇒ Object



304
305
306
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 304

def self.driver=(type)
  @driver = type
end

.driver_nameObject



317
318
319
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 317

def self.driver_name
  @driver_name
end

.driver_name=(name) ⇒ Object



312
313
314
315
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 312

def self.driver_name=(name)
  name = name.downcase.to_sym if name.is_a?(String)
  @driver_name = name
end

.get_screen_shotsObject



397
398
399
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 397

def self.get_screen_shots
  @screen_shots
end

.is_android?Boolean

Returns:

  • (Boolean)


279
280
281
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 279

def self.is_android?
  @device_os == :android
end

.is_device?Boolean

Returns:

  • (Boolean)


230
231
232
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 230

def self.is_device?
  @device == :device
end

.is_ios?Boolean

Returns:

  • (Boolean)


275
276
277
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 275

def self.is_ios?
  @device_os == :ios
end

.is_macos?Boolean

Returns:

  • (Boolean)


283
284
285
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 283

def self.is_macos?
  @device_os == :mac
end

.is_mobile?Boolean

Returns:

  • (Boolean)


361
362
363
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 361

def self.is_mobile?
  @platform == :mobile
end

.is_signed_in?Boolean

Returns:

  • (Boolean)


369
370
371
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 369

def self.is_signed_in?
  @signed_in
end

.is_simulator?Boolean

Returns:

  • (Boolean)


234
235
236
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 234

def self.is_simulator?
  @device == :simulator
end

.is_web?Boolean

Returns:

  • (Boolean)


238
239
240
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 238

def self.is_web?
  @device == :web
end

.languageObject



341
342
343
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 341

def self.language
  @language
end

.language=(language) ⇒ Object



337
338
339
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 337

def self.language=(language)
  @language = language
end

.localeObject



349
350
351
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 349

def self.locale
  @locale
end

.locale=(locale) ⇒ Object



345
346
347
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 345

def self.locale=(locale)
  @locale = locale
end

.new_app_sessionObject



150
151
152
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 150

def self.new_app_session
  @app_session_id = Time.now.strftime('%Y%m%d%H%M%S%L')
end

.osObject



218
219
220
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 218

def self.os
  @os
end

.os=(os) ⇒ Object



214
215
216
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 214

def self.os=(os)
  @os = os
end

.parallelObject



178
179
180
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 178

def self.parallel
  @parallel
end

.parallel=(state) ⇒ Object



174
175
176
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 174

def self.parallel=(state)
  @parallel = state
end

.platformObject



357
358
359
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 357

def self.platform
  @platform
end

.platform=(platform) ⇒ Object



353
354
355
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 353

def self.platform=(platform)
  @platform = platform
end

.portal_contextObject



385
386
387
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 385

def self.portal_context
  @portal_context
end

.portal_context=(portal_context) ⇒ Object



381
382
383
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 381

def self.portal_context=(portal_context)
  @portal_context = portal_context
end

.portal_stateObject



377
378
379
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 377

def self.portal_state
  @portal_status
end

.portal_state=(portal_state) ⇒ Object



373
374
375
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 373

def self.portal_state=(portal_state)
  @portal_status = portal_state
end

.process_numObject



186
187
188
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 186

def self.process_num
  @process_num
end

.process_num=(num) ⇒ Object



182
183
184
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 182

def self.process_num=(num)
  @process_num = num
end

.report_headerObject

:nocov:



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 406

def self.report_header
  # build the Cucumber HTML report header
  report_header = "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"
  report_header = "#{report_header}  <b>Driver:</b>\t #{Environ.driver}\n" if Environ.driver
  report_header = "#{report_header}  <b>Driver Name:</b>\t #{Environ.driver_name}\n" if Environ.driver_name
  report_header = "#{report_header}  <b>Platform:</b>\t #{Environ.platform}\n" if Environ.platform
  report_header = "#{report_header}  <b>Device:</b>\t #{Environ.device_name}\n" if Environ.device_name
  report_header = "#{report_header}  <b>Device OS:</b>\t #{Environ.device_os} #{Environ.device_os_version}\n" if Environ.device_os
  report_header = "#{report_header}  <b>Device type:</b>\t #{Environ.device_type}\n" if Environ.device_type
  report_header = "#{report_header}  <b>OS:</b>\t\t #{Environ.os}\n" if Environ.os
  report_header = "#{report_header}  <b>Locale:</b>\t #{Environ.locale}\n" if Environ.locale
  report_header = "#{report_header}  <b>Language:</b>\t #{Environ.language}\n" if Environ.language
  report_header = "#{report_header}  <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY']
  "#{report_header}\n\n"
end

.reset_contextsObject



401
402
403
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 401

def self.reset_contexts
  @screen_shots = []
end

.save_screen_shot(screen_shot) ⇒ Object



393
394
395
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 393

def self.save_screen_shot(screen_shot)
  @screen_shots.push(screen_shot)
end

.screen_sizeObject



300
301
302
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 300

def self.screen_size
  @screen_size
end

.screen_size=(size) ⇒ Object



296
297
298
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 296

def self.screen_size=(size)
  @screen_size = size
end

.session_codeObject



158
159
160
161
162
163
164
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 158

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_idObject



166
167
168
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 166

def self.session_id
  @session_id
end

.session_stateObject



210
211
212
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 210

def self.session_state
  @session_state
end

.session_state=(session_state) ⇒ Object



206
207
208
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 206

def self.session_state=(session_state)
  @session_state = session_state
end

.session_time_stampObject



170
171
172
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 170

def self.session_time_stamp
  @session_time_stamp
end

.set_external_page(state) ⇒ Object



389
390
391
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 389

def self.set_external_page(state)
  @external_page = state
end

.set_signed_in(signed_in) ⇒ Object



365
366
367
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 365

def self.set_signed_in(signed_in)
  @signed_in = signed_in
end

.test_environmentObject



190
191
192
193
194
195
196
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 190

def self.test_environment
  if @test_environment.blank?
    nil
  else
    @test_environment.downcase.to_sym
  end
end

.tunnelingObject



333
334
335
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 333

def self.tunneling
  @tunneling
end

.tunneling=(state) ⇒ Object



329
330
331
# File 'lib/testcentricity_apps/data_objects/environment.rb', line 329

def self.tunneling=(state)
  @tunneling = state
end