class TestCentricity::Environ

Attributes

a11y_standard[RW]
api_key[RW]
app_id[RW]
append[RW]
base_url[RW]
browser[RW]
browser_size[RW]
db_password[RW]
db_username[RW]
device[RW]
device_name[RW]
device_orientation[RW]
device_os[RW]
device_os_version[RW]
device_type[RW]
dns[RW]
driver[RW]
external_page[RW]
grid[RW]
headless[RW]
hostname[RW]
language[RW]
locale[RW]
option1[RW]
option2[RW]
option3[RW]
option4[RW]
os[RW]
parallel[RW]
password[RW]
platform[RW]
portal_context[RW]
portal_status[RW]
process_num[RW]
protocol[RW]
session_code[RW]
session_state[RW]
signed_in[RW]
test_environment[RW]
tunneling[RW]
user_id[RW]

Public Class Methods

browser() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 165
def self.browser
  @browser
end
browser=(browser) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 161
def self.browser=(browser)
  @browser = browser.downcase.to_sym
end
browser_size() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 173
def self.browser_size
  @browser_size
end
browser_size=(size) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 169
def self.browser_size=(size)
  @browser_size = size
end
device() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 205
def self.device
  @device
end
device=(device) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 201
def self.device=(device)
  @device = device
end
device_name() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 233
def self.device_name
  @device_name
end
device_name=(name) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 229
def self.device_name=(name)
  @device_name = name
end
device_orientation() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 265
def self.device_orientation
  @device_orientation
end
device_orientation=(orientation) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 261
def self.device_orientation=(orientation)
  @device_orientation = orientation.downcase.to_sym
end
device_os() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 241
def self.device_os
  @device_os
end
device_os=(os) click to toggle source
# 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() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 249
def self.device_os_version
  @device_os_version
end
device_os_version=(version) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 245
def self.device_os_version=(version)
  @device_os_version = version
end
device_type() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 225
def self.device_type
  @device_type
end
device_type=(type) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 221
def self.device_type=(type)
  @device_type = type.downcase.to_sym
end
driver() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 273
def self.driver
  @driver
end
driver=(type) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 269
def self.driver=(type)
  @driver = type
end
external_page() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 349
def self.external_page
  @external_page
end
get_screen_shots() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 357
def self.get_screen_shots
  @screen_shots
end
grid() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 281
def self.grid
  @grid
end
grid=(type) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 277
def self.grid=(type)
  @grid = type
end
headless() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 181
def self.headless
  @headless
end
headless=(state) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 177
def self.headless=(state)
  @headless = state
end
is_android?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 257
def self.is_android?
  @device_os == :android
end
is_desktop?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 317
def self.is_desktop?
  @platform == :desktop
end
is_device?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 209
def self.is_device?
  @device == :device
end
is_ios?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 253
def self.is_ios?
  @device_os == :ios
end
is_mobile?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 313
def self.is_mobile?
  @platform == :mobile
end
is_signed_in?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 325
def self.is_signed_in?
  @signed_in
end
is_simulator?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 213
def self.is_simulator?
  @device == :simulator
end
is_web?() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 217
def self.is_web?
  @device == :web
end
language() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 297
def self.language
  @language
end
language=(language) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 293
def self.language=(language)
  @language = language
end
locale() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 305
def self.locale
  @locale
end
locale=(locale) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 301
def self.locale=(locale)
  @locale = locale
end
new(data) click to toggle source
Calls superclass method TestCentricity::DataObject::new
# 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
os() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 197
def self.os
  @os
end
os=(os) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 193
def self.os=(os)
  @os = os
end
parallel() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 141
def self.parallel
  @parallel
end
parallel=(state) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 137
def self.parallel=(state)
  @parallel = state
end
platform=(platform) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 309
def self.platform=(platform)
  @platform = platform
end
portal_context() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 341
def self.portal_context
  @portal_context
end
portal_context=(portal_context) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 337
def self.portal_context=(portal_context)
  @portal_context = portal_context
end
portal_state() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 333
def self.portal_state
  @portal_status
end
portal_state=(portal_state) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 329
def self.portal_state=(portal_state)
  @portal_status = portal_state
end
process_num() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 149
def self.process_num
  @process_num
end
process_num=(num) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 145
def self.process_num=(num)
  @process_num = num
end
report_header() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 365
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} #{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>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 #{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 = "#{report_header}  <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
  "#{report_header}\n\n"
end
reset_contexts() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 361
def self.reset_contexts
  @screen_shots = []
end
save_screen_shot(screen_shot) click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 129
def self.session_id
  @session_id
end
session_state() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 189
def self.session_state
  @session_state
end
session_state=(session_state) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 185
def self.session_state=(session_state)
  @session_state = session_state
end
session_time_stamp() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 133
def self.session_time_stamp
  @session_time_stamp
end
set_external_page(state) click to toggle source
# 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) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 321
def self.set_signed_in(signed_in)
  @signed_in = signed_in
end
test_environment() click to toggle source
# 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() click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 289
def self.tunneling
  @tunneling
end
tunneling=(state) click to toggle source
# File lib/testcentricity_web/data_objects/environment.rb, line 285
def self.tunneling=(state)
  @tunneling = state
end