# 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.8.6. [TC-MEDIAPLAYBACK-6.7] Optional Media Playback Verification (DUT as
    Client)

PICS:
    - MEDIAPLAYBACK.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 Play command to TH"
      PICS: MEDIAPLAYBACK.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 mediaplayback  play 1 3
          ./chip-tv-casting-app mediaplayback  play 1 3


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

          [1658531093554] [21924:321344] CHIP: [DMG] InvokeRequestMessage =
          [1658531093554] [21924:321344] CHIP: [DMG] {
          [1658531093554] [21924:321344] CHIP: [DMG]         suppressResponse = false,
          [1658531093554] [21924:321344] CHIP: [DMG]         timedRequest = false,
          [1658531093554] [21924:321344] CHIP: [DMG]         InvokeRequests =
          [1658531093554] [21924:321344] CHIP: [DMG]         [
          [1658531093554] [21924:321344] CHIP: [DMG]                 CommandDataIB =
          [1658531093554] [21924:321344] CHIP: [DMG]                 {
          [1658531093554] [21924:321344] CHIP: [DMG]                         CommandPathIB =
          [1658531093554] [21924:321344] CHIP: [DMG]                         {
          [1658531093554] [21924:321344] CHIP: [DMG]                                 EndpointId = 0x3,
          [1658531093554] [21924:321344] CHIP: [DMG]                                 ClusterId = 0x506,
          [1658531093554] [21924:321344] CHIP: [DMG]                                 CommandId = 0x0,
          [1658531093554] [21924:321344] CHIP: [DMG]                         },
          [1658531093554] [21924:321344] CHIP: [DMG]
          [1658531093554] [21924:321344] CHIP: [DMG]                         CommandFields =
          [1658531093554] [21924:321344] CHIP: [DMG]                         {
          [1658531093554] [21924:321344] CHIP: [DMG]                         },
          [1658531093554] [21924:321344] CHIP: [DMG]                 },
          [1658531093554] [21924:321344] CHIP: [DMG]
          [1658531093554] [21924:321344] CHIP: [DMG]         ],
          [1658531093554] [21924:321344] CHIP: [DMG]
          [1658531093554] [21924:321344] CHIP: [DMG]         InteractionModelRevision = 1
          [1658531093554] [21924:321344] CHIP: [DMG] },
      disabled: true

    - label: "Step 2: DUT sends StartOver command to TH"
      PICS: MEDIAPLAYBACK.C.C03.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 mediaplayback start-over 1 3
          ./chip-tv-casting-app mediaplayback start-over 1 3

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

          [1658531129608] [21924:322334] CHIP: [DMG] InvokeRequestMessage =
          [1658531129608] [21924:322334] CHIP: [DMG] {
          [1658531129608] [21924:322334] CHIP: [DMG]         suppressResponse = false,
          [1658531129608] [21924:322334] CHIP: [DMG]         timedRequest = false,
          [1658531129608] [21924:322334] CHIP: [DMG]         InvokeRequests =
          [1658531129608] [21924:322334] CHIP: [DMG]         [
          [1658531129608] [21924:322334] CHIP: [DMG]                 CommandDataIB =
          [1658531129608] [21924:322334] CHIP: [DMG]                 {
          [1658531129608] [21924:322334] CHIP: [DMG]                         CommandPathIB =
          [1658531129608] [21924:322334] CHIP: [DMG]                         {
          [1658531129608] [21924:322334] CHIP: [DMG]                                 EndpointId = 0x3,
          [1658531129608] [21924:322334] CHIP: [DMG]                                 ClusterId = 0x506,
          [1658531129608] [21924:322334] CHIP: [DMG]                                 CommandId = 0x3,
          [1658531129608] [21924:322334] CHIP: [DMG]                         },
          [1658531129608] [21924:322334] CHIP: [DMG]
          [1658531129608] [21924:322334] CHIP: [DMG]                         CommandFields =
          [1658531129608] [21924:322334] CHIP: [DMG]                         {
          [1658531129608] [21924:322334] CHIP: [DMG]                         },
          [1658531129608] [21924:322334] CHIP: [DMG]                 },
          [1658531129608] [21924:322334] CHIP: [DMG]
          [1658531129608] [21924:322334] CHIP: [DMG]         ],
          [1658531129609] [21924:322334] CHIP: [DMG]
          [1658531129609] [21924:322334] CHIP: [DMG]         InteractionModelRevision = 1
          [1658531129609] [21924:322334] CHIP: [DMG] },
      disabled: true

    - label: "Step 3: DUT sends Next command to TH"
      PICS: MEDIAPLAYBACK.C.C05.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 mediaplayback  next 1 3
          ./chip-tv-casting-app mediaplayback  next 1 3

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

          [1658531176900] [21924:322847] CHIP: [DMG] InvokeRequestMessage =
          [1658531176900] [21924:322847] CHIP: [DMG] {
          [1658531176900] [21924:322847] CHIP: [DMG]         suppressResponse = false,
          [1658531176900] [21924:322847] CHIP: [DMG]         timedRequest = false,
          [1658531176900] [21924:322847] CHIP: [DMG]         InvokeRequests =
          [1658531176900] [21924:322847] CHIP: [DMG]         [
          [1658531176900] [21924:322847] CHIP: [DMG]                 CommandDataIB =
          [1658531176900] [21924:322847] CHIP: [DMG]                 {
          [1658531176900] [21924:322847] CHIP: [DMG]                         CommandPathIB =
          [1658531176900] [21924:322847] CHIP: [DMG]                         {
          [1658531176900] [21924:322847] CHIP: [DMG]                                 EndpointId = 0x3,
          [1658531176900] [21924:322847] CHIP: [DMG]                                 ClusterId = 0x506,
          [1658531176900] [21924:322847] CHIP: [DMG]                                 CommandId = 0x5,
          [1658531176900] [21924:322847] CHIP: [DMG]                         },
          [1658531176900] [21924:322847] CHIP: [DMG]
          [1658531176900] [21924:322847] CHIP: [DMG]                         CommandFields =
          [1658531176900] [21924:322847] CHIP: [DMG]                         {
          [1658531176900] [21924:322847] CHIP: [DMG]                         },
          [1658531176900] [21924:322847] CHIP: [DMG]                 },
          [1658531176900] [21924:322847] CHIP: [DMG]
          [1658531176900] [21924:322847] CHIP: [DMG]         ],
          [1658531176900] [21924:322847] CHIP: [DMG]
          [1658531176900] [21924:322847] CHIP: [DMG]         InteractionModelRevision = 1
          [1658531176900] [21924:322847] CHIP: [DMG] },
      disabled: true

    - label: "Step 4: DUT sends Previous command to TH"
      PICS: MEDIAPLAYBACK.C.C04.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 mediaplayback  previous 1 3
          ./chip-tv-casting-app mediaplayback  previous 1 3


          The log below shows the resulting log on the TH (tv-app or all-clusters-app):

          [1658531212499] [21924:323521] CHIP: [DMG] InvokeRequestMessage =
          [1658531212499] [21924:323521] CHIP: [DMG] {
          [1658531212499] [21924:323521] CHIP: [DMG]         suppressResponse = false,
          [1658531212499] [21924:323521] CHIP: [DMG]         timedRequest = false,
          [1658531212499] [21924:323521] CHIP: [DMG]         InvokeRequests =
          [1658531212499] [21924:323521] CHIP: [DMG]         [
          [1658531212499] [21924:323521] CHIP: [DMG]                 CommandDataIB =
          [1658531212499] [21924:323521] CHIP: [DMG]                 {
          [1658531212499] [21924:323521] CHIP: [DMG]                         CommandPathIB =
          [1658531212499] [21924:323521] CHIP: [DMG]                         {
          [1658531212499] [21924:323521] CHIP: [DMG]                                 EndpointId = 0x3,
          [1658531212499] [21924:323521] CHIP: [DMG]                                 ClusterId = 0x506,
          [1658531212499] [21924:323521] CHIP: [DMG]                                 CommandId = 0x4,
          [1658531212499] [21924:323521] CHIP: [DMG]                         },
          [1658531212499] [21924:323521] CHIP: [DMG]
          [1658531212499] [21924:323521] CHIP: [DMG]                         CommandFields =
          [1658531212499] [21924:323521] CHIP: [DMG]                         {
          [1658531212499] [21924:323521] CHIP: [DMG]                         },
          [1658531212499] [21924:323521] CHIP: [DMG]                 },
          [1658531212499] [21924:323521] CHIP: [DMG]
          [1658531212499] [21924:323521] CHIP: [DMG]         ],
          [1658531212499] [21924:323521] CHIP: [DMG]
          [1658531212499] [21924:323521] CHIP: [DMG]         InteractionModelRevision = 1
          [1658531212499] [21924:323521] CHIP: [DMG] },
      disabled: true

    - label: "Step 5: DUT sends SkipForward command to TH"
      PICS: MEDIAPLAYBACK.C.C08.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 mediaplayback skip-forward 10000 1 3
          ./chip-tv-casting-app mediaplayback skip-forward 10000 1 3

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

          [1658531247634] [21924:323905] CHIP: [DMG] InvokeRequestMessage =
          [1658531247634] [21924:323905] CHIP: [DMG] {
          [1658531247634] [21924:323905] CHIP: [DMG]         suppressResponse = false,
          [1658531247634] [21924:323905] CHIP: [DMG]         timedRequest = false,
          [1658531247634] [21924:323905] CHIP: [DMG]         InvokeRequests =
          [1658531247634] [21924:323905] CHIP: [DMG]         [
          [1658531247634] [21924:323905] CHIP: [DMG]                 CommandDataIB =
          [1658531247634] [21924:323905] CHIP: [DMG]                 {
          [1658531247634] [21924:323905] CHIP: [DMG]                         CommandPathIB =
          [1658531247634] [21924:323905] CHIP: [DMG]                         {
          [1658531247634] [21924:323905] CHIP: [DMG]                                 EndpointId = 0x3,
          [1658531247634] [21924:323905] CHIP: [DMG]                                 ClusterId = 0x506,
          [1658531247634] [21924:323905] CHIP: [DMG]                                 CommandId = 0x8,
          [1658531247634] [21924:323905] CHIP: [DMG]                         },
          [1658531247634] [21924:323905] CHIP: [DMG]
          [1658531247635] [21924:323905] CHIP: [DMG]                         CommandFields =
          [1658531247635] [21924:323905] CHIP: [DMG]                         {
          [1658531247635] [21924:323905] CHIP: [DMG]                                 0x0 = 10000,
          [1658531247635] [21924:323905] CHIP: [DMG]                         },
          [1658531247635] [21924:323905] CHIP: [DMG]                 },
          [1658531247635] [21924:323905] CHIP: [DMG]
          [1658531247635] [21924:323905] CHIP: [DMG]         ],
          [1658531247635] [21924:323905] CHIP: [DMG]
          [1658531247635] [21924:323905] CHIP: [DMG]         InteractionModelRevision = 1
          [1658531247635] [21924:323905] CHIP: [DMG] },
      disabled: true

    - label: "Step 6: DUT sends SkipBackward command to TH"
      PICS: MEDIAPLAYBACK.C.C09.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 mediaplayback skip-backward 10000 1 3
          ./chip-tv-casting-app mediaplayback skip-backward 10000 1 3


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

          [1658531281369] [21924:323905] CHIP: [DMG] InvokeRequestMessage =
          [1658531281369] [21924:323905] CHIP: [DMG] {
          [1658531281369] [21924:323905] CHIP: [DMG]         suppressResponse = false,
          [1658531281369] [21924:323905] CHIP: [DMG]         timedRequest = false,
          [1658531281369] [21924:323905] CHIP: [DMG]         InvokeRequests =
          [1658531281369] [21924:323905] CHIP: [DMG]         [
          [1658531281369] [21924:323905] CHIP: [DMG]                 CommandDataIB =
          [1658531281369] [21924:323905] CHIP: [DMG]                 {
          [1658531281369] [21924:323905] CHIP: [DMG]                         CommandPathIB =
          [1658531281369] [21924:323905] CHIP: [DMG]                         {
          [1658531281369] [21924:323905] CHIP: [DMG]                                 EndpointId = 0x3,
          [1658531281369] [21924:323905] CHIP: [DMG]                                 ClusterId = 0x506,
          [1658531281369] [21924:323905] CHIP: [DMG]                                 CommandId = 0x9,
          [1658531281369] [21924:323905] CHIP: [DMG]                         },
          [1658531281369] [21924:323905] CHIP: [DMG]
          [1658531281369] [21924:323905] CHIP: [DMG]                         CommandFields =
          [1658531281369] [21924:323905] CHIP: [DMG]                         {
          [1658531281369] [21924:323905] CHIP: [DMG]                                 0x0 = 10000,
          [1658531281369] [21924:323905] CHIP: [DMG]                         },
          [1658531281369] [21924:323905] CHIP: [DMG]                 },
          [1658531281369] [21924:323905] CHIP: [DMG]
          [1658531281369] [21924:323905] CHIP: [DMG]         ],
          [1658531281369] [21924:323905] CHIP: [DMG]
          [1658531281369] [21924:323905] CHIP: [DMG]         InteractionModelRevision = 1
          [1658531281369] [21924:323905] CHIP: [DMG] },
      disabled: true
