# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default

name:
    3.4.4. [TC-APPLAUNCHER-3.7.1] Launch Application Verification (DUT as
    Client)

PICS:
    - APPLAUNCHER.C

config:
    nodeId: 0x12344321
    cluster: "Basic Information"
    endpoint: 0

tests:
    - label: "Preconditions:"
      verification: |
          Commission TH to DUT, if not done so already. In some cases, such as with a Casting Video Player, the TH commissions the DUT.
      disabled: true

    - label: "Step 1: DUT sends LaunchApp command to TH"
      PICS: APPLAUNCHER.C.C00.Tx
      verification: |
          Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner) or tv-casting-app (when DUT is a commissionee):

          ./chip-tool applicationlauncher launch-app  1 1 --Application '{"catalogVendorID": 123, "applicationID": "exampleid"}'

          ./chip-tv-casting-app applicationlauncher launch-app  1 1 --Application '{"catalogVendorID": 123, "applicationID": "exampleid"}'

          On TH (tv-app), Verify the launch app command is received successfully.

          [1674562560.376993][12550:12550] CHIP:EM: Handling via exchange: 22201r, Delegate: 0x5572d99d2b08
          [1674562560.377026][12550:12550] CHIP:DMG: InvokeRequestMessage =
          [1674562560.377033][12550:12550] CHIP:DMG: {
          [1674562560.377040][12550:12550] CHIP:DMG:         suppressResponse = false,
          [1674562560.377049][12550:12550] CHIP:DMG:         timedRequest = false,
          [1674562560.377056][12550:12550] CHIP:DMG:         InvokeRequests =
          [1674562560.377068][12550:12550] CHIP:DMG:         [
          [1674562560.377075][12550:12550] CHIP:DMG:                 CommandDataIB =
          [1674562560.377083][12550:12550] CHIP:DMG:                 {
          [1674562560.377090][12550:12550] CHIP:DMG:                         CommandPathIB =
          [1674562560.377098][12550:12550] CHIP:DMG:                         {
          [1674562560.377107][12550:12550] CHIP:DMG:                                 EndpointId = 0x1,
          [1674562560.377115][12550:12550] CHIP:DMG:                                 ClusterId = 0x50c,
          [1674562560.377122][12550:12550] CHIP:DMG:                                 CommandId = 0x0,
          [1674562560.377130][12550:12550] CHIP:DMG:                         },
          [1674562560.377139][12550:12550] CHIP:DMG:
          [1674562560.377146][12550:12550] CHIP:DMG:                         CommandFields =
          [1674562560.377154][12550:12550] CHIP:DMG:                         {
          [1674562560.377161][12550:12550] CHIP:DMG:                                 0x0 =
          [1674562560.377169][12550:12550] CHIP:DMG:                                 {
          [1674562560.377178][12550:12550] CHIP:DMG:                                         0x0 = 123,
          [1674562560.377188][12550:12550] CHIP:DMG:                                         0x1 = "exampleid" (9 chars),
          [1674562560.377196][12550:12550] CHIP:DMG:                                 },
          [1674562560.377204][12550:12550] CHIP:DMG:                         },
          [1674562560.377211][12550:12550] CHIP:DMG:                 },
          [1674562560.377222][12550:12550] CHIP:DMG:
          [1674562560.377228][12550:12550] CHIP:DMG:         ],
          [1674562560.377240][12550:12550] CHIP:DMG:
          [1674562560.377247][12550:12550] CHIP:DMG:         InteractionModelRevision = 1
          [1674562560.377253][12550:12550] CHIP:DMG: },
          [1674562560.377285][12550:12550] CHIP:DMG: AccessControl: checking f=2 a=c s=0x000000000001B669 t= c=0x0000_050C e=1 p=o

          Refer to device or application documentation for special argument values to each command, and/or additional steps required to put device into in correct state to exhibit test behavior.
      disabled: true
