Class: TestCentricity::Environ
- Defined in:
- lib/testcentricity_web/data_objects/environment.rb
Instance Attribute Summary collapse
-
#append ⇒ Object
Returns the value of attribute append.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#browser_size ⇒ Object
Returns the value of attribute browser_size.
-
#db_password ⇒ Object
Returns the value of attribute db_password.
-
#db_username ⇒ Object
Returns the value of attribute db_username.
-
#device ⇒ Object
Returns the value of attribute device.
-
#device_name ⇒ Object
Returns the value of attribute device_name.
-
#device_orientation ⇒ Object
Returns the value of attribute device_orientation.
-
#device_os ⇒ Object
Returns the value of attribute device_os.
-
#device_type ⇒ Object
Returns the value of attribute device_type.
-
#dns ⇒ Object
Returns the value of attribute dns.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#external_page ⇒ Object
Returns the value of attribute external_page.
-
#grid ⇒ Object
Returns the value of attribute grid.
-
#headless ⇒ Object
Returns the value of attribute headless.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#option1 ⇒ Object
Returns the value of attribute option1.
-
#option2 ⇒ Object
Returns the value of attribute option2.
-
#os ⇒ Object
Returns the value of attribute os.
-
#password ⇒ Object
Returns the value of attribute password.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#portal_context ⇒ Object
Returns the value of attribute portal_context.
-
#portal_status ⇒ Object
Returns the value of attribute portal_status.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#session_state ⇒ Object
Returns the value of attribute session_state.
-
#signed_in ⇒ Object
Returns the value of attribute signed_in.
-
#test_environment ⇒ Object
Returns the value of attribute test_environment.
-
#tunneling ⇒ Object
Returns the value of attribute tunneling.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Class Method Summary collapse
- .browser ⇒ Object
- .browser=(browser) ⇒ Object
- .browser_size ⇒ Object
- .browser_size=(size) ⇒ Object
- .device ⇒ Object
- .device=(device) ⇒ Object
- .device_name ⇒ Object
- .device_name=(name) ⇒ Object
- .device_orientation ⇒ Object
- .device_orientation=(orientation) ⇒ Object
- .device_os ⇒ Object
- .device_os=(os) ⇒ Object
- .device_type ⇒ Object
- .device_type=(type) ⇒ Object
- .driver ⇒ Object
- .driver=(type) ⇒ Object
- .external_page ⇒ Object
- .get_screen_shots ⇒ Object
- .grid ⇒ Object
- .grid=(type) ⇒ Object
- .headless ⇒ Object
- .headless=(state) ⇒ Object
- .is_android? ⇒ Boolean
- .is_desktop? ⇒ Boolean
- .is_device? ⇒ Boolean
- .is_ios? ⇒ Boolean
- .is_mobile? ⇒ Boolean
- .is_signed_in? ⇒ Boolean
- .is_simulator? ⇒ Boolean
- .is_web? ⇒ Boolean
- .os ⇒ Object
- .os=(os) ⇒ Object
- .platform=(platform) ⇒ Object
- .portal_context ⇒ Object
- .portal_context=(portal_context) ⇒ Object
- .portal_state ⇒ Object
- .portal_state=(portal_state) ⇒ Object
- .report_header ⇒ Object
- .reset_contexts ⇒ Object
- .save_screen_shot(screen_shot) ⇒ Object
- .session_code ⇒ Object
- .session_id ⇒ Object
- .session_state ⇒ Object
- .session_state=(session_state) ⇒ Object
- .session_time_stamp ⇒ Object
- .set_external_page(state) ⇒ Object
- .set_signed_in(signed_in) ⇒ Object
- .test_environment ⇒ Object
- .tunneling ⇒ Object
- .tunneling=(state) ⇒ Object
Instance Method Summary collapse
-
#initialize(data) ⇒ Environ
constructor
A new instance of Environ.
Constructor Details
#initialize(data) ⇒ Environ
Returns a new instance of Environ.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 62 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.
55 56 57 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 55 def append @append end |
#base_url ⇒ Object
Returns the value of attribute base_url.
52 53 54 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 52 def base_url @base_url end |
#browser ⇒ Object
Returns the value of attribute browser.
30 31 32 |
# File 'lib/testcentricity_web/data_objects/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/data_objects/environment.rb', line 31 def browser_size @browser_size end |
#db_password ⇒ Object
Returns the value of attribute db_password.
60 61 62 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 60 def db_password @db_password end |
#db_username ⇒ Object
Returns the value of attribute db_username.
59 60 61 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 59 def db_username @db_username end |
#device ⇒ Object
Returns the value of attribute device.
35 36 37 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 35 def device @device end |
#device_name ⇒ Object
Returns the value of attribute device_name.
36 37 38 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 36 def device_name @device_name end |
#device_orientation ⇒ Object
Returns the value of attribute device_orientation.
39 40 41 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 39 def device_orientation @device_orientation end |
#device_os ⇒ Object
Returns the value of attribute device_os.
38 39 40 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 38 def device_os @device_os end |
#device_type ⇒ Object
Returns the value of attribute device_type.
37 38 39 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 37 def device_type @device_type end |
#dns ⇒ Object
Returns the value of attribute dns.
58 59 60 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 58 def dns @dns end |
#driver ⇒ Object
Returns the value of attribute driver.
41 42 43 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 41 def driver @driver end |
#external_page ⇒ Object
Returns the value of attribute external_page.
48 49 50 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 48 def external_page @external_page end |
#grid ⇒ Object
Returns the value of attribute grid.
42 43 44 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 42 def grid @grid end |
#headless ⇒ Object
Returns the value of attribute headless.
32 33 34 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 32 def headless @headless end |
#hostname ⇒ Object
Returns the value of attribute hostname.
51 52 53 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 51 def hostname @hostname end |
#option1 ⇒ Object
Returns the value of attribute option1.
56 57 58 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 56 def option1 @option1 end |
#option2 ⇒ Object
Returns the value of attribute option2.
57 58 59 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 57 def option2 @option2 end |
#os ⇒ Object
Returns the value of attribute os.
34 35 36 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 34 def os @os end |
#password ⇒ Object
Returns the value of attribute password.
54 55 56 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 54 def password @password end |
#platform ⇒ Object
Returns the value of attribute platform.
40 41 42 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 40 def platform @platform end |
#portal_context ⇒ Object
Returns the value of attribute portal_context.
47 48 49 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 47 def portal_context @portal_context end |
#portal_status ⇒ Object
Returns the value of attribute portal_status.
46 47 48 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 46 def portal_status @portal_status end |
#protocol ⇒ Object
Returns the value of attribute protocol.
50 51 52 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 50 def protocol @protocol end |
#session_state ⇒ Object
Returns the value of attribute session_state.
33 34 35 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 33 def session_state @session_state end |
#signed_in ⇒ Object
Returns the value of attribute signed_in.
45 46 47 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 45 def signed_in @signed_in end |
#test_environment ⇒ Object
Returns the value of attribute test_environment.
29 30 31 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 29 def test_environment @test_environment end |
#tunneling ⇒ Object
Returns the value of attribute tunneling.
43 44 45 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 43 def tunneling @tunneling end |
#user_id ⇒ Object
Returns the value of attribute user_id.
53 54 55 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 53 def user_id @user_id end |
Class Method Details
.browser ⇒ Object
105 106 107 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 105 def self.browser @browser end |
.browser=(browser) ⇒ Object
101 102 103 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 101 def self.browser=(browser) @browser = browser.downcase.to_sym end |
.browser_size ⇒ Object
113 114 115 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 113 def self.browser_size @browser_size end |
.browser_size=(size) ⇒ Object
109 110 111 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 109 def self.browser_size=(size) @browser_size = size end |
.device ⇒ Object
145 146 147 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 145 def self.device @device end |
.device=(device) ⇒ Object
141 142 143 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 141 def self.device=(device) @device = device end |
.device_name ⇒ Object
173 174 175 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 173 def self.device_name @device_name end |
.device_name=(name) ⇒ Object
169 170 171 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 169 def self.device_name=(name) @device_name = name end |
.device_orientation ⇒ Object
197 198 199 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 197 def self.device_orientation @device_orientation end |
.device_orientation=(orientation) ⇒ Object
193 194 195 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 193 def self.device_orientation=(orientation) @device_orientation = orientation.downcase.to_sym end |
.device_os ⇒ Object
181 182 183 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 181 def self.device_os @device_os end |
.device_os=(os) ⇒ Object
177 178 179 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 177 def self.device_os=(os) @device_os = os.downcase.to_sym end |
.device_type ⇒ Object
165 166 167 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 165 def self.device_type @device_type end |
.device_type=(type) ⇒ Object
161 162 163 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 161 def self.device_type=(type) @device_type = type.downcase.to_sym end |
.driver ⇒ Object
205 206 207 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 205 def self.driver @driver end |
.driver=(type) ⇒ Object
201 202 203 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 201 def self.driver=(type) @driver = type end |
.external_page ⇒ Object
265 266 267 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 265 def self.external_page @external_page end |
.get_screen_shots ⇒ Object
273 274 275 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 273 def self.get_screen_shots @screen_shots end |
.grid ⇒ Object
213 214 215 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 213 def self.grid @grid end |
.grid=(type) ⇒ Object
209 210 211 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 209 def self.grid=(type) @grid = type end |
.headless ⇒ Object
121 122 123 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 121 def self.headless @headless end |
.headless=(state) ⇒ Object
117 118 119 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 117 def self.headless=(state) @headless = state end |
.is_android? ⇒ Boolean
189 190 191 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 189 def self.is_android? @device_os == :android end |
.is_desktop? ⇒ Boolean
233 234 235 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 233 def self.is_desktop? @platform == :desktop end |
.is_device? ⇒ Boolean
149 150 151 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 149 def self.is_device? @device == :device end |
.is_ios? ⇒ Boolean
185 186 187 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 185 def self.is_ios? @device_os == :ios end |
.is_mobile? ⇒ Boolean
229 230 231 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 229 def self.is_mobile? @platform == :mobile end |
.is_signed_in? ⇒ Boolean
241 242 243 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 241 def self.is_signed_in? @signed_in end |
.is_simulator? ⇒ Boolean
153 154 155 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 153 def self.is_simulator? @device == :simulator end |
.is_web? ⇒ Boolean
157 158 159 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 157 def self.is_web? @device == :web end |
.os ⇒ Object
137 138 139 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 137 def self.os @os end |
.os=(os) ⇒ Object
133 134 135 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 133 def self.os=(os) @os = os end |
.platform=(platform) ⇒ Object
225 226 227 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 225 def self.platform=(platform) @platform = platform end |
.portal_context ⇒ Object
257 258 259 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 257 def self.portal_context @portal_context end |
.portal_context=(portal_context) ⇒ Object
253 254 255 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 253 def self.portal_context=(portal_context) @portal_context = portal_context end |
.portal_state ⇒ Object
249 250 251 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 249 def self.portal_state @portal_status end |
.portal_state=(portal_state) ⇒ Object
245 246 247 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 245 def self.portal_state=(portal_state) @portal_status = portal_state end |
.report_header ⇒ Object
281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 281 def self.report_header report_header = "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"\ " <b>Browser:</b>\t #{Environ.browser.capitalize}\n" report_header = "#{report_header} <b>Device:</b>\t\t #{Environ.device_name}\n" if Environ.device_name report_header = "#{report_header} <b>Device OS:</b>\t #{Environ.device_os}\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>Driver:</b>\t\t #{Environ.driver}\n" if Environ.driver report_header = "#{report_header} <b>Grid:</b>\t\t #{Environ.grid}\n" if Environ.grid report_header = "#{report_header} <b>OS:</b>\t\t\t #{Environ.os}\n" if Environ.os report_header = "#{report_header} <b>Locale:</b>\t\t #{ENV['LOCALE']}\n" if ENV['LOCALE'] report_header = "#{report_header} <b>Language:</b>\t #{ENV['LANGUAGE']}\n" if ENV['LANGUAGE'] report_header = "#{report_header} <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY'] "#{report_header}\n\n" end |
.reset_contexts ⇒ Object
277 278 279 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 277 def self.reset_contexts @screen_shots = [] end |
.save_screen_shot(screen_shot) ⇒ Object
269 270 271 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 269 def self.save_screen_shot(screen_shot) @screen_shots.push(screen_shot) end |
.session_code ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 77 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
85 86 87 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 85 def self.session_id @session_id end |
.session_state ⇒ Object
129 130 131 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 129 def self.session_state @session_state end |
.session_state=(session_state) ⇒ Object
125 126 127 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 125 def self.session_state=(session_state) @session_state = session_state end |
.session_time_stamp ⇒ Object
89 90 91 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 89 def self.session_time_stamp @session_time_stamp end |
.set_external_page(state) ⇒ Object
261 262 263 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 261 def self.set_external_page(state) @external_page = state end |
.set_signed_in(signed_in) ⇒ Object
237 238 239 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 237 def self.set_signed_in(signed_in) @signed_in = signed_in end |
.test_environment ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 93 def self.test_environment if @test_environment.blank? nil else @test_environment.downcase.to_sym end end |
.tunneling ⇒ Object
221 222 223 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 221 def self.tunneling @tunneling end |
.tunneling=(state) ⇒ Object
217 218 219 |
# File 'lib/testcentricity_web/data_objects/environment.rb', line 217 def self.tunneling=(state) @tunneling = state end |