Specifications:

  • Traffic Light Controller Traffic Situation is read with S0015

    Verify status S0015 current traffic situation

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    11
    12
    13
    14
    15
    16
    17
    18
    # File 'spec/site/tlc/traffic_situations_spec.rb', line 11
    
    Validator::Site.connected do |task,supervisor,site|
            if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' )
              status_list = { S0015: [:status,:source] }
            else
              status_list = { S0015: [:status] }
            end
            request_status_and_confirm site, "current traffic situation", status_list
          end
  • Traffic Light Controller Traffic Situation is set with M0003

    Verify that we change traffic situation

    1. Given the site is connected

    2. Verify that there is a Validator.get_config(‘validator’) with a traffic situation

    3. Send the control command to switch traffic situation for each traffic situation

    4. Wait for status “Current traffic situation” = requested traffic situation

    
    
    28
    29
    30
    31
    32
    33
    34
    35
    # File 'spec/site/tlc/traffic_situations_spec.rb', line 28
    
    situations = Validator.get_config('items','traffic_situations')
          skip("No traffic situations configured") if situations.nil? || situations.empty?
          Validator::Site.connected do |task,supervisor,site|
            prepare task, site
            situations.each { |traffic_situation| switch_traffic_situation traffic_situation.to_s }
          ensure
            unset_traffic_situation
          end
  • Traffic Light Controller Traffic Situation list size is read with S0019

    Verify status S0019 number of traffic situations

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    44
    45
    46
    47
    # File 'spec/site/tlc/traffic_situations_spec.rb', line 44
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "number of traffic situations",
              { S0019: [:number] }
          end