Class: PassportMonitor

Inherits:
BaseMonitor show all
Defined in:
lib/test_case/monitoring/passport_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_live_video?, #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_tv?Boolean

Returns:

  • (Boolean)


46
47
48
49
# File 'lib/test_case/monitoring/passport_monitor.rb', line 46

def check_live_tv?
  report_parental_controls(parental_control)
  super
end

#check_menuObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/test_case/monitoring/passport_monitor.rb', line 20

def check_menu
  #Sara vs Passport check
  channel_guide = dut.roi.text.new(:x => 362, :y => 498, :width => 194, :height => 62, :similarity => 70, :text => 'CHANNEL', :only_digits => false, :ref_img => "")
  channel_guide_roi = roi_resolution(channel_guide, dut.height, dut.width)
  dut.press_key('exit', :sleep_time=>2.sec)
  set_err_result(@health_hash, 'This is a Sara platform not Passport', 'P3.1') if channel_guide_roi.wait_until_displayed?(10000, key: 'menu')

  #passport check
  passport_main_menu = roi_resolution(passport_menu, dut.height, dut.width)
  tries = 0
  dut.press_key('exit', :sleep_time=>2.sec)
  dut.press_key('menu', :sleep_time=>2.sec)
  until passport_main_menu.displayed?(timeout:2000) || tries == 7 do
    dut.press_key('right_arrow', :sleep_time=>1.sec)
    tries += 1
  end

  set_err_result(@health_hash, 'Unable to nav to menu. Check platform or device health', 'P3.2') if tries == 7
  # Lots of errors reported due to wrong plat rather than device issue.
end

#find_macObject



41
42
43
44
# File 'lib/test_case/monitoring/passport_monitor.rb', line 41

def find_mac
  dut.press_key('exit', :sleep_time=>2.sec)
  {} #do nothing for now just return empty hash (no mac info just exit out of guide)
end

#parental_controlObject



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

def parental_control
  roi_resolution(dut.roi.text.new(:x => 788, :y => 686, :width => 408, :height => 90, :similarity => 70, :text => 'Disable Parental Control', :only_digits => false, :ref_img => ""),
                 dut.height, dut.width)
end

#passport_guideObject



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

def passport_guide
  dut.roi.color.new(:x => 328, :y => 948, :width => 102, :height => 102, :similarity => 90, 
                    :rgb => [188, 190, 188], :ref_img => "")
end

#passport_menuObject



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

def passport_menu
  dut.roi.text.new(:x => 412, :y => 280, :width => 142, :height => 54, :similarity => 70,
                      text: 'Menu', only_digits: false, ref_img: '')
end