Class: TestCentricity::Environ

Inherits:
DataObject show all
Defined in:
lib/testcentricity_web/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=, set_current

Constructor Details

#initialize(data) ⇒ Environ

Returns a new instance of Environ.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/testcentricity_web/environment.rb', line 59

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']
  @option1	   = data['OPTIONAL_1']
  @option2	   = data['OPTIONAL_2']
  @dns	       = data['DNS']
  @db_username = data['DB_USERNAME']
  @db_password = data['DB_PASSWORD']
  super
end

Instance Attribute Details

#append ⇒ Object

Returns the value of attribute append.



52
53
54
# File 'lib/testcentricity_web/environment.rb', line 52

def append
  @append
end

#base_url ⇒ Object

Returns the value of attribute base_url.



49
50
51
# File 'lib/testcentricity_web/environment.rb', line 49

def base_url
  @base_url
end

#browser ⇒ Object

Returns the value of attribute browser.



30
31
32
# File 'lib/testcentricity_web/environment.rb', line 30

def browser
  @browser
end

#browser_size ⇒ Object

Returns the value of attribute browser_size.



31
32
33
# File 'lib/testcentricity_web/environment.rb', line 31

def browser_size
  @browser_size
end

#db_password ⇒ Object

Returns the value of attribute db_password.



57
58
59
# File 'lib/testcentricity_web/environment.rb', line 57

def db_password
  @db_password
end

#db_username ⇒ Object

Returns the value of attribute db_username.



56
57
58
# File 'lib/testcentricity_web/environment.rb', line 56

def db_username
  @db_username
end

#device ⇒ Object

Returns the value of attribute device.



34
35
36
# File 'lib/testcentricity_web/environment.rb', line 34

def device
  @device
end

#device_name ⇒ Object

Returns the value of attribute device_name.



35
36
37
# File 'lib/testcentricity_web/environment.rb', line 35

def device_name
  @device_name
end

#device_orientation ⇒ Object

Returns the value of attribute device_orientation.



38
39
40
# File 'lib/testcentricity_web/environment.rb', line 38

def device_orientation
  @device_orientation
end

#device_os ⇒ Object

Returns the value of attribute device_os.



37
38
39
# File 'lib/testcentricity_web/environment.rb', line 37

def device_os
  @device_os
end

#device_type ⇒ Object

Returns the value of attribute device_type.



36
37
38
# File 'lib/testcentricity_web/environment.rb', line 36

def device_type
  @device_type
end

#dns ⇒ Object

Returns the value of attribute dns.



55
56
57
# File 'lib/testcentricity_web/environment.rb', line 55

def dns
  @dns
end

#external_page ⇒ Object

Returns the value of attribute external_page.



45
46
47
# File 'lib/testcentricity_web/environment.rb', line 45

def external_page
  @external_page
end

#hostname ⇒ Object

Returns the value of attribute hostname.



48
49
50
# File 'lib/testcentricity_web/environment.rb', line 48

def hostname
  @hostname
end

#option1 ⇒ Object

Returns the value of attribute option1.



53
54
55
# File 'lib/testcentricity_web/environment.rb', line 53

def option1
  @option1
end

#option2 ⇒ Object

Returns the value of attribute option2.



54
55
56
# File 'lib/testcentricity_web/environment.rb', line 54

def option2
  @option2
end

#os ⇒ Object

Returns the value of attribute os.



33
34
35
# File 'lib/testcentricity_web/environment.rb', line 33

def os
  @os
end

#password ⇒ Object

Returns the value of attribute password.



51
52
53
# File 'lib/testcentricity_web/environment.rb', line 51

def password
  @password
end

#platform ⇒ Object

Returns the value of attribute platform.



39
40
41
# File 'lib/testcentricity_web/environment.rb', line 39

def platform
  @platform
end

#portal_context ⇒ Object

Returns the value of attribute portal_context.



44
45
46
# File 'lib/testcentricity_web/environment.rb', line 44

def portal_context
  @portal_context
end

#portal_status ⇒ Object

Returns the value of attribute portal_status.



43
44
45
# File 'lib/testcentricity_web/environment.rb', line 43

def portal_status
  @portal_status
end

#protocol ⇒ Object

Returns the value of attribute protocol.



47
48
49
# File 'lib/testcentricity_web/environment.rb', line 47

def protocol
  @protocol
end

#session_state ⇒ Object

Returns the value of attribute session_state.



32
33
34
# File 'lib/testcentricity_web/environment.rb', line 32

def session_state
  @session_state
end

#signed_in ⇒ Object

Returns the value of attribute signed_in.



42
43
44
# File 'lib/testcentricity_web/environment.rb', line 42

def signed_in
  @signed_in
end

#test_environment ⇒ Object

Returns the value of attribute test_environment.



29
30
31
# File 'lib/testcentricity_web/environment.rb', line 29

def test_environment
  @test_environment
end

#tunneling ⇒ Object

Returns the value of attribute tunneling.



40
41
42
# File 'lib/testcentricity_web/environment.rb', line 40

def tunneling
  @tunneling
end

#user_id ⇒ Object

Returns the value of attribute user_id.



50
51
52
# File 'lib/testcentricity_web/environment.rb', line 50

def user_id
  @user_id
end

Class Method Details

.browser ⇒ Object



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

def self.browser
  @browser
end

.browser=(browser) ⇒ Object



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

def self.browser=(browser)
  @browser = browser.downcase.to_sym
end

.browser_size ⇒ Object



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

def self.browser_size
  @browser_size
end

.browser_size=(size) ⇒ Object



112
113
114
# File 'lib/testcentricity_web/environment.rb', line 112

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

.device=(device) ⇒ Object



148
149
150
# File 'lib/testcentricity_web/environment.rb', line 148

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

.device_name ⇒ Object



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

def self.device_name
  @device_name
end

.device_name=(name) ⇒ Object



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

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

.device_orientation ⇒ Object



190
191
192
# File 'lib/testcentricity_web/environment.rb', line 190

def self.device_orientation
  @device_orientation
end

.device_orientation=(orientation) ⇒ Object



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

def self.device_orientation=(orientation)
  @device_orientation = orientation.downcase.to_sym
end

.device_os ⇒ Object



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

def self.device_os
  @device_os
end

.device_os=(os) ⇒ Object



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

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

.device_type ⇒ Object



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

def self.device_type
  @device_type
end

.device_type=(type) ⇒ Object



162
163
164
# File 'lib/testcentricity_web/environment.rb', line 162

def self.device_type=(type)
  @device_type = type.downcase.to_sym
end

.external_page ⇒ Object



260
261
262
# File 'lib/testcentricity_web/environment.rb', line 260

def self.external_page
  @external_page
end

.get_screen_shots ⇒ Object



268
269
270
# File 'lib/testcentricity_web/environment.rb', line 268

def self.get_screen_shots
  @screen_shots
end

.is_desktop? ⇒ Boolean

Returns:

  • (Boolean)


216
217
218
# File 'lib/testcentricity_web/environment.rb', line 216

def self.is_desktop?
  @platform == :desktop
end

.is_device? ⇒ Boolean

Returns:

  • (Boolean)


152
153
154
# File 'lib/testcentricity_web/environment.rb', line 152

def self.is_device?
  @device
end

.is_mobile? ⇒ Boolean

Returns:

  • (Boolean)


212
213
214
# File 'lib/testcentricity_web/environment.rb', line 212

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

.is_signed_in? ⇒ Boolean

Returns:

  • (Boolean)


224
225
226
# File 'lib/testcentricity_web/environment.rb', line 224

def self.is_signed_in?
  @signed_in
end

.os ⇒ Object



138
139
140
# File 'lib/testcentricity_web/environment.rb', line 138

def self.os
  @os
end

.os=(os) ⇒ Object



134
135
136
# File 'lib/testcentricity_web/environment.rb', line 134

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

.platform=(platform) ⇒ Object



208
209
210
# File 'lib/testcentricity_web/environment.rb', line 208

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

.portal_context ⇒ Object



252
253
254
# File 'lib/testcentricity_web/environment.rb', line 252

def self.portal_context
  @portal_context
end

.portal_context=(portal_context) ⇒ Object



248
249
250
# File 'lib/testcentricity_web/environment.rb', line 248

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

.portal_state ⇒ Object



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

def self.portal_state
  @portal_status
end

.portal_state=(portal_state) ⇒ Object



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

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

.reset_contexts ⇒ Object



272
273
274
# File 'lib/testcentricity_web/environment.rb', line 272

def self.reset_contexts
  @screen_shots = []
end

.save_screen_shot(screen_shot) ⇒ Object



264
265
266
# File 'lib/testcentricity_web/environment.rb', line 264

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

.session_code ⇒ Object



74
75
76
77
78
79
80
# File 'lib/testcentricity_web/environment.rb', line 74

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



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

def self.session_id
  @session_id
end

.session_state ⇒ Object



124
125
126
# File 'lib/testcentricity_web/environment.rb', line 124

def self.session_state
  @session_state
end

.session_state=(session_state) ⇒ Object



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

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

.session_time_stamp ⇒ Object



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

def self.session_time_stamp
  @session_time_stamp
end

.set_browser(browser) ⇒ Object

Deprecated.

Please use #browser= instead



99
100
101
102
# File 'lib/testcentricity_web/environment.rb', line 99

def self.set_browser(browser)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_browser' is deprecated.  Please use 'Environ.browser =' instead."
  @browser = browser.downcase.to_sym
end

.set_device(device) ⇒ Object

Deprecated.

Please use #device= instead



143
144
145
146
# File 'lib/testcentricity_web/environment.rb', line 143

def self.set_device(device)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_device' is deprecated.  Please use 'Environ.device =' instead."
  @device = device
end

.set_device_type(type) ⇒ Object

Deprecated.

Please use #device_type= instead



157
158
159
160
# File 'lib/testcentricity_web/environment.rb', line 157

def self.set_device_type(type)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_device_type' is deprecated.  Please use 'Environ.device_type =' instead."
  @device_type = type.downcase
end

.set_external_page(state) ⇒ Object



256
257
258
# File 'lib/testcentricity_web/environment.rb', line 256

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

.set_os(os) ⇒ Object

Deprecated.

Please use #os= instead



129
130
131
132
# File 'lib/testcentricity_web/environment.rb', line 129

def self.set_os(os)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_os' is deprecated.  Please use 'Environ.os =' instead."
  @os = os
end

.set_platform(platform) ⇒ Object

Deprecated.

Please use #platform= instead



203
204
205
206
# File 'lib/testcentricity_web/environment.rb', line 203

def self.set_platform(platform)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_platform' is deprecated.  Please use 'Environ.platform =' instead."
  @platform = platform
end

.set_portal_context(portal_context) ⇒ Object

Deprecated.

Please use #portal_context= instead



243
244
245
246
# File 'lib/testcentricity_web/environment.rb', line 243

def self.set_portal_context(portal_context)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_portal_context' is deprecated.  Please use 'Environ.portal_context =' instead."
  @portal_context = portal_context
end

.set_portal_state(portal_state) ⇒ Object

Deprecated.

Please use #portal_state= instead



229
230
231
232
# File 'lib/testcentricity_web/environment.rb', line 229

def self.set_portal_state(portal_state)
  warn "[DEPRECATION] 'TestCentricity::Environ.set_portal_state' is deprecated.  Please use 'Environ.portal_state =' instead."
  @portal_status = portal_state
end

.set_signed_in(signed_in) ⇒ Object



220
221
222
# File 'lib/testcentricity_web/environment.rb', line 220

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

.test_environment ⇒ Object



90
91
92
93
94
95
96
# File 'lib/testcentricity_web/environment.rb', line 90

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

.tunneling ⇒ Object



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

def self.tunneling
  @tunneling
end

.tunneling=(state) ⇒ Object



194
195
196
# File 'lib/testcentricity_web/environment.rb', line 194

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