# Copyright (c) 2023 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: 263.1.2. [TC-DISHM-1.2] Cluster attributes with DUT as Server

PICS:
    - DISHM.S

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

tests:
    - label:
          "Step 1: Commission DUT to TH (can be skipped if done in a preceding
          test)."
      verification: |

      disabled: true

    - label: "Step 2: TH reads from the DUT the SupportedModes attribute."
      PICS: DISHM.S.A0000
      verification: |
          ./chip-tool dishwashermode read supported-modes 1 1

            Verify that the DUT response contains list of ModeOptionsStruct entries.
            - Verify that the list has at least 2 and at most 255 entries
            - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value.
            - If ModeOptionsStruct entry’s ModeTags field is not empty,  then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the mode tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster-derived tag value (Normal, Heavy, Light) or in the MfgTags (0x8000 to 0xBFFF) range.
            - Verify that at least one ModeOptionsStruct entry includes the Normal mode tag
            - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform:

            [1689997453.610123][360094:360096] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0000 DataVersion: 1427220838
            [1689997453.610169][360094:360096] CHIP:TOO:   SupportedModes: 3 entries
            [1689997453.610483][360094:360096] CHIP:TOO:     [1]: {
            [1689997453.610503][360094:360096] CHIP:TOO:       Label: Normal
            [1689997453.610530][360094:360096] CHIP:TOO:       Mode: 0
            [1689997453.610536][360094:360096] CHIP:TOO:       ModeTags: 1 entries
            [1689997453.610540][360094:360096] CHIP:TOO:         [1]: {
            [1689997453.610542][360094:360096] CHIP:TOO:           Value: 16384
            [1689997453.610551][360094:360096] CHIP:TOO:          }
            [1689997453.610553][360094:360096] CHIP:TOO:      }
            [1689997453.610559][360094:360096] CHIP:TOO:     [2]: {
            [1689997453.610571][360094:360096] CHIP:TOO:       Label: Heavy
            [1689997453.610574][360094:360096] CHIP:TOO:       Mode: 1
            [1689997453.610577][360094:360096] CHIP:TOO:       ModeTags: 2 entries
            [1689997453.610580][360094:360096] CHIP:TOO:         [1]: {
            [1689997453.610582][360094:360096] CHIP:TOO:           Value: 7
            [1689997453.610583][360094:360096] CHIP:TOO:          }
            [1689997453.610585][360094:360096] CHIP:TOO:         [2]: {
            [1689997453.610587][360094:360096] CHIP:TOO:           Value: 16385
            [1689997453.610588][360094:360096] CHIP:TOO:          }
            [1689997453.610590][360094:360096] CHIP:TOO:      }
            [1689997453.610594][360094:360096] CHIP:TOO:     [3]: {
            [1689997453.610595][360094:360096] CHIP:TOO:       Label: Light
            [1689997453.610597][360094:360096] CHIP:TOO:       Mode: 2
            [1689997453.610600][360094:360096] CHIP:TOO:       ModeTags: 3 entries
            [1689997453.610602][360094:360096] CHIP:TOO:         [1]: {
            [1689997453.610604][360094:360096] CHIP:TOO:           Value: 16386
            [1689997453.610605][360094:360096] CHIP:TOO:          }
            [1689997453.610607][360094:360096] CHIP:TOO:         [2]: {
            [1689997453.610609][360094:360096] CHIP:TOO:           Value: 8
            [1689997453.610610][360094:360096] CHIP:TOO:          }
            [1689997453.610612][360094:360096] CHIP:TOO:         [3]: {
            [1689997453.610614][360094:360096] CHIP:TOO:           Value: 2
            [1689997453.610615][360094:360096] CHIP:TOO:          }
            [1689997453.610617][360094:360096] CHIP:TOO:      }
      disabled: true

    - label: "Step 3: TH reads from the DUT the CurrentMode attribute."
      PICS: DISHM.S.A0001
      verification: |
          ./chip-tool dishwashermode  read current-mode 1 1

          Verify on TH(chip-tool) logs, CurrentMode attribute is an integer value from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0

          [1689997642.999367][360160:360162] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_0001 DataVersion: 1994417976
          [1689997642.999395][360160:360162] CHIP:TOO:   CurrentMode: 0
      disabled: true
