Class: IguideMonitor

Inherits:
BaseMonitor show all
Defined in:
lib/test_case/monitoring/iguide_monitor.rb

Overview

This class should be included in the MonitoringTest module

Instance Attribute Summary

Attributes inherited from BaseMonitor

#health_hash, #host, #id, #identity, #iteration, #job, #logger, #ssh, #start_time, #status, #stop_time

Instance Method Summary collapse

Methods inherited from BaseMonitor

#black_screen_roi, #check_black_screen, #check_health, #check_platform, #check_power, #dut, #initialize, #no_input_roi, #report_parental_controls, #server_name

Methods included from TmcHelpers

#aws_config, #aws_create_s3_bucket, #aws_delete_s3, #aws_delete_s3_bucket, #aws_read_s3, #aws_upload_s3, #aws_write_s3, #get_clean_ocr_text, #get_readable_size, #get_readable_time, #get_string_similarity, #get_substring_similarity, #is_rating?, #is_year?, #jsonify, #pick_random, #rubify, #send_webex_alert, #to_camel_case, #to_pascal_case, #to_snake_case, #twb_case_exists?, #twb_get_case_instance_id, #twb_get_suite_instance_id, #twb_post_screenshot, #twb_post_screenshot!, #twb_post_suite, #twb_post_testcase, #twb_post_teststep, #twb_post_teststep!, #twb_prep_s3_screenshot, #twb_suite_exists?, #until_condition, #until_equals, #until_includes, #until_not_empty, #until_not_equals, #until_not_includes, #until_not_nil, #until_same, #web_delete, #web_get, #web_post, #web_put

Methods included from HttpHelper

#web_request

Methods included from CsvHelper

#csv_parse, #csv_read

Methods included from SshHelper

#ssh_to

Methods included from EmailHelper

#send_email, #send_email_setup

Methods included from SnmpHelper

#snmp_get, #snmp_set

Methods included from ReportMonitor

#assign_email_params?, #assign_test_params, #confirm_platform, #generate_email_msg, #invalid_report, #log_hash, #send_legacy_err_hash, #set_err_result, #sword_send_results, #take_screenshot

Methods included from RoiHelper

#roi_resolution

Constructor Details

This class inherits a constructor from BaseMonitor

Instance Method Details

#check_live_video?Boolean

Returns:

  • (Boolean)


68
69
70
71
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 68

def check_live_video?
  report_parental_controls(parental_lock)
  super
end

#check_menuObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 50

def check_menu
  # This ROI is set for the 1080 resolution
  menu_roi = roi_resolution(iguide_diagnostics, dut.height, dut.width)
  user_setting_roi = roi_resolution(user_setting, dut.height, dut.width)
  # if dut.has_power?
  # Device must be off to navigate to settings.
    dut.press_key('power', :sleep_time=>500)
    dut.press_key('select', :sleep_time=>2.sec)
    set_err_result(@health_hash, 'Unable to nav to menu. Check platform or device health', 'I3') unless menu_roi.displayed?
  #   12.times {dut.press_key('down_arrow', :sleep_time=>2.sec)}
    user_setting_roi.press_key_until_displayed?('down_arrow', presses: 19, try_every: 250)
    dut.press_key('select', :sleep_time=>2.sec)
    dut.press_key('down_arrow', :sleep_time=>2.sec)
    dut.press_key('down_arrow', :sleep_time=>2.sec)
  # end
  nil
end

#find_macObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 33

def find_mac
  # create instances of rois needed
  # set rois to correct res
  mac_roi = roi_resolution(iguide_mac, dut.height, dut.width)
  
  server_name_sub = server_name.gsub(" ", "")

  mac = mac_roi.retrieve.gsub(':', '')
  hw_type = dut.model
  @health_hash [:mac] = mac
  @health_hash [:model] = hw_type
  @health_hash [:screenshot_1] = take_screenshot

  dut.press_key("power", :sleep_time=>2.sec)
  dut.press_key("power", :sleep_time=>0)
end

#iguide_diagnosticsObject



15
16
17
18
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 15

def iguide_diagnostics
  dut.roi.text.new(x: 766, y: 60, width: 356, height: 74, similarity: 70, 
                    text: 'DIAGNOSTICS', only_digits: false, ref_img: "")
end

#iguide_hardware_typeObject



5
6
7
8
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 5

def iguide_hardware_type
  dut.roi.text.new(x: 1134, y: 632, width: 568, height: 58, similarity: 70, 
                    text: '', only_digits: false, ref_img: "")
end

#iguide_macObject



10
11
12
13
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 10

def iguide_mac
  dut.roi.text.new(x: 948, y: 174, width: 466, height: 54, similarity: 70, 
                    text: '', only_digits: false, ref_img: "")
end

#parental_lockObject



25
26
27
28
29
30
31
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 25

def parental_lock
  roi_resolution(dut.roi.text.new(:x => 836, :y => 420, 
                                  :width => 208, :height => 64, 
                                  :similarity => 70, :text => 'LOCKED', 
                                  :only_digits => false, :ref_img => ""),
                                  dut.height, dut.width)
end

#user_settingObject



20
21
22
23
# File 'lib/test_case/monitoring/iguide_monitor.rb', line 20

def user_setting
  dut.roi.text.new(x: 332, y: 730, width: 62, height: 44, similarity: 99, 
                    text: '>', only_digits: false, ref_img: "")
end