diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json
index bf7fcca..db8f7f3 100644
--- a/examples/darwin-framework-tool/templates/tests/ciTests.json
+++ b/examples/darwin-framework-tool/templates/tests/ciTests.json
@@ -1,7 +1,7 @@
 {
     "include": "../../../../src/app/tests/suites/ciTests.json",
     "disable": [
-        "Test_TC_SC_4_2",
+        "Test_TC_SC_4_1",
         "Test_TC_SC_5_2",
         "TestClusterComplexTypes",
         "TestEvents",
@@ -33,8 +33,11 @@
         "DL_LockUnlock",
         "Disabled due to using ICD Management (ICDManagement) cluster, which is provisional on Darwin for now:",
         "TestIcdManagementCluster",
+        "Test_TC_ICDM_1_1",
+        "Test_TC_ICDM_2_1",
         "Disabled due to using Time Synchronization (TimeSynchronization) cluster, which is provisional on Darwin for now:",
         "Test_TC_TIMESYNC_1_1",
+        "Test_TC_TIMESYNC_2_3",
         "TestTimeSynchronization",
         "Disabled due to using provisional Ceramic Filter Monitoring (CeramicFilterMonitoring) cluster:",
         "Test_TC_CFREMON_1_1",
diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py
index b493c4c..1f824e9 100644
--- a/scripts/tests/chiptest/__init__.py
+++ b/scripts/tests/chiptest/__init__.py
@@ -134,6 +134,7 @@
         "TestEqualities.yaml",              # chip-repl does not support pseudo-cluster commands that return a value
         "TestExampleCluster.yaml",          # chip-repl does not load custom pseudo clusters
         "Test_TC_TIMESYNC_1_1.yaml",         # Time sync SDK is not yet ready
+        "Test_TC_TIMESYNC_2_3.yaml",         # Time sync SDK is not yet ready
         "TestAttributesById.yaml",           # chip-repl does not support AnyCommands (06/06/2023)
         "TestCommandsById.yaml",             # chip-repl does not support AnyCommands (06/06/2023)
         "TestEventsById.yaml",               # chip-repl does not support AnyCommands (06/06/2023)
diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml
index c7948d1..82d7d55 100644
--- a/src/app/tests/suites/certification/PICS.yaml
+++ b/src/app/tests/suites/certification/PICS.yaml
@@ -9463,3 +9463,76 @@
     #
     - label: "Does the device implement receiving the Step command?"
       id: FAN.S.C00.Rsp
+
+    #ICD Management
+    #
+    # Server Attribute
+    #
+    - label: "Does the device implement the IdleModeInterval attribute?"
+      id: ICDM.S.A0000
+
+    - label: "Does the device implement the ActiveModeInterval attribute?"
+      id: ICDM.S.A0001
+
+    - label: "Does the device implement the ActiveModeThreshold attribute?"
+      id: ICDM.S.A0002
+
+    - label: "Does the device implement the RegisteredClients attribute?"
+      id: ICDM.S.A0003
+
+    - label: "Does the device implement the IcdCounter attribute?"
+      id: ICDM.S.A0004
+
+    - label:
+          "Does the device implement the ClientsSupportedPerFabric attribute?"
+      id: ICDM.S.A0005
+
+    #
+    # Features
+    #
+    - label: "Does the device support this specific cluster feature?"
+      id: ICDM.S.F00
+
+    #
+    #Commands:
+    #
+    - label:
+          "Does the device implement receiving the StayActiveRequest command?"
+      id: ICDM.S.C03.Rsp
+
+    #
+    #RVC Clean Mode Select
+    #
+    #Feature
+    - label:
+          "Does the device support depending on an On/Off cluster implemented on
+          the same DUT?"
+      id: RVCCLEANMS.S.F00
+
+    - label: "Does the device support the extended status feature?"
+      id: RVCCLEANMS.S.F01
+
+    - label:
+          "Does the device implementation deprecate the ChangeToMode command?"
+      id: RVCCLEANMS.S.F02
+
+    #Server Attributes
+    - label: "Does the device implement the StartUpMode attribute?"
+      id: RVCCLEANMS.S.A0004
+
+    - label: "Does the device implement the OnMode attribute?"
+      id: RVCCLEANMS.S.A0005
+
+    #Server Commands recived
+    - label: "Does the device implement receiving the ChangeToMode command?"
+      id: RVCCLEANMS.S.C00.Rsp
+
+    - label:
+          "Does the device implement receiving the ChangeToModeWithStatus
+          command?"
+      id: RVCCLEANMS.S.C01.Rsp
+
+    #server commands generated
+    - label:
+          "Does the device implement sending the ChangeToModeResponse command?"
+      id: RVCCLEANMS.S.C03.Tx
diff --git a/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml b/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml
index d241d40..833d95d 100644
--- a/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml
+++ b/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml
@@ -219,10 +219,10 @@
           Manage privileges for group 0x0103 and maintain the current
           administrative privileges for the TH on the Access Control cluster.
           The following access control list shall be used: List item 1 (TH
-          admin): Privilege: Administer (5) AuthMode: CASE (2) Subjects: [N1]
-          Targets: [{Cluster: AccessControl (0x001f), Endpoint: 0}] List item 2
-          (group Manage access): Privilege: Manage (4) AuthMode: Group (3)
-          Subjects: group 0x0103 ([0x0103]) Targets: {Cluster: Groups (0x001d),
+          admin): Privilege: Administer (5), AuthMode: CASE (2), Subjects: [N1],
+          Targets: [{Cluster: AccessControl (0x001f), Endpoint: 0}]. List item 2
+          (group Manage access): Privilege: Manage (4), AuthMode: Group (3),
+          Subjects: group 0x0103 ([0x0103]), Targets: {Cluster: Groups (0x0004),
           Endpoint: PIXIT.G.ENDPOINT}"
       verification: |
           ./chip-tool accesscontrol write acl '[{ "privilege": 5, "authMode": 2, "subjects": [112233], "targets": [{ "cluster": 31, "endpoint": 0, "deviceType": null }]},{ "privilege": 4, "authMode": 3, "subjects": [259], "targets": [{ "cluster": 4, "endpoint": 0, "deviceType": null }]}]' 1 0
diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml
index d4840d4..0da5eb8 100644
--- a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml
@@ -23,6 +23,9 @@
     nodeId: 0x12344321
     cluster: "Color Control"
     endpoint: 1
+    ConfigWait:
+        type: int16u
+        defaultValue: 5000
 
 tests:
     - label: "Wait for the commissioned device to be retrieved"
@@ -215,6 +218,14 @@
       cluster: "On/Off"
       command: "Off"
 
+    - label: "Wait to turn Off light"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: ConfigWait
+
     - label: "Check on/off attribute value is false after off command"
       cluster: "On/Off"
       command: "readAttribute"
diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml
index b4367c0..6cd7182 100644
--- a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml
@@ -22,6 +22,9 @@
     nodeId: 0x12344321
     cluster: "Color Control"
     endpoint: 1
+    ConfigWait:
+        type: int16u
+        defaultValue: 5000
 
 tests:
     - label: "Wait for the commissioned device to be retrieved"
@@ -367,6 +370,14 @@
       cluster: "On/Off"
       command: "Off"
 
+    - label: "Wait to turn Off light"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: ConfigWait
+
     - label: "Check on/off attribute value is false after off command"
       cluster: "On/Off"
       command: "readAttribute"
diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml
index 64f22a5..967f442 100644
--- a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml
@@ -22,6 +22,9 @@
     nodeId: 0x12344321
     cluster: "Color Control"
     endpoint: 1
+    ConfigWait:
+        type: int16u
+        defaultValue: 5000
 
 tests:
     - label: "Wait for the commissioned device to be retrieved"
@@ -289,6 +292,14 @@
       cluster: "On/Off"
       command: "Off"
 
+    - label: "Wait to turn Off light"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: ConfigWait
+
     - label: "Check on/off attribute value is false after off command"
       cluster: "On/Off"
       command: "readAttribute"
diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml
index 438cb13..951d77b 100644
--- a/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml
@@ -23,6 +23,9 @@
     nodeId: 0x12344321
     cluster: "Color Control"
     endpoint: 1
+    ConfigWait:
+        type: int16u
+        defaultValue: 5000
 
 tests:
     - label: "Wait for the commissioned device to be retrieved"
@@ -91,6 +94,8 @@
       verification: |
           ./chip-tool colorcontrol write start-up-color-temperature-mireds 32639 1 1
 
+          Verify DUT responds with a successful (value 0x00) status response On TH(chip-tool) Log and below is the sample log provided for the raspi platform
+
           [1684869285516] [29746:343264] [DMG] WriteResponseMessage =
           [1684869285516] [29746:343264] [DMG] {
           [1684869285516] [29746:343264] [DMG]    AttributeStatusIBs =
@@ -211,3 +216,24 @@
           constraints:
               minValue: 0
               maxValue: 3
+
+    - label: "Turn Off light that we turned on"
+      PICS: OO.S.C00.Rsp
+      cluster: "On/Off"
+      command: "Off"
+
+    - label: "Wait to turn Off light"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: ConfigWait
+
+    - label: "Check on/off attribute value is false after off command"
+      cluster: "On/Off"
+      command: "readAttribute"
+      attribute: "OnOff"
+      PICS: OO.S.A0000
+      response:
+          value: 0
diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml
index 99920cf..2932c6c 100644
--- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Project CHIP Authors
+# 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.
@@ -11,47 +11,136 @@
 # 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.12.2. [TC-CONTENTLAUNCHER-10.3] Launch Content Verification
+name: 19.12.2. [TC-CONTENTLAUNCHER-10.3] Launch Content Verification
 
 PICS:
     - CONTENTLAUNCHER.S
 
 config:
     nodeId: 0x12344321
-    cluster: "Basic Information"
-    endpoint: 0
+    cluster: "Content Launcher"
+    endpoint: 1
+    data:
+        type: char_string
+        defaultValue: "exampleData"
+    SearchValue:
+        type: char_string
+        defaultValue: "exampleValue"
+    ExternalIdName:
+        type: char_string
+        defaultValue: "name"
+    ExternalIdValue:
+        type: char_string
+        defaultValue: "value"
 
 tests:
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
     - label:
           "TH sends a LaunchContent command to the DUT with a search parameter
           and string, and AutoPlay flag set to false"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: false
+              - name: "Data"
+                value: data
+              - name: "Search"
+                value:
+                    {
+                        ParameterList:
+                            [
+                                {
+                                    Type: 0,
+                                    Value: SearchValue,
+                                    ExternalIDList:
+                                        [
+                                            {
+                                                Name: ExternalIdName,
+                                                Value: ExternalIdValue,
+                                            },
+                                        ],
+                                },
+                            ],
+                    }
+      response:
+          values:
+              - name: "Data"
+                value: data
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651062794.114531][157317:157322] CHIP:TOO:   LaunchResponse: {
-          [1651062794.114546][157317:157322] CHIP:TOO:     status: 0
-          [1651062794.114553][157317:157322] CHIP:TOO:     data: exampleData
-          [1651062794.114560][157317:157322] CHIP:TOO:    }
-      disabled: true
+    - label:
+          "Verify that DUT present via its user interface a list of matches
+          based on the provided search criteria."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT present via its user interface a
+                    list of matches based on the provided search criteria."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with a search parameter
           and string, and AutoPlay flag set to true"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 1 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 1 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Data"
+                value: data
+              - name: "Search"
+                value:
+                    {
+                        ParameterList:
+                            [
+                                {
+                                    Type: 0,
+                                    Value: SearchValue,
+                                    ExternalIDList:
+                                        [
+                                            {
+                                                Name: ExternalIdName,
+                                                Value: ExternalIdValue,
+                                            },
+                                        ],
+                                },
+                            ],
+                    }
+      response:
+          values:
+              - name: "Data"
+                value: data
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651062895.695667][157343:157348] CHIP:TOO:   LaunchResponse: {
-          [1651062895.695703][157343:157348] CHIP:TOO:     status: 0
-          [1651062895.695724][157343:157348] CHIP:TOO:     data: exampleData
-          [1651062895.695746][157343:157348] CHIP:TOO:    }
-      disabled: true
+    - label:
+          "Verify that DUT should also begin playing content that best matched
+          the given search criteria"
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT begin playing content that best
+                    matched the given search criteria"
+              - name: "expectedValue"
+                value: "y"
diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml
index f5d728c..3faa520 100644
--- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Project CHIP Authors
+# 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.
@@ -11,146 +11,166 @@
 # 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.12.4. [TC-CONTENTLAUNCHER-10.5] Launch URL Verification
+name: 19.12.4. [TC-CONTENTLAUNCHER-10.5] Launch URL Verification
 
 PICS:
     - CONTENTLAUNCHER.S
 
 config:
     nodeId: 0x12344321
-    cluster: "Basic Information"
-    endpoint: 0
+    cluster: "Content Launcher"
+    endpoint: 1
+    GoodURL:
+        type: char_string
+        defaultValue: "https://csa-iot.org/"
+    BadURL:
+        type: char_string
+        defaultValue: "https://badurl"
+    UnauthorizedURL:
+        type: char_string
+        defaultValue: "https://csa-iot.org/badauth"
+    DisplayContent:
+        type: char_string
+        defaultValue: "exampleData"
+    providerNameString:
+        type: char_string
+        defaultValue: "exampleName"
 
 tests:
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
     - label:
           "TH sends a LaunchURL command to the DUT with a known good content URL
           string"
       PICS: CONTENTLAUNCHER.S.C01.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-url "exampleUrl"   '{"providerName":  "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
-          ./chip-tv-casting-app contentlauncher launch-url "exampleUrl"   '{"providerName":  "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
+      command: "LaunchURL"
+      arguments:
+          values:
+              - name: "ContentURL"
+                value: GoodURL
+              - name: "BrandingInformation"
+                value: { ProviderName: providerNameString }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-
-          [1678789736.472050][327646:327648] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002
-          [1678789736.472076][327646:327648] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1678789736.472108][327646:327648] CHIP:TOO:   LauncherResponse: {
-          [1678789736.472137][327646:327648] CHIP:TOO:     status: 0
-          [1678789736.472147][327646:327648] CHIP:TOO:     data: exampleData
-          [1678789736.472156][327646:327648] CHIP:TOO:    }
-          [1678789736.472184][327646:327648] CHIP:DMG: ICR moving to [AwaitingDe]
-
-
-          Example tv-app log file shows receipt of launchurl command:
-          [1678789736.471351][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=exampleUrl DisplayString= BrandingInformation.ProviderName=exampleName
-      disabled: true
+    - label: "Verify that DUT launched the content at the given URL"
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT launched the content at the given
+                    URL"
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchURL command to the DUT with a known good content URL
           string and a display string"
       PICS: CONTENTLAUNCHER.S.C01.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-url "https://csa-iot.org/"   '{"providerName":  "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1 --DisplayString "Custom Display String"
-          ./chip-tv-casting-app contentlauncher launch-url "https://csa-iot.org/"   '{"providerName":  "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1 --DisplayString "Custom Display String"
+      command: "LaunchURL"
+      arguments:
+          values:
+              - name: "ContentURL"
+                value: GoodURL
+              - name: "DisplayString"
+                value: DisplayContent
+              - name: "BrandingInformation"
+                value: { ProviderName: providerNameString }
+      response:
+          values:
+              - name: "Data"
+                value: DisplayContent
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1678789892.544748][327789:327791] CHIP:DMG: },
-          [1678789892.544778][327789:327791] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002
-          [1678789892.544785][327789:327791] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1678789892.544800][327789:327791] CHIP:TOO:   LauncherResponse: {
-          [1678789892.544806][327789:327791] CHIP:TOO:     status: 0
-          [1678789892.544809][327789:327791] CHIP:TOO:     data: exampleData
-          [1678789892.544811][327789:327791] CHIP:TOO:    }
-          [1678789892.544816][327789:327791] CHIP:DMG: ICR moving to [AwaitingDe]
-          [1678789892.544827][327789:327791] CHIP:EM: <<< [E:5462i S:11532 M:235261867 (Ack:223833241)] (S) Msg TX to 1:0000000000000001 [67DC] --- Type 0000:10 (SecureChannel:StandaloneAck)
-          [1678789892.544831][327789:327791] CHIP:IN: (S) Sending msg 235261867 on secure session with LSID: 11532
-
-
-
-          Example tv-app log file shows receipt of launchurl command:
-          [1678789892.544284][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://csa-iot.org/ DisplayString=Custom Display String BrandingInformation.ProviderName=exampleName
-      disabled: true
+    - label:
+          "Verify that DUT launched the content at the given URL with the given
+          display string in the application-specific description area"
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT launched the content at the given
+                    URL with the given display string in the
+                    application-specific description area"
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchURL command to the DUT with a known good content URL
           string and a brand information object."
       PICS: CONTENTLAUNCHER.S.C01.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-url "https://csa-iot.org/"   '{"providerName":  "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
-          ./chip-tv-casting-app contentlauncher launch-url "https://csa-iot.org/"   '{"providerName":  "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
+      command: "LaunchURL"
+      arguments:
+          values:
+              - name: "ContentURL"
+                value: GoodURL
+              - name: "BrandingInformation"
+                value: { ProviderName: providerNameString }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1678789976.395074][327809:327811] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002
-          [1678789976.395083][327809:327811] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1678789976.395095][327809:327811] CHIP:TOO:   LauncherResponse: {
-          [1678789976.395106][327809:327811] CHIP:TOO:     status: 0
-          [1678789976.395109][327809:327811] CHIP:TOO:     data: exampleData
-          [1678789976.395112][327809:327811] CHIP:TOO:    }
-          [1678789976.395120][327809:327811] CHIP:DMG: ICR moving to [AwaitingDe]
-
-
-
-          Example tv-app log file shows receipt of launchurl command:
-          [1678789976.394509][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://csa-iot.org/ DisplayString= BrandingInformation.ProviderName=exampleName
-      disabled: true
+    - label:
+          "Verify that DUT launched the content at the given URL with the player
+          interface updated as per the provided branding information"
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT launched the content at the given
+                    URL with the player interface updated as per the provided
+                    branding information"
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchURL command to the DUT with a known unreachable
           content URL string."
       PICS: CONTENTLAUNCHER.S.C01.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-url "https://badurl"   '{"providerName":  "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
-          ./chip-tv-casting-app contentlauncher launch-url "https://badurl"   '{"providerName":  "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
-
-          On TH  verify the success response (value 0) received  from DUT
-          [1678790057.261934][327869:327871] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002
-          [1678790057.261963][327869:327871] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1678790057.261997][327869:327871] CHIP:TOO:   LauncherResponse: {
-          [1678790057.262025][327869:327871] CHIP:TOO:     status: 1
-          [1678790057.262035][327869:327871] CHIP:TOO:     data: exampleData
-          [1678790057.262045][327869:327871] CHIP:TOO:    }
-          [1678790057.262072][327869:327871] CHIP:DMG: ICR moving to [AwaitingDe]
-          [1678790057.262115][327869:327871] CHIP:EM: <<< [E:61104i S:23930 M:82030218 (Ack:133196816)] (S) Msg TX to 1:0000000000000001 [67DC] --- Type 0000:10 (SecureChannel:StandaloneAck)
-
-          Example tv-app log file shows receipt of launchurl command:
-          [1678790092.751184][324821:324821] CHIP:ZCL: Content Launcher NOT returning ContentApp delegate for endpoint:1
-          [1678790092.751199][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl
-          [1678790092.751206][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://badurl DisplayString= BrandingInformation.ProviderName=exampleName
-          [1678790092.751223][324821:324821] CHIP:DMG: Command handler moving to [ Preparing]
-      disabled: true
+      command: "LaunchURL"
+      arguments:
+          values:
+              - name: "ContentURL"
+                value: BadURL
+              - name: "BrandingInformation"
+                value: { ProviderName: providerNameString }
+      response:
+          values:
+              - name: "Status"
+                value: 1 #URL_NOT_AVAILABLE
 
     - label:
           "TH sends a LaunchURL command to the DUT with a known un-authorized
           content URL string."
       PICS: CONTENTLAUNCHER.S.C01.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-url "https://csa-iot.org/badauth"   '{"providerName":  "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
-          ./chip-tv-casting-app contentlauncher launch-url "https://csa-iot.org/badauth"   '{"providerName":  "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0,  "metric": 0} }}' 1 1
-
-          On TH  verify the success response (value 0) received  from DUT
-          [1678790163.014868][327910:327912] CHIP:DMG: },
-          [1678790163.014878][327910:327912] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002
-          [1678790163.014885][327910:327912] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1678790163.014894][327910:327912] CHIP:TOO:   LauncherResponse: {
-          [1678790163.014903][327910:327912] CHIP:TOO:     status: 2
-          [1678790163.014905][327910:327912] CHIP:TOO:     data: exampleData
-          [1678790163.014908][327910:327912] CHIP:TOO:    }
-          [1678790163.014912][327910:327912] CHIP:DMG: ICR moving to [AwaitingDe]
-          [1678790163.014926][327910:327912] CHIP:EM: <<< [E:6864i S:36983 M:190033825 (Ack:105150405)] (S) Msg TX to 1:0000000000000001 [67DC] --- Type 0000:10 (SecureChannel:StandaloneAck)
-          [1678790163.014930][327910:327912] CHIP:IN: (S) Sending msg 190033825 on secure session with LSID: 36983
-
-
-          Example tv-app log file shows receipt of launchurl command:
-          [1678790163.014705][324821:324821] CHIP:DL: GetContentAppByEndpointId() - endpoint 1 not found
-          [1678790163.014707][324821:324821] CHIP:ZCL: Content Launcher NOT returning ContentApp delegate for endpoint:1
-          [1678790163.014711][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl
-          [1678790163.014713][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://csa-iot.org/badauth DisplayString= BrandingInformation.ProviderName=exampleName
-          [1678790163.014719][324821:324821] CHIP:DMG: Command handler moving to [ Preparing]
-      disabled: true
+      command: "LaunchURL"
+      arguments:
+          values:
+              - name: "ContentURL"
+                value: UnauthorizedURL
+              - name: "BrandingInformation"
+                value: { ProviderName: providerNameString }
+      response:
+          values:
+              - name: "Status"
+                value: 2 #AUTH_FAILED
diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml
index 7c4aa59..eff9299 100644
--- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml
+++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Project CHIP Authors
+# 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.
@@ -11,303 +11,401 @@
 # 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.12.6. [TC-CONTENTLAUNCHER-10.7] Content Search Verification
+name: 19.12.6. [TC-CONTENTLAUNCHER-10.7] Content Search Verification
 
 PICS:
     - CONTENTLAUNCHER.S
 
 config:
     nodeId: 0x12344321
-    cluster: "Basic Information"
-    endpoint: 0
+    cluster: "Content Launcher"
+    endpoint: 1
+    PopularityName:
+        type: char_string
+        defaultValue: "popular content"
 
 tests:
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Actor' and Value as An Actors name, for
-          example, Gaby sHoffman"
+          consisting of Type As Actor and Value as An Actor’s name, for example,
+          Gaby sHoffman"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "Gaby sHoffman", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "Gaby sHoffman", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 0, Value: "Gaby sHoffman" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651225059.893636][4190:4195] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651225059.893741][4190:4195] CHIP:TOO:   LaunchResponse: {
-          [1651225059.893814][4190:4195] CHIP:TOO:     status: 0
-          [1651225059.893869][4190:4195] CHIP:TOO:     data: exampleData
-          [1651225059.893924][4190:4195] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=0
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Channel' and Value as Channel Name name, for
-          example, 'PBS'"
+          consisting of Type As Channel and Value as Channel Name name, for
+          example, PBS"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 1, "value": "PBS", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 1, "value": "PBS", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 1, Value: "PBS" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651225141.737648][4203:4209] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651225141.737778][4203:4209] CHIP:TOO:   LaunchResponse: {
-          [1651225141.737854][4203:4209] CHIP:TOO:     status: 0
-          [1651225141.737936][4203:4209] CHIP:TOO:     data: exampleData
-          [1651225141.737994][4203:4209] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=1
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Character' and Value as Characters name,for
-          example, Snow White"
+          consisting of Type As Character and Value as Character’s name,for
+          example,Snow White"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 2, "value": "Snow White", "externalIDList": [ { "name": "foo", "value": "2"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 2, "value": "Snow White", "externalIDList": [ { "name": "foo", "value": "2"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: false
+              - name: "Search"
+                value: { ParameterList: [{ Type: 2, Value: "Snow White" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578539.231066][9699:9704] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578539.231135][9699:9704] CHIP:TOO:   LaunchResponse: {
-          [1651578539.231184][9699:9704] CHIP:TOO:     status: 0
-          [1651578539.231214][9699:9704] CHIP:TOO:     data: exampleData
-          [1651578539.231247][9699:9704] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=2
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Director' and Value as Directors name, for
+          consisting of Type As Director and Value as Director’s name, for
           example, Spike Lee"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 3, "value": "Spike Lee", "externalIDList": [ { "name": "Spike Lee", "value": "3"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 3, "value": "Spike Lee", "externalIDList": [ { "name": "Spike Lee", "value": "3"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 3, Value: "Spike Lee" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578561.129609][9706:9711] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578561.129678][9706:9711] CHIP:TOO:   LaunchResponse: {
-          [1651578561.129725][9706:9711] CHIP:TOO:     status: 0
-          [1651578561.129760][9706:9711] CHIP:TOO:     data: exampleData
-          [1651578561.129796][9706:9711] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=3
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Event' and Value as An Events name , for
-          example 'Football games'"
+          consisting of Type As Event and Value as An Event’s name , for example
+          Football games"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 4, "value": "Football games", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 4, "value": "Football games", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 4, Value: "Football games" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578612.348295][9717:9722] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578612.348350][9717:9722] CHIP:TOO:   LaunchResponse: {
-          [1651578612.348388][9717:9722] CHIP:TOO:     status: 0
-          [1651578612.348413][9717:9722] CHIP:TOO:     data: exampleData
-          [1651578612.348437][9717:9722] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236636669] [74577:2229859] CHIP: [ZCL]  TEST CASE found match=Sports Example type=4
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Franchise' and Value as Franchises name,for
-          example 'Star Wars'"
+          consisting of Type As Franchise and Value as Franchise’s name,for
+          example Star Wars"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 5, "value": "Star Wars", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 5, "value": "Star Wars", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 5, Value: "Star Wars" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-
-          [1651578634.392516][9725:9730] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578634.392581][9725:9730] CHIP:TOO:   LaunchResponse: {
-          [1651578634.392629][9725:9730] CHIP:TOO:     status: 0
-          [1651578634.392662][9725:9730] CHIP:TOO:     data: exampleData
-          [1651578634.392694][9725:9730] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=5
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Genre' and Value as Genres name, for example
-          'Horror'"
+          consisting of Type As Genre and Value as Genre’s name, for example
+          Horror"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 6, "value": "Horror", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 6, "value": "Horror", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 6, Value: "Horror" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1652091775.613303][9916:9922] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002
-          [1652091775.613395][9916:9922] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1652091775.613490][9916:9922] CHIP:TOO:   LaunchResponse: {
-          [1652091775.613578][9916:9922] CHIP:TOO:     status: 0
-          [1652091775.613620][9916:9922] CHIP:TOO:     data: exampleData
-          [1652091775.613661][9916:9922] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=6
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'League' and Value as Leagues name, for example
-          'NCAA'"
+          consisting of Type As League and Value as League’s name, for example
+          NCAA"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 7, "value": "NCAA", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 7, "value": "NCAA", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 7, Value: "NCAA" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-
-          [1651578662.336318][9733:9738] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578662.336370][9733:9738] CHIP:TOO:   LaunchResponse: {
-          [1651578662.336479][9733:9738] CHIP:TOO:     status: 0
-          [1651578662.336505][9733:9738] CHIP:TOO:     data: exampleData
-          [1651578662.336526][9733:9738] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236636669] [74577:2229859] CHIP: [ZCL]  TEST CASE found match=Sports Example type=7
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Popularity' and Value as Popularitys name"
+          consisting of Type As Popularity and Value as Popularity’s name"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 8, "value": "Popularity", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 8, "value": "Popularity", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 8, Value: PopularityName }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578680.236952][9740:9745] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578680.237036][9740:9745] CHIP:TOO:   LaunchResponse: {
-          [1651578680.237093][9740:9745] CHIP:TOO:     status: 0
-          [1651578680.237135][9740:9745] CHIP:TOO:     data: exampleData
-          [1651578680.237176][9740:9745] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=8
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Provider' and Value as Providers name, for
-          example 'Netflix'"
+          consisting of Type As Provider and Value as Provider’s name, for
+          example Netflix"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 9, "value": "Netflix", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 9, "value": "Netflix", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 9, Value: "Netflix" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578697.912544][9750:9755] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578697.912620][9750:9755] CHIP:TOO:   LaunchResponse: {
-          [1651578697.912673][9750:9755] CHIP:TOO:     status: 0
-          [1651578697.912715][9750:9755] CHIP:TOO:     data: exampleData
-          [1651578697.912753][9750:9755] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=TV Show Example type=9
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Sport' and Value as Sports name, for example,
+          consisting of Type As Sport and Value as Sport’s name, for example,
           football"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 10, "value": "football", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 10, "value": "football", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 10, Value: "football" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578716.145536][9757:9762] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578716.145622][9757:9762] CHIP:TOO:   LaunchResponse: {
-          [1651578716.145682][9757:9762] CHIP:TOO:     status: 0
-          [1651578716.145725][9757:9762] CHIP:TOO:     data: exampleData
-          [1651578716.145767][9757:9762] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236636669] [74577:2229859] CHIP: [ZCL]  TEST CASE found match=Sports Example type=10
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'SportsTeam' and Value as SportTeams name , for
-          example 'Arsenel'"
+          consisting of Type As SportsTeam and Value as SportTeam’s name , for
+          example Arsenel"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 11, "value": "Arsenel", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 11, "value": "Arsenel", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 11, Value: "Arsenel" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578735.341387][9764:9769] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578735.341498][9764:9769] CHIP:TOO:   LaunchResponse: {
-          [1651578735.341574][9764:9769] CHIP:TOO:     status: 0
-          [1651578735.341630][9764:9769] CHIP:TOO:     data: exampleData
-          [1651578735.341686][9764:9769] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236636669] [74577:2229859] CHIP: [ZCL]  TEST CASE found match=Sports Example type=11
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
 
     - label:
           "TH sends a LaunchContent command to the DUT with search parameter
-          consisting of Type As 'Type' and Value as Types name, for example
-          'TVSeries'"
+          consisting of Type As Type and Value as Type’s name, for example
+          TVSeries"
       PICS: CONTENTLAUNCHER.S.C00.Rsp
-      verification: |
-          The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner):
-          ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 12, "value": "TVSeries", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
-          ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 12, "value": "TVSeries", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1
+      command: "LaunchContent"
+      arguments:
+          values:
+              - name: "AutoPlay"
+                value: true
+              - name: "Search"
+                value: { ParameterList: [{ Type: 12, Value: "TVSeries" }] }
+      response:
+          values:
+              - name: "Status"
+                value: 0
 
-          On TH  verify the success response (value 0) received  from DUT
-          [1651578755.904379][9773:9778] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002
-          [1651578755.904459][9773:9778] CHIP:TOO:   LaunchResponse: {
-          [1651578755.904517][9773:9778] CHIP:TOO:     status: 0
-          [1651578755.904560][9773:9778] CHIP:TOO:     data: exampleData
-          [1651578755.904604][9773:9778] CHIP:TOO:    }
-
-          tv-app DUT shows matches via console:
-
-          [1653236823721] [74577:2234439] CHIP: [ZCL]  TEST CASE found match=Sports Example type=12
-      disabled: true
+    - label: "Verify that DUT should play or display the search result."
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value:
+                    "Please enter 'y' if DUT play or display the search result."
+              - name: "expectedValue"
+                value: "y"
diff --git a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml
index dce6dbb..51dbc0c 100644
--- a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml
@@ -36,6 +36,7 @@
       command: "readAttribute"
       attribute: "MinMeasuredValue"
       response:
+          saveAs: MinMeasuredVariable
           constraints:
               type: int16u
               minValue: 0
@@ -46,9 +47,10 @@
       command: "readAttribute"
       attribute: "MaxMeasuredValue"
       response:
+          saveAs: MaxMeasuredVariable
           constraints:
               type: int16u
-              minValue: 0
+              minValue: MinMeasuredVariable
               maxValue: 65534
 
     - label: "Read the mandatory attribute: MeasuredValue"
@@ -58,8 +60,8 @@
       response:
           constraints:
               type: int16u
-              minValue: 0
-              maxValue: 65535
+              minValue: MinMeasuredVariable
+              maxValue: MaxMeasuredVariable
 
     - label: "TH reads from the DUT the Tolerance attribute"
       PICS: FLW.S.A0003
diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml
new file mode 100644
index 0000000..aac4c65
--- /dev/null
+++ b/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml
@@ -0,0 +1,138 @@
+# 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.
+
+name: 312.1.1. [TC-ICDM-1.1] Global attributes with DUT as Server
+
+PICS:
+    - ICDM.S
+
+config:
+    nodeId: 0x12344321
+    cluster: "ICD Management"
+    endpoint: 0
+
+tests:
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
+    - label: "Read the global attribute: ClusterRevision"
+      command: "readAttribute"
+      attribute: "ClusterRevision"
+      response:
+          value: 1
+          constraints:
+              type: int16u
+
+    - label: "Read the global attribute: FeatureMap"
+      PICS: ICDM.S.F00
+      command: "readAttribute"
+      attribute: "FeatureMap"
+      response:
+          value: 1
+          constraints:
+              type: bitmap32
+
+    - label: "Read the global attribute: FeatureMap"
+      PICS: " !ICDM.S.F00 "
+      command: "readAttribute"
+      attribute: "FeatureMap"
+      response:
+          value: 0
+          constraints:
+              type: bitmap32
+
+    - label: "Read the global attribute: AttributeList"
+      command: "readAttribute"
+      attribute: "AttributeList"
+      response:
+          constraints:
+              type: list
+              contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533]
+
+    - label: "Read the optional attribute(RegisteredClients) in AttributeList"
+      PICS: ICDM.S.A0003
+      command: "readAttribute"
+      attribute: "AttributeList"
+      response:
+          constraints:
+              type: list
+              contains: [3]
+
+    - label: "Read the optional attribute(IcdCounter) in AttributeList"
+      PICS: ICDM.S.A0004
+      command: "readAttribute"
+      attribute: "AttributeList"
+      response:
+          constraints:
+              type: list
+              contains: [4]
+
+    - label:
+          "Read the optional attribute(ClientsSupportedPerFabric) in
+          AttributeList"
+      PICS: ICDM.S.A0005
+      command: "readAttribute"
+      attribute: "AttributeList"
+      response:
+          constraints:
+              type: list
+              contains: [5]
+
+    - label: "Read the global attribute: EventList"
+      command: "readAttribute"
+      attribute: "EventList"
+      response:
+          value: []
+          constraints:
+              type: list
+
+    - label: "Read the global attribute: AcceptedCommandList"
+      command: "readAttribute"
+      attribute: "AcceptedCommandList"
+      response:
+          constraints:
+              type: list
+              contains: [0, 2]
+
+    - label: "Read the optional command (StayActiveRequest) in AttributeList"
+      PICS: ICDM.S.C03.Rsp
+      command: "readAttribute"
+      attribute: "AcceptedCommandList"
+      response:
+          constraints:
+              type: list
+              contains: [3]
+
+    - label: "Read the global attribute: GeneratedCommandList"
+      PICS: " !ICDM.S.F00 "
+      command: "readAttribute"
+      attribute: "GeneratedCommandList"
+      response:
+          value: []
+          constraints:
+              type: list
+
+    - label: "Read the global attribute: GeneratedCommandList"
+      PICS: ICDM.S.F00
+      command: "readAttribute"
+      attribute: "GeneratedCommandList"
+      response:
+          constraints:
+              type: list
+              contains: [1]
diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_2_1.yaml
new file mode 100644
index 0000000..00e9d68
--- /dev/null
+++ b/src/app/tests/suites/certification/Test_TC_ICDM_2_1.yaml
@@ -0,0 +1,87 @@
+# 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.
+
+name: 312.2.1. [TC-ICDM-2.1] Attributes with DUT as Server
+
+PICS:
+    - ICDM.S
+
+config:
+    nodeId: 0x12344321
+    cluster: "ICD Management"
+    endpoint: 0
+
+tests:
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
+    - label: "TH reads from the DUT the IdleModeInterval attribute"
+      PICS: ICDM.S.A0000
+      command: "readAttribute"
+      attribute: "IdleModeInterval"
+      response:
+          saveAs: IdleModeIntervalValue
+          constraints:
+              type: int32u
+              minValue: 500
+              maxValue: 64800000
+
+    - label: "TH reads from the DUT the ActiveModeInterval attribute"
+      PICS: ICDM.S.A0001
+      command: "readAttribute"
+      attribute: "ActiveModeInterval"
+      response:
+          constraints:
+              type: int32u
+              minValue: 300
+              maxValue: IdleModeIntervalValue
+
+    - label: "TH reads from the DUT the ActiveModeThreshold attribute"
+      PICS: ICDM.S.A0002
+      command: "readAttribute"
+      attribute: "ActiveModeThreshold"
+      response:
+          constraints:
+              type: int16u
+              minValue: 300
+
+    - label: "TH reads from the DUT the RegisteredClients attribute"
+      PICS: ICDM.S.A0003
+      command: "readAttribute"
+      attribute: "RegisteredClients"
+      response:
+          constraints:
+              type: list
+
+    - label: "TH reads from the DUT the IcdCounter attribute"
+      PICS: ICDM.S.A0004
+      command: "readAttribute"
+      attribute: "ICDCounter"
+      response:
+          constraints:
+              type: int32u
+
+    - label: "TH reads from the DUT the ClientsSupportedPerFabric attribute"
+      PICS: ICDM.S.A0005
+      command: "readAttribute"
+      attribute: "ClientsSupportedPerFabric"
+      response:
+          constraints:
+              type: int16u
+              minValue: 1
diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml
index 17ba4d8..f28781c 100644
--- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml
+++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml
@@ -142,20 +142,11 @@
 
     #Issue 19800
     - label: "Reads the PlaybackSpeed attribute from the DUT"
-      verification: |
-          ./chip-tool mediaplayback read playback-speed 1 3
-          [1655114487.018204][41855:41860] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0004 DataVersion: 4174921750
-          [1655114487.018302][41855:41860] CHIP:TOO:   PlaybackSpeed: -1.000000
-          [1655114487.018421][41855:41860] CHIP:EM: Sending Standalone Ack for MessageCounter:163883813 on exchange 24959
-      cluster: "LogCommands"
-      command: "UserPrompt"
-      PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp
-      arguments:
-          values:
-              - name: "message"
-                value: "Please enter 'y' if PlaybackSpeed value is -1"
-              - name: "expectedValue"
-                value: "y"
+      PICS: MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp
+      command: "readAttribute"
+      attribute: "PlaybackSpeed"
+      response:
+          value: -1
 
     - label: "Sends a Rewind command to the DUT"
       PICS: MEDIAPLAYBACK.S.C06.Rsp
@@ -182,20 +173,11 @@
 
     #Issue 19800
     - label: "Reads the PlaybackSpeed attribute from the DUT"
-      verification: |
-          ./chip-tool mediaplayback read playback-speed 1 3
-          [1655114711.400529][41871:41876] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0004 DataVersion: 4174921750
-          [1655114711.400683][41871:41876] CHIP:TOO:   PlaybackSpeed: -2.000000
-          [1655114711.400853][41871:41876] CHIP:EM: Sending Standalone Ack for MessageCounter:17386470 on exchange 38376
-      cluster: "LogCommands"
-      command: "UserPrompt"
-      PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp
-      arguments:
-          values:
-              - name: "message"
-                value: "Please enter 'y' if PlaybackSpeed value is -2"
-              - name: "expectedValue"
-                value: "y"
+      PICS: MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp
+      command: "readAttribute"
+      attribute: "PlaybackSpeed"
+      response:
+          value: -2
 
     - label: "Sends a Play command"
       PICS: MEDIAPLAYBACK.S.C00.Rsp
diff --git a/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml
index 3bc25e6..cf302ec 100644
--- a/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml
@@ -39,8 +39,8 @@
           saveAs: MinMeasuredValue
           constraints:
               type: int16s
-              minValue: -32768
-              maxValue: 32767
+              minValue: -32767
+              maxValue: 32766
 
     - label: "Read the mandatory attribute constraints: MaxMeasuredValue"
       PICS: PRS.S.A0002
@@ -50,7 +50,7 @@
           saveAs: MaxMeasuredValue
           constraints:
               type: int16s
-              minValue: -32768
+              minValue: MinMeasuredValue
               maxValue: 32767
 
     - label: "Read the mandatory attribute constraints: MeasuredValue"
@@ -81,8 +81,8 @@
           saveAs: MinScaledValue
           constraints:
               type: int16s
-              minValue: -32768
-              maxValue: 32767
+              minValue: -32767
+              maxValue: 32766
 
     - label: "Read the optional attribute: MaxScaledValue"
       PICS: PRS.S.A0012
@@ -92,7 +92,7 @@
           saveAs: MaxScaledValue
           constraints:
               type: int16s
-              minValue: -32768
+              minValue: MinScaledValue
               maxValue: 32767
 
     - label: "Read the optional attribute: ScaledValue"
diff --git a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml
index 44504a5..eaa7c15 100644
--- a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml
@@ -36,6 +36,7 @@
       command: "readAttribute"
       attribute: "MinMeasuredValue"
       response:
+          saveAs: CurrentMinMeasured
           constraints:
               type: int16u
               minValue: 0
@@ -46,9 +47,10 @@
       command: "readAttribute"
       attribute: "MaxMeasuredValue"
       response:
+          saveAs: CurrentMaxMeasured
           constraints:
               type: int16u
-              minValue: 1
+              minValue: CurrentMinMeasured
               maxValue: 10000
 
     - label: "TH reads the MeasuredValue attribute from the DUT"
@@ -58,8 +60,8 @@
       response:
           constraints:
               type: int16u
-              minValue: 0
-              maxValue: 10000
+              minValue: CurrentMinMeasured
+              maxValue: CurrentMaxMeasured
 
     - label: "TH reads the Tolerance attribute from the DUT"
       PICS: RH.S.A0003
diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml
index bd04f24..7ae1cda 100644
--- a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Project CHIP Authors
+# 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.
@@ -13,69 +13,81 @@
 # 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: 15.4.1. [TC-SC-4.1] Commissionable Node Discovery [DUT as Commissionee]
+name: 22.4.1. [TC-SC-4.1] Commissionable Node Discovery [DUT as Commissionee]
 
 PICS:
     - MCORE.ROLE.COMMISSIONEE
 
 config:
     nodeId: 0x12344321
-    cluster: "Basic Information"
     endpoint: 0
+    discriminator:
+        type: int16u
+        defaultValue: 3840
+    shortDiscriminator:
+        type: int16u
+        defaultValue: 15
+    vendorId:
+        type: int16u
+        defaultValue: 65521
+    productId:
+        type: int16u
+        defaultValue: 32769
+    deviceType:
+        type: int16u
+        defaultValue: 65535
+    PakeVerifier:
+        type: octet_string
+        defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf"
+    timeout: 900
+    waitAfterCommissioning:
+        type: int16u
+        defaultValue: 5000
 
 tests:
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
     - label:
-          "DUT is Commissioned and put in Commissioning Mode using Open Basic
-          Commissioning Window command and starts advertising Commissionable
-          Node Discovery service using DNS-SD"
-      PICS: CADMIN.S.C01.Rsp
-      verification: |
-          ./chip-tool administratorcommissioning open-basic-commissioning-window 200 1 0 --timedInteractionTimeoutMs 1000
+          "DUT is put in Commissioning Mode using Open Basic Commissioning
+          Window command "
+      cluster: "Administrator Commissioning"
+      command: "OpenBasicCommissioningWindow"
+      timedInteractionTimeoutMs: 10000
+      arguments:
+          values:
+              - name: "CommissioningTimeout"
+                value: 180
 
-          verify success on TH (Chip-tool) Logs:
+    - label: "Waiting after opening commissioning window"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: waitAfterCommissioning
 
-          [1652340903.034346][2874:2879] CHIP:DMG: InvokeResponseMessage =
-          [1652340903.034398][2874:2879] CHIP:DMG: {
-          [1652340903.034447][2874:2879] CHIP:DMG:         suppressResponse = false,
-          [1652340903.034499][2874:2879] CHIP:DMG:         InvokeResponseIBs =
-          [1652340903.034565][2874:2879] CHIP:DMG:         [
-          [1652340903.034615][2874:2879] CHIP:DMG:                 InvokeResponseIB =
-          [1652340903.034748][2874:2879] CHIP:DMG:                 {
-          [1652340903.034806][2874:2879] CHIP:DMG:                         CommandStatusIB =
-          [1652340903.034873][2874:2879] CHIP:DMG:                         {
-          [1652340903.034936][2874:2879] CHIP:DMG:                                 CommandPathIB =
-          [1652340903.035006][2874:2879] CHIP:DMG:                                 {
-          [1652340903.035078][2874:2879] CHIP:DMG:                                         EndpointId = 0x0,
-          [1652340903.035159][2874:2879] CHIP:DMG:                                         ClusterId = 0x3c,
-          [1652340903.035223][2874:2879] CHIP:DMG:                                         CommandId = 0x1,
-          [1652340903.035291][2874:2879] CHIP:DMG:                                 },
-          [1652340903.035362][2874:2879] CHIP:DMG:
-          [1652340903.035423][2874:2879] CHIP:DMG:                                 StatusIB =
-          [1652340903.035495][2874:2879] CHIP:DMG:                                 {
-          [1652340903.035566][2874:2879] CHIP:DMG:                                         status = 0x00 (SUCCESS),
-          [1652340903.035634][2874:2879] CHIP:DMG:                                 },
-          [1652340903.035704][2874:2879] CHIP:DMG:
-          [1652340903.035763][2874:2879] CHIP:DMG:                         },
-          [1652340903.035841][2874:2879] CHIP:DMG:
-          [1652340903.035898][2874:2879] CHIP:DMG:                 },
-          [1652340903.035965][2874:2879] CHIP:DMG:
-          [1652340903.036014][2874:2879] CHIP:DMG:         ],
-          [1652340903.036077][2874:2879] CHIP:DMG:
-          [1652340903.036126][2874:2879] CHIP:DMG:         InteractionModelRevision = 1
-          [1652340903.036175][2874:2879] CHIP:DMG: },
-          [1652340903.036294][2874:2879] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0
-          [1652340903.036375][2874:2879] CHIP:DMG: ICR moving to [AwaitingDe]
+    - label:
+          "Check DNS-SD instance name must be 64-bit randomly selected ID
+          expressed as a sixteen-char hex string with capital letters"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "instanceName"
+                saveAs: deviceInstanceNameBeforeReboot
+                constraints:
+                    minLength: 16
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
 
-          The delay timer is given 200 as an example , use whatever works for your product
-      disabled: true
-
-    - label: "Check DNS-SD subtypes used by DUT"
-      PICS:
-          " MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR &&
-          MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.VP_KEY
-          && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY &&
-          MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && MCORE.SC.RI_KEY &&
-          MCORE.SC.PH_KEY && MCORE.SC.PI_KEY "
+    - label: "Service type must be _matterc._udp"
       verification: |
           Run the below commands within the mentioned time interval used in open-commissioning-window in step-1.
           Run the below avahi browse command in the TH terminal
@@ -91,17 +103,15 @@
           +  wlan0 IPv6 5A4E867284D08B13                              _matterc._udp        local
           +   eth0 IPv6 5A4E867284D08B13                              _matterc._udp        local
           =   eth0 IPv6 5A4E867284D08B13                              _matterc._udp        local
-             hostname = [E45F010F1A010000.local]
-             address = [fe80::e65f:1ff:fe0f:1a01]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
+            hostname = [E45F010F1A010000.local]
+            address = [fe80::e65f:1ff:fe0f:1a01]
+            port = [5540]
+            txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
           =  wlan0 IPv6 5A4E867284D08B13                              _matterc._udp        local
-             hostname = [E45F010F1A010000.local]
-             address = [fe80::e65f:1ff:fe0f:1a01]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
-
-
+            hostname = [E45F010F1A010000.local]
+            address = [fe80::e65f:1ff:fe0f:1a01]
+            port = [5540]
+            txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
 
 
           If we use Thread setup, then the Service Domain will be 422F10CDC290A406.local
@@ -114,85 +124,323 @@
           +;eth0;IPv6;_S15;_sub._matterc._udp;local
           +;eth0;IPv6;_L3840;_sub._matterc._udp;local
           +;eth0;IPv6;_CM;_sub._matterc._udp;local
-      disabled: true
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_SKIP_SAMPLE_APP
+      arguments:
+          values:
+              - name: "message"
+                value: "Enter 'y' after success"
+              - name: "expectedValue"
+                value: "y"
+
+    #validate the service type and the service domain not implemented in CI
 
     - label:
-          "DUT is rebooted, then put in Commissioning Mode using Open Basic
-          Commissioning Window command, starting advertising Commissionable Node
-          Discovery service using DNS-SD"
-      PICS: CADMIN.S.C01.Rsp
+          "Check target hostname is derived from the 48bit or 64bit MAC address
+          expressed as a twelve or sixteen capital letter hex string"
+      PICS: "( MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    - label:
+          "Check target hostname is derived from the 48bit or 64bit MAC address
+          expressed as a twelve or sixteen capital letter hex string"
+      PICS: "(!MCORE.COM.WIFI && !MCORE.COM.WIFI) && MCORE.COM.THR"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    #subtype
+    - label: "Check Long Discriminator _L"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByLongDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: discriminator
+
+    - label: "Check Short Discriminator (_S)"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByShortDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: shortDiscriminator
+
+    - label:
+          "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V<ddddd> is present
+          must be 16-bit vendor id, encoded as a variable-length decimal number
+          in ASCII text, omitting any leading zeros"
+      PICS: MCORE.SC.VENDOR_SUBTYPE
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByVendorId"
+      arguments:
+          values:
+              - name: "value"
+                value: vendorId
+
+    - label:
+          "if (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present,
+          <ddd> represents device type from Data Model and must be represented
+          as a variable length decimal number in ASCII without leading zeros"
+      PICS: MCORE.SC.DEVTYPE_SUBTYPE
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByDeviceType"
+      arguments:
+          values:
+              - name: "value"
+                value: deviceType
+
+    - label: "Check Commissioning Mode (_CM) subtype _CM must be present"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByCommissioningMode"
+
+    - label:
+          "key D must be present and represents the discriminator which must be
+          encoded as a variable-length decimal value with up to 4 digits
+          omitting any leading zeros"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "longDiscriminator"
+                value: discriminator
+                constraints:
+                    minValue: 0
+                    maxValue: 4096
+
+    - label:
+          "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID
+          is present"
+      PICS: MCORE.SC.VP_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "vendorId"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID
+          is present"
+      PICS: MCORE.SC.VP_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "productId"
+                value: productId
+
+    - label:
+          "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an
+          unsigned integer with units of milliseconds and shall be encoded as a
+          variable length decimal number in ASCII, omitting leading zeros. Shall
+          not exceed 3600000"
+      PICS: MCORE.SC.SII_OP_DISCOVERY_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalIdle"
+                constraints:
+                    maxValue: 3600000
+
+    - label:
+          "If (MCORE.SC.SAI_OP_DISCOVERY_KEY ) present, SAI key must be an
+          unsigned integer with units of milliseconds and shall be encoded as a
+          variable length decimal number in ASCII, omitting leading zeros. Shall
+          not exceed 3600000."
+      PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalActive"
+                constraints:
+                    maxValue: 3600000
+
+    - label: "TXT key for commissioning mode (CM) CM=1 must be present"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "commissioningMode"
+                value: 1
+
+    - label:
+          "If (MCORE.SC.DT_KEY) present, DT key must contain the device type
+          identifier from Data Model Device Types and must be encoded as a
+          variable length decimal ASCII number without leading zeros"
+      PICS: MCORE.SC.DT_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceType"
+                value: deviceType
+
+    - label:
+          "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string
+          with a maximum length of 32B"
+      PICS: MCORE.SC.DN_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceName"
+                constraints:
+                    maxLength: 32
+
+    - label:
+          "If (MCORE.SC.RI_KEY ) present, key RI must include the Rotating
+          Device Identifier encoded as a uppercase string with a maximum length
+          of 100 chars"
+      PICS: MCORE.SC.RI_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "rotatingIdLen"
+                constraints:
+                    maxValue: 100
+
+    - label:
+          "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a
+          variable-length decimal number in ASCII text, omitting any leading
+          zeros. If present value must be different of 0"
+      PICS: MCORE.SC.PH_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingHint"
+                constraints:
+                    notValue: 0
+
+    - label:
+          "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8
+          string with a maximum length of 128 bytes"
+      PICS: MCORE.SC.PI_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingInstruction"
+                constraints:
+                    maxLength: 128
+
+    - label:
+          "DUT must publish AAAA records for each IPv6 address upon which they
+          are willing to accept Matter messages."
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "numIPs"
+                constraints:
+                    minValue: 1
+
+    ### DUT TurnOff
+    - label: "Reboot/restart the DUT"
+      PICS: PICS_SDK_CI_ONLY
+      cluster: "SystemCommands"
+      endpoint: 0
+      command: "Reboot"
+
+    - label: "Reboot target device(DUT)"
       verification: |
-          Reboot the device and commission the DUT again. Open the commissioning window using the below command in the TH (Chip-tool) terminal
+          Did the DUT successfully reboot?
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_SKIP_SAMPLE_APP
+      arguments:
+          values:
+              - name: "message"
+                value: "Please reboot the DUT and enter 'y' after DUT starts"
+              - name: "expectedValue"
+                value: "y"
 
-          ./chip-tool administratorcommissioning open-basic-commissioning-window 200 1 0 --timedInteractionTimeoutMs 1000
+    - label: "Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
 
-          verify success on TH (Chip-tool) logs:
+    - label:
+          "DUT put in Commissioning Mode using Open Basic Commissioning Window
+          command, starting advertising Commissionable Node Discovery service
+          using DNS-SD"
+      PICS: CADMIN.S.C01.Rsp
+      cluster: "Administrator Commissioning"
+      command: "OpenBasicCommissioningWindow"
+      timedInteractionTimeoutMs: 10000
+      arguments:
+          values:
+              - name: "CommissioningTimeout"
+                value: 180
 
-          [1652341174.803430][2893:2898] CHIP:DMG: InvokeResponseMessage =
-          [1652341174.803488][2893:2898] CHIP:DMG: {
-          [1652341174.803560][2893:2898] CHIP:DMG:         suppressResponse = false,
-          [1652341174.803622][2893:2898] CHIP:DMG:         InvokeResponseIBs =
-          [1652341174.803698][2893:2898] CHIP:DMG:         [
-          [1652341174.803757][2893:2898] CHIP:DMG:                 InvokeResponseIB =
-          [1652341174.803835][2893:2898] CHIP:DMG:                 {
-          [1652341174.803897][2893:2898] CHIP:DMG:                         CommandStatusIB =
-          [1652341174.803975][2893:2898] CHIP:DMG:                         {
-          [1652341174.804047][2893:2898] CHIP:DMG:                                 CommandPathIB =
-          [1652341174.804128][2893:2898] CHIP:DMG:                                 {
-          [1652341174.804213][2893:2898] CHIP:DMG:                                         EndpointId = 0x0,
-          [1652341174.804292][2893:2898] CHIP:DMG:                                         ClusterId = 0x3c,
-          [1652341174.804377][2893:2898] CHIP:DMG:                                         CommandId = 0x1,
-          [1652341174.804450][2893:2898] CHIP:DMG:                                 },
-          [1652341174.804539][2893:2898] CHIP:DMG:
-          [1652341174.804654][2893:2898] CHIP:DMG:                                 StatusIB =
-          [1652341174.804738][2893:2898] CHIP:DMG:                                 {
-          [1652341174.804821][2893:2898] CHIP:DMG:                                         status = 0x00 (SUCCESS),
-          [1652341174.804911][2893:2898] CHIP:DMG:                                 },
-          [1652341174.804993][2893:2898] CHIP:DMG:
-          [1652341174.805067][2893:2898] CHIP:DMG:                         },
-          [1652341174.805152][2893:2898] CHIP:DMG:
-          [1652341174.805220][2893:2898] CHIP:DMG:                 },
-          [1652341174.805307][2893:2898] CHIP:DMG:
-          [1652341174.805365][2893:2898] CHIP:DMG:         ],
-          [1652341174.805439][2893:2898] CHIP:DMG:
-          [1652341174.805497][2893:2898] CHIP:DMG:         InteractionModelRevision = 1
-          [1652341174.805555][2893:2898] CHIP:DMG: },
-          [1652341174.805690][2893:2898] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0
-          [1652341174.805786][2893:2898] CHIP:DMG: ICR moving to [AwaitingDe]
+    - label: "Waiting after opening commissioning window"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: waitAfterCommissioning
 
-          The delay timer is given 200 as an example , use whatever works for your product
-      disabled: true
+    - label:
+          "Check DNS-SD instance name must be 64-bit randomly selected ID
+          expressed as a sixteen-char hex string with capital letters and must
+          be different from the one at step 2"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "instanceName"
+                constraints:
+                    minLength: 16
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+                    notValue: deviceInstanceNameBeforeReboot
 
-    - label: "Check DNS-SD subtypes used by DUT"
-      PICS:
-          " MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR &&
-          MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.VP_KEY
-          && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY &&
-          MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && MCORE.SC.RI_KEY &&
-          MCORE.SC.PH_KEY && MCORE.SC.PI_KEY "
+    - label: "service type must be _matterc._udp"
       verification: |
           Run the below avahi browse command in  TH terminal
 
-           avahi-browse -rt _matterc._udp
+          avahi-browse -rt _matterc._udp
 
-          Verify on  the below output in TH terminal Log:
+          Verify the device is advertising _matterc._udp service like below output in TH terminal Log: (Verify for the DUT's actual values (like vendor ID, PID ..etc) as mentioned in the expected outcome of the test plan, The below log contains the data from the reference raspi accessory)
 
           +  wlan0 IPv6 F6385CBB29F7CE93                              _matterc._udp        local
           +   eth0 IPv6 F6385CBB29F7CE93                              _matterc._udp        local
           =   eth0 IPv6 F6385CBB29F7CE93                              _matterc._udp        local
-             hostname = [E45F010F1A010000.local]
-             address = [fe80::e65f:1ff:fe0f:1a01]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
+            hostname = [E45F010F1A010000.local]
+            address = [fe80::e65f:1ff:fe0f:1a01]
+            port = [5540]
+            txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
           =  wlan0 IPv6 F6385CBB29F7CE93                              _matterc._udp        local
-             hostname = [E45F010F1A010000.local]
-             address = [fe80::e65f:1ff:fe0f:1a01]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
-
-
-
-
+            hostname = [E45F010F1A010000.local]
+            address = [fe80::e65f:1ff:fe0f:1a01]
+            port = [5540]
+            txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"]
 
 
           Service Domain 422F10CDC290A406.local
@@ -205,17 +453,271 @@
           +;eth0;IPv6;_S15;_sub._matterc._udp;local
           +;eth0;IPv6;_L3840;_sub._matterc._udp;local
           +;eth0;IPv6;_CM;_sub._matterc._udp;local
-      disabled: true
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_SKIP_SAMPLE_APP
+      arguments:
+          values:
+              - name: "message"
+                value: "Enter 'y' after success"
+              - name: "expectedValue"
+                value: "y"
 
-    - label: "Wait for OBCW timeout to expire"
-      verification: |
-          Wait until open-basic-commissioning-window time to expire.
-      disabled: true
+    #validate the service type and the service domain not implemented in CI
+    - label:
+          "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target
+          hostname is derived from the 48bit or 64bit MAC address expressed as a
+          twelve or sixteen capital letter hex string"
+      PICS: "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    - label:
+          "Check Hostname. If (MCORE.COM.THR) target hostname is derived from
+          the 48bit or 64bit MAC address expressed as a twelve or sixteen
+          capital letter hex string"
+      PICS: "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    - label: "Check Long Discriminator _L"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByLongDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: discriminator
+
+    - label: "Check Short Discriminator (_S)"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByShortDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: shortDiscriminator
+
+    - label:
+          "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V<ddddd> is present
+          must be 16-bit vendor id, encoded as a variable-length decimal number
+          in ASCII text, omitting any leading zeros"
+      PICS: MCORE.SC.VENDOR_SUBTYPE
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByVendorId"
+      arguments:
+          values:
+              - name: "value"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present,
+          <ddd> represents device type from Data Model and must be represented
+          as a variable length decimal number in ASCII without leading zeros"
+      # The device type is not broadcasted by the accessory under CI.
+      PICS: MCORE.SC.DEVTYPE_SUBTYPE
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByDeviceType"
+      arguments:
+          values:
+              - name: "value"
+                value: deviceType
+
+    - label: "Check Commissioning Mode (_CM) subtype _CM is present"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByCommissioningMode"
+
+    - label:
+          "key D must be present and represents the discriminator which must be
+          encoded as a variable-length decimal value with up to 4 digits
+          omitting any leading zeros"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "longDiscriminator"
+                value: discriminator
+                constraints:
+                    minValue: 0
+                    maxValue: 4096
+
+    - label:
+          "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID
+          is present."
+      PICS: MCORE.SC.VP_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "vendorId"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID
+          is present."
+      PICS: MCORE.SC.VP_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "productId"
+                value: productId
+
+    - label:
+          "If (MCORE.SC.SII_OP_DISCOVERY_KEY ) present, SII key must be an
+          unsigned integer with units of milliseconds and shall be encoded as a
+          variable length decimal number in ASCII, omitting leading zeros. Shall
+          not exceed 3600000"
+      PICS: MCORE.SC.SII_OP_DISCOVERY_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalIdle"
+                constraints:
+                    maxValue: 3600000
+
+    - label:
+          "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an
+          unsigned integer with units of milliseconds and shall be encoded as a
+          variable length decimal number in ASCII, omitting leading zeros. Shall
+          not exceed 3600000."
+      PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalActive"
+                constraints:
+                    maxValue: 3600000
+
+    - label: "TXT key for commissioning mode (CM) key CM=1 must be present"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "commissioningMode"
+                value: 1
+
+    - label:
+          "If (MCORE.SC.DT_KEY) present, DT key must contain the device type
+          identifier from Data Model Device Types and must be encoded as a
+          variable length decimal ASCII number without leading zeros"
+      PICS: MCORE.SC.DT_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceType"
+                value: deviceType
+
+    - label:
+          "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string
+          with a maximum length of 32B"
+      PICS: MCORE.SC.DN_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceName"
+                constraints:
+                    maxLength: 32
+
+    - label:
+          "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device
+          Identifier encoded as a uppercase string with a maximum length of 100
+          chars"
+      PICS: MCORE.SC.RI_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "rotatingIdLen"
+                constraints:
+                    maxValue: 100
+
+    - label:
+          "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a
+          variable-length decimal number in ASCII text, omitting any leading
+          zeros. If present value must be different of 0"
+      PICS: MCORE.SC.PH_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingHint"
+                constraints:
+                    notValue: 0
+
+    - label:
+          "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8
+          string with a maximum length of 128 bytes"
+      PICS: MCORE.SC.PI_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingInstruction"
+                constraints:
+                    maxLength: 128
+
+    - label:
+          "DUT must publish AAAA records for each IPv6 address upon which they
+          are willing to accept Matter messages."
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "numIPs"
+                constraints:
+                    minValue: 1
+
+    - label: "Wait for OpenBasicCommissioningWindow timeout to expire"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: 180000
 
     - label:
           "DUT is Commissioned and instructed to enter in commissioning mode
           using Open Commissioning Window command"
-      PICS: CADMIN.S.C00.Rsp
+      cluster: "Administrator Commissioning"
+      command: "OpenCommissioningWindow"
+      timedInteractionTimeoutMs: 10000
+      PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY
+      arguments:
+          values:
+              - name: "CommissioningTimeout"
+                value: 180
+              - name: "PAKEPasscodeVerifier"
+                value: PakeVerifier
+              - name: "Discriminator"
+                value: discriminator
+              - name: "Iterations"
+                value: 1000
+              - name: "Salt"
+                value: "SPAKE2P Key Salt"
+
+    #Issue https://github.com/project-chip/connectedhomeip/issues/26127
+    - label:
+          "DUT is Commissioned and instructed to enter in commissioning mode
+          using Open Commissioning Window command"
       verification: |
           Run the below open-commissioning-window in TH Terminal
 
@@ -254,71 +756,538 @@
           [1652341411.385662][2929:2934] CHIP:DMG: },
           [1652341411.385794][2929:2934] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 Status=0x0
           [1652341411.385860][2929:2934] CHIP:CTL: Successfully opened pairing window on the device
-      disabled: true
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp
+      arguments:
+          values:
+              - name: "message"
+                value: "Enter 'y' after success"
+              - name: "expectedValue"
+                value: "y"
 
-    - label: "Check DNS-SD subtypes used by DUT"
-      PICS:
-          " MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR &&
-          MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.VP_KEY
-          && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY &&
-          MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && MCORE.SC.RI_KEY &&
-          MCORE.SC.PH_KEY && MCORE.SC.PI_KEY "
-      verification: |
-          Same verification steps as Step 3, Except Verify CM flag  value to be 2
+    - label: "Waiting after opening commissioning window"
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: waitAfterCommissioning
 
+    - label:
+          "DNS-SD instance name must be 64-bit randomly selected ID expressed as
+          a sixteen-char hex string with capital letters"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "instanceName"
+                constraints:
+                    minLength: 16
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
 
-          ubuntu@ubuntu:~$ avahi-browse -rt _matterc._udp
+    #validate the service type and the service domain not implemented in CI
 
-          Verify on  the below output in TH terminal Log:
+    - label:
+          "Check Hostname.If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname
+          is derived from the 48bit or 64bit MAC address expressed as a twelve
+          or sixteen capital letter hex string."
+      # On macOS the hostname is the device name and because of it this test is disabled for now.
+      PICS: "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
 
+    - label:
+          "Check Hostname. If (MCORE.COM.THR) target hostname is derived from
+          the 48bit or 64bit MAC extended address expressed as a twelve or
+          sixteen capital letter hex string."
+      # On macOS the hostname is the device name and because of it this test is disabled for now.
+      PICS: "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
 
+    - label: "Check Long Discriminator _L"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByLongDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: discriminator
 
-          +  wlan0 IPv6 71DED0325CF9AB38                              _matterc._udp        local
-          +   eth0 IPv6 71DED0325CF9AB38                              _matterc._udp        local
-          =   eth0 IPv6 71DED0325CF9AB38                              _matterc._udp        local
-             hostname = [E45F010F1A010000.local]
-             address = [fe80::e65f:1ff:fe0f:1a01]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "VP=65521+32769"]
-          =  wlan0 IPv6 71DED0325CF9AB38                              _matterc._udp        local
-             hostname = [E45F010F1A010000.local]
-             address = [fe80::e65f:1ff:fe0f:1a01]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "VP=65521+32769"]
-      disabled: true
+    - label: "Check Short Discriminator (_S)"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByShortDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: shortDiscriminator
+
+    - label:
+          "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V<ddddd> is present
+          must be 16-bit vendor id, encoded as a variable-length decimal number
+          in ASCII text, omitting any leading zeros"
+      PICS: MCORE.SC.VENDOR_SUBTYPE
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByVendorId"
+      arguments:
+          values:
+              - name: "value"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present,
+          <ddd> represents device type from Data Model and must be represented
+          as a variable length decimal number in ASCII without leading zeros"
+      # The device type is not broadcasted by the accessory under CI.
+      PICS: MCORE.SC.VENDOR_SUBTYPE
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByDeviceType"
+      arguments:
+          values:
+              - name: "value"
+                value: deviceType
+
+    - label: "Check Commissioning Mode (_CM) subtype _CM is present"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByCommissioningMode"
+
+    - label:
+          "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Vendor ID
+          is present."
+      PICS: MCORE.SC.VP_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "vendorId"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Product
+          ID is present"
+      PICS: MCORE.SC.VP_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "productId"
+                value: productId
+
+    - label:
+          "Optional TXT key for MRP Retry Interval Idle. if
+          (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned
+          integer with units of milliseconds and shall be encoded as a variable
+          length decimal number in ASCII, omitting leading zeros. Shall not
+          exceed 3600000"
+      PICS: MCORE.SC.SII_OP_DISCOVERY_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalIdle"
+                constraints:
+                    maxValue: 3600000
+
+    - label:
+          "Optional TXT key for MRP Retry Interval Active. if
+          (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned
+          integer with units of milliseconds and shall be encoded as a variable
+          length decimal number in ASCII, omitting leading zeros. Shall not
+          exceed 3600000."
+      PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalActive"
+                constraints:
+                    maxValue: 3600000
+
+    - label: "TXT key for commissioning mode. CM=2 must be present"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "commissioningMode"
+                value: 2
+
+    - label:
+          "If (MCORE.SC.DT_KEY) present, DT key must contain the device type
+          identifier from Data Model Device Types and must be encoded as a
+          variable length decimal ASCII number without leading zeros"
+      PICS: MCORE.SC.DT_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceType"
+                value: deviceType
+
+    - label:
+          "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string
+          with a maximum length of 32B"
+      PICS: MCORE.SC.DN_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceName"
+                constraints:
+                    maxLength: 32
+
+    - label:
+          "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device
+          Identifier encoded as a uppercase string with a maximum length of 100
+          chars"
+      PICS: MCORE.SC.RI_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "rotatingIdLen"
+                constraints:
+                    maxValue: 100
+
+    - label:
+          "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a
+          variable-length decimal number in ASCII text, omitting any leading
+          zeros. If present value must be different of 0"
+      PICS: MCORE.SC.PH_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingHint"
+                constraints:
+                    notValue: 0
+
+    - label:
+          "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8
+          string with a maximum length of 128 bytes"
+      PICS: MCORE.SC.PI_KEY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingInstruction"
+                constraints:
+                    maxLength: 128
+
+    - label:
+          "DUT must publish AAAA records for each IPv6 address upon which they
+          are willing to accept Matter messages"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "numIPs"
+                constraints:
+                    minValue: 1
 
     - label: "Wait for OCW timeout to expire"
-      verification: |
-          Wait until open-commissioning-window time to expire.
-      disabled: true
+      cluster: "DelayCommands"
+      command: "WaitForMs"
+      arguments:
+          values:
+              - name: "ms"
+                value: 180000
 
-    - label: "If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery"
-      PICS: MCORE.SC.EXTENDED_DISCOVERY
+    - label:
+          "If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery. DUT
+          should start to send Commissionable Node Discovery DNS-SD
+          advertisements"
       verification: |
           If the device supports Discovery for an extended period of time, the Device should continue to advertise. Use the avahi-browse command and you should see the _matterc._udp advertisement
 
-
           Reference Raspberrypi device is not supporting extended discovery.
-      disabled: true
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY
+      arguments:
+          values:
+              - name: "message"
+                value: "Enter 'y' after success"
+              - name: "expectedValue"
+                value: "y"
 
     - label:
-          "If (MCORE.SC.EXTENDED_DISCOVERY ) check DNS-SD subtypes used by DUT"
-      PICS:
-          " MCORE.SC.EXTENDED_DISCOVERY && MCORE.COM.WIFI && MCORE.COM.ETH &&
-          MCORE.COM.THR && MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE
-          && MCORE.SC.VP_KEY && MCORE.SC.SII_OP_DISCOVERY_KEY &&
-          MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.DT_KEY && MCORE.SC.DN_KEY &&
-          MCORE.SC.RI_KEY && MCORE.SC.PH_KEY && MCORE.SC.PI_KEY "
+          "Check DNS-SD instance name must be 64-bit randomly selected ID
+          expressed as a sixteen-char hex string with capital letters"
+      PICS: MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "instanceName"
+                constraints:
+                    minLength: 16
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    - label: "service type must be _matterc._udp"
       verification: |
           Run and Verify on  the below output in TH terminal Log: (Below is the sample log , as RPI doesn't support the extended discovery)
           Verify the CM flag value is 0
 
           avahi-browse -rt _matterc._udp
+          Verify the device is advertising _matterc._udp service like below output in TH terminal Log: (Verify for the DUT's actual values (like vendor ID, PID ..etc) as mentioned in the expected outcome of the test plan, The below log contains the data from the reference raspi accessory)
 
           + wlp0s20f3 IPv6 FD37FE5156C56632                              _matterc._udp        local
           = wlp0s20f3 IPv6 FD37FE5156C56632                              _matterc._udp        local
-             hostname = [8C1D96786A130000.local]
-             address = [fe80::e9f6:2c08:2794:357d]
-             port = [5540]
-             txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "DT=65535" "VP=65521+32769"]
-      disabled: true
+            hostname = [8C1D96786A130000.local]
+            address = [fe80::e9f6:2c08:2794:357d]
+            port = [5540]
+            txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "DT=65535" "VP=65521+32769"]
+      cluster: "LogCommands"
+      command: "UserPrompt"
+      PICS: PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY
+      arguments:
+          values:
+              - name: "message"
+                value: "Enter 'y' after success"
+              - name: "expectedValue"
+                value: "y"
+
+    #validate the service type and the service domain
+
+    - label:
+          "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target
+          hostname is derived from the 48bit or 64bit MAC address expressed as a
+          twelve or sixteen capital letter hex string"
+      # On macOS the hostname is the device name and because of it this test is disabled for now.
+      PICS:
+          "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR &&
+          MCORE.SC.EXTENDED_DISCOVERY"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    - label:
+          "Check Hostname. If (MCORE.COM.THR) target hostname is derived from
+          the 48bit or 64bit MAC extended address expressed as a twelve or
+          sixteen capital letter hex string."
+      # On macOS the hostname is the device name and because of it this test is disabled for now.
+      PICS:
+          "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR &&
+          MCORE.SC.EXTENDED_DISCOVERY"
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "hostName"
+                constraints:
+                    minLength: 12
+                    maxLength: 16
+                    isUpperCase: true
+                    isHexString: true
+
+    # Commissioning Subtypes
+
+    - label: "Check Long Discriminator _L"
+      PICS: MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByLongDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: discriminator
+
+    - label: "Check Short Discriminator (_S)"
+      PICS: MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByShortDiscriminator"
+      arguments:
+          values:
+              - name: "value"
+                value: shortDiscriminator
+
+    - label:
+          "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V<ddddd> is present
+          must be 16-bit vendor id, encoded as a variable-length decimal number
+          in ASCII text, omitting any leading zeros"
+      PICS: MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByVendorId"
+      arguments:
+          values:
+              - name: "value"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present,
+          <ddd> represents device type from Data Model and must be represented
+          as a variable length decimal number in ASCII without leading zeros"
+      # The device type is not broadcasted by the accessory under CI.
+      PICS: MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByDeviceType"
+      arguments:
+          values:
+              - name: "value"
+                value: deviceType
+
+    - label: "Check Commissioning Mode (_CM)"
+      PICS: MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionableByCommissioningMode"
+
+    # TXT Records
+
+    - label: "TXT key for discriminator (D)"
+      PICS: MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "longDiscriminator"
+                value: discriminator
+                constraints:
+                    minValue: 0
+                    maxValue: 4096
+
+    - label:
+          "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID
+          is present"
+      PICS: MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "vendorId"
+                value: vendorId
+
+    - label:
+          "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID
+          is present"
+      PICS: MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "productId"
+                value: productId
+
+    - label:
+          "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an
+          unsigned integer with units of milliseconds and shall be encoded as a
+          variable length decimal number in ASCII, omitting leading zeros. Shall
+          not exceed 3600000."
+      PICS: MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalIdle"
+                constraints:
+                    maxValue: 3600000
+
+    - label:
+          "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an
+          unsigned integer with units of milliseconds and shall be encoded as a
+          variable length decimal number in ASCII, omitting leading zeros. Shall
+          not exceed 3600000."
+      PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "mrpRetryIntervalActive"
+                constraints:
+                    maxValue: 3600000
+
+    - label: "TXT key for commissioning mode (CM), CM=0 may be present"
+      PICS: MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "commissioningMode"
+                value: 0
+
+    - label:
+          "If (MCORE.SC.DT_KEY) present, DT key must contain the device type
+          identifier from Data Model Device Types and must be encoded as a
+          variable length decimal ASCII number without leading zeros"
+      PICS: MCORE.SC.DT_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceType"
+                value: deviceType
+
+    - label:
+          "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string
+          with a maximum length of 32B"
+      PICS: MCORE.SC.DN_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "deviceName"
+                constraints:
+                    maxLength: 32
+
+    - label:
+          "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device
+          Identifier encoded as a uppercase string with a maximum length of 100
+          chars"
+      PICS: MCORE.SC.RI_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "rotatingIdLen"
+                constraints:
+                    maxValue: 100
+
+    - label:
+          "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a
+          variable-length decimal number in ASCII text, omitting any leading
+          zeros. If present value must be different of 0"
+      PICS: MCORE.SC.PH_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingHint"
+                constraints:
+                    notValue: 0
+
+    - label:
+          "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8
+          string with a maximum length of 128 bytes"
+      PICS: MCORE.SC.PI_KEY && MCORE.SC.EXTENDED_DISCOVERY
+      cluster: "DiscoveryCommands"
+      command: "FindCommissionable"
+      response:
+          values:
+              - name: "pairingInstruction"
+                constraints:
+                    maxLength: 128
diff --git a/src/app/tests/suites/certification/Test_TC_TIMESYNC_2_3.yaml b/src/app/tests/suites/certification/Test_TC_TIMESYNC_2_3.yaml
new file mode 100644
index 0000000..8e4821d
--- /dev/null
+++ b/src/app/tests/suites/certification/Test_TC_TIMESYNC_2_3.yaml
@@ -0,0 +1,85 @@
+# 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.
+
+name: 142.2.3. [TC-TIMESYNC-2.3] SetTrustedTimeSource command with DUT as Server
+
+PICS:
+    - TIMESYNC.S
+    - TIMESYNC.S.F03
+    - TIMESYNC.S.C01.Rsp
+    - TIMESYNC.S.C00.Rsp
+    - TIMESYNC.S.A0001
+    - TIMESYNC.S.A0000
+
+config:
+    nodeId: 0x12344321
+    cluster: "Time Synchronization"
+    endpoint: 0
+
+tests:
+    - label: "Step 0: Wait for the commissioned device to be retrieved"
+      cluster: "DelayCommands"
+      command: "WaitForCommissionee"
+      arguments:
+          values:
+              - name: "nodeId"
+                value: nodeId
+
+    - label: "Read commissioner nodeID and saves as th_node_id"
+      cluster: "CommissionerCommands"
+      command: "GetCommissionerNodeId"
+      response:
+          values:
+              - name: "nodeId"
+                saveAs: th_node_id
+
+    - label:
+          "Step 1: TH sends the SetTrustedTimeSource command to the DUT with the
+          TrustedTimeSource fields set as follows: NodeID: th_node_id, Endpoint:
+          0"
+      command: "SetTrustedTimeSource"
+      arguments:
+          values:
+              - name: "TrustedTimeSource"
+                value: { NodeID: th_node_id, Endpoint: 0 }
+
+    - label:
+          "Step 2: TH reads from the DUT the CurrentFabricIndex attribute from
+          the Node Operational Credentials Cluster and saves as th_fabric_idx"
+      command: "readAttribute"
+      attribute: "CurrentFabricIndex"
+      cluster: "Operational Credentials"
+      response:
+          saveAs: th_fabric_idx
+
+    - label: "Step 3: TH reads from the DUT the TrustedTimeSource attribute."
+      command: "readAttribute"
+      attribute: "TrustedTimeSource"
+      response:
+          value: { FabricIndex: th_fabric_idx, NodeID: th_node_id, Endpoint: 0 }
+
+    - label:
+          "Step 4: TH sends the SetTrustedTimeSource command to the DUT with the
+          TrustedTimeSource set to null."
+      command: "SetTrustedTimeSource"
+      arguments:
+          values:
+              - name: "TrustedTimeSource"
+                value: null
+
+    - label: "Step 5: TH reads from the DUT the TrustedTimeSource attribute."
+      command: "readAttribute"
+      attribute: "TrustedTimeSource"
+      response:
+          value: null
diff --git a/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml
index 6e854e8..01c6a6b 100644
--- a/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml
@@ -36,21 +36,21 @@
       command: "readAttribute"
       attribute: "MinMeasuredValue"
       response:
-          saveAs: MinMeasuredValue
+          saveAs: CurrentMinMeasured
           constraints:
               type: int16s
               minValue: -27315
-              maxValue: 32767
+              maxValue: 32766
 
     - label: "Read the mandatory attribute: MaxMeasuredValue"
       PICS: TMP.S.A0002
       command: "readAttribute"
       attribute: "MaxMeasuredValue"
       response:
-          saveAs: MaxMeasuredValue
+          saveAs: CurrentMaxMeasured
           constraints:
               type: int16s
-              minValue: -27314
+              minValue: CurrentMinMeasured
               maxValue: 32767
 
     - label: "Read the mandatory attribute: MeasuredValue"
@@ -60,8 +60,8 @@
       response:
           constraints:
               type: int16s
-              minValue: MinMeasuredValue
-              maxValue: MaxMeasuredValue
+              minValue: CurrentMinMeasured
+              maxValue: CurrentMaxMeasured
 
     - label: "Read the optional attribute: Tolerance"
       PICS: TMP.S.A0003
diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values
index 1feac17..0264ad8 100644
--- a/src/app/tests/suites/certification/ci-pics-values
+++ b/src/app/tests/suites/certification/ci-pics-values
@@ -1061,9 +1061,9 @@
 MCORE.DD.SCAN_QR_CODE=1
 MCORE.COM.WIRELESS=1
 MCORE.COM.BLE=1
-MCORE.COM.WIFI=1
+MCORE.COM.WIFI=0
 MCORE.COM.ETH=1
-MCORE.COM.THR=1
+MCORE.COM.THR=0
 MCORE.DD.TXT_KEY_VP=1
 MCORE.DD.TXT_KEY_DT=1
 MCORE.DD.DISCOVERY_BLE=1
@@ -1998,7 +1998,7 @@
 MCORE.SC.RI_KEY=0
 MCORE.SC.PH_KEY=1
 MCORE.SC.PI_KEY=1
-MCORE.SC.EXTENDED_DISCOVERY=1
+MCORE.SC.EXTENDED_DISCOVERY=0
 MCORE.SC.SED=1
 MCORE.SC.ADV=1
 MCORE.ROLE.COMMISSIONEE=1
@@ -2608,3 +2608,33 @@
 
 #Server commands
 FAN.S.C00.Rsp=1
+
+#ICD Management
+
+#Server Attribute
+ICDM.S.A0000=1
+ICDM.S.A0001=1
+ICDM.S.A0002=1
+ICDM.S.A0003=1
+ICDM.S.A0004=1
+ICDM.S.A0005=1
+
+#Features
+ICDM.S.F00=1
+
+#Commands
+ICDM.S.C03.Rsp=1
+
+#RVC Clean Mode Select
+RVCCLEANMS.S.F00=1
+RVCCLEANMS.S.F01=0
+RVCCLEANMS.S.F02=0
+
+#Attributes:
+RVCCLEANMS.S.A0004=1
+RVCCLEANMS.S.A0005=1
+
+#Commands:
+RVCCLEANMS.S.C00.Rsp=1
+RVCCLEANMS.S.C01.Rsp=1
+RVCCLEANMS.S.C03.Tx=1
\ No newline at end of file
diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json
index 818a917..3018879 100644
--- a/src/app/tests/suites/ciTests.json
+++ b/src/app/tests/suites/ciTests.json
@@ -71,6 +71,7 @@
     ],
     "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"],
     "GeneralDiagnostics": ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"],
+    "IcdManagement": ["Test_TC_ICDM_1_1", "Test_TC_ICDM_2_1"],
     "Identify": [
         "Test_TC_I_1_1",
         "Test_TC_I_2_1",
@@ -145,7 +146,10 @@
         "Test_TC_APBSC_9_1",
         "Test_TC_CONTENTLAUNCHER_10_1",
         "Test_TC_WAKEONLAN_4_1",
-        "Test_TC_ALOGIN_12_1"
+        "Test_TC_ALOGIN_12_1",
+        "Test_TC_CONTENTLAUNCHER_10_3",
+        "Test_TC_CONTENTLAUNCHER_10_5",
+        "Test_TC_CONTENTLAUNCHER_10_7"
     ],
     "ModeSelect": ["Test_TC_MOD_1_1"],
     "MultipleFabrics": [],
@@ -187,7 +191,7 @@
         "Test_TC_DGTHREAD_2_3",
         "Test_TC_DGTHREAD_2_4"
     ],
-    "TimeSynchronization": ["Test_TC_TIMESYNC_1_1"],
+    "TimeSynchronization": ["Test_TC_TIMESYNC_1_1", "Test_TC_TIMESYNC_2_3"],
     "WiFiNetworkDiagnostics": [
         "Test_TC_DGWIFI_1_1",
         "Test_TC_DGWIFI_2_1",
@@ -352,6 +356,7 @@
         "FanControl",
         "GeneralCommissioning",
         "GeneralDiagnostics",
+        "IcdManagement",
         "Identify",
         "IlluminanceMeasurement",
         "LevelControl",
diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json
index ab02c78..5fd2b51 100644
--- a/src/app/tests/suites/manualTests.json
+++ b/src/app/tests/suites/manualTests.json
@@ -145,10 +145,7 @@
         "Test_TC_MEDIAPLAYBACK_6_7",
         "Test_TC_AUDIOOUTPUT_7_3",
         "Test_TC_AUDIOOUTPUT_7_4",
-        "Test_TC_CONTENTLAUNCHER_10_3",
         "Test_TC_CONTENTLAUNCHER_10_4",
-        "Test_TC_CONTENTLAUNCHER_10_5",
-        "Test_TC_CONTENTLAUNCHER_10_7",
         "Test_TC_MC_11_1",
         "Test_TC_MC_11_2",
         "Test_TC_ALOGIN_12_2",
diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h
index 4b025cf..c9aeac7 100644
--- a/zzz_generated/chip-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h
@@ -123,6 +123,8 @@
         printf("Test_TC_CGEN_2_1\n");
         printf("Test_TC_DGGEN_1_1\n");
         printf("Test_TC_DGGEN_2_1\n");
+        printf("Test_TC_ICDM_1_1\n");
+        printf("Test_TC_ICDM_2_1\n");
         printf("Test_TC_I_1_1\n");
         printf("Test_TC_I_2_1\n");
         printf("Test_TC_I_2_2\n");
@@ -180,6 +182,9 @@
         printf("Test_TC_CONTENTLAUNCHER_10_1\n");
         printf("Test_TC_WAKEONLAN_4_1\n");
         printf("Test_TC_ALOGIN_12_1\n");
+        printf("Test_TC_CONTENTLAUNCHER_10_3\n");
+        printf("Test_TC_CONTENTLAUNCHER_10_5\n");
+        printf("Test_TC_CONTENTLAUNCHER_10_7\n");
         printf("Test_TC_MOD_1_1\n");
         printf("OTA_SuccessfulTransfer\n");
         printf("Test_TC_OCC_1_1\n");
@@ -220,6 +225,7 @@
         printf("Test_TC_DGTHREAD_2_3\n");
         printf("Test_TC_DGTHREAD_2_4\n");
         printf("Test_TC_TIMESYNC_1_1\n");
+        printf("Test_TC_TIMESYNC_2_3\n");
         printf("Test_TC_ULABEL_1_1\n");
         printf("Test_TC_ULABEL_2_1\n");
         printf("Test_TC_ULABEL_2_2\n");
@@ -472,10 +478,7 @@
         printf("Test_TC_MEDIAPLAYBACK_6_7\n");
         printf("Test_TC_AUDIOOUTPUT_7_3\n");
         printf("Test_TC_AUDIOOUTPUT_7_4\n");
-        printf("Test_TC_CONTENTLAUNCHER_10_3\n");
         printf("Test_TC_CONTENTLAUNCHER_10_4\n");
-        printf("Test_TC_CONTENTLAUNCHER_10_5\n");
-        printf("Test_TC_CONTENTLAUNCHER_10_7\n");
         printf("Test_TC_MC_11_1\n");
         printf("Test_TC_MC_11_2\n");
         printf("Test_TC_ALOGIN_12_2\n");
@@ -18207,11 +18210,12 @@
 class Test_TC_CC_6_1Suite : public TestCommand
 {
 public:
-    Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 21, credsIssuerConfig)
+    Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 22, credsIssuerConfig)
     {
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
         AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
     }
 
@@ -18226,6 +18230,7 @@
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mConfigWait;
     chip::Optional<uint16_t> mTimeout;
 
     uint16_t ColorTempPhysicalMinMiredsValue;
@@ -18372,6 +18377,10 @@
             break;
         case 20:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 21:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             {
                 bool value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
@@ -18553,7 +18562,14 @@
             );
         }
         case 20: {
-            LogStep(20, "Check on/off attribute value is false after off command");
+            LogStep(20, "Wait to turn Off light");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 21: {
+            LogStep(21, "Check on/off attribute value is false after off command");
             VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
             return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional);
         }
@@ -18565,11 +18581,12 @@
 class Test_TC_CC_6_2Suite : public TestCommand
 {
 public:
-    Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 32, credsIssuerConfig)
+    Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 33, credsIssuerConfig)
     {
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
         AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
     }
 
@@ -18584,6 +18601,7 @@
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mConfigWait;
     chip::Optional<uint16_t> mTimeout;
 
     uint16_t ColorTempPhysicalMinMiredsValue;
@@ -18793,6 +18811,10 @@
             break;
         case 31:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 32:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             {
                 bool value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
@@ -19088,7 +19110,14 @@
             );
         }
         case 31: {
-            LogStep(31, "Check on/off attribute value is false after off command");
+            LogStep(31, "Wait to turn Off light");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 32: {
+            LogStep(32, "Check on/off attribute value is false after off command");
             VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
             return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional);
         }
@@ -19100,11 +19129,12 @@
 class Test_TC_CC_6_3Suite : public TestCommand
 {
 public:
-    Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 26, credsIssuerConfig)
+    Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 27, credsIssuerConfig)
     {
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
         AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
     }
 
@@ -19119,6 +19149,7 @@
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mConfigWait;
     chip::Optional<uint16_t> mTimeout;
 
     uint16_t ColorTempPhysicalMinMiredsValue;
@@ -19295,6 +19326,10 @@
             break;
         case 25:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 26:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             {
                 bool value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
@@ -19529,7 +19564,14 @@
             );
         }
         case 25: {
-            LogStep(25, "Check on/off attribute value is false after off command");
+            LogStep(25, "Wait to turn Off light");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 26: {
+            LogStep(26, "Check on/off attribute value is false after off command");
             VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
             return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional);
         }
@@ -19541,11 +19583,12 @@
 class Test_TC_CC_6_5Suite : public TestCommand
 {
 public:
-    Test_TC_CC_6_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_5", 17, credsIssuerConfig)
+    Test_TC_CC_6_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_5", 20, credsIssuerConfig)
     {
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
         AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
     }
 
@@ -19560,6 +19603,7 @@
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mConfigWait;
     chip::Optional<uint16_t> mTimeout;
 
     chip::app::DataModel::Nullable<uint16_t> StartUpColorTemperatureMiredsValue;
@@ -19702,6 +19746,21 @@
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U));
             }
             break;
+        case 17:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 18:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 19:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                bool value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("onOff", value, 0));
+            }
+            break;
         default:
             LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
         }
@@ -19845,6 +19904,27 @@
             return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id,
                                  true, chip::NullOptional);
         }
+        case 17: {
+            LogStep(17, "Turn Off light that we turned on");
+            VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::OnOff::Commands::Off::Type value;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional
+
+            );
+        }
+        case 18: {
+            LogStep(18, "Wait to turn Off light");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 19: {
+            LogStep(19, "Check on/off attribute value is false after off command");
+            VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional);
+        }
         }
         return CHIP_NO_ERROR;
     }
@@ -35448,6 +35528,9 @@
     chip::Optional<chip::EndpointId> mEndpoint;
     chip::Optional<uint16_t> mTimeout;
 
+    chip::app::DataModel::Nullable<uint16_t> MinMeasuredVariable;
+    chip::app::DataModel::Nullable<uint16_t> MaxMeasuredVariable;
+
     chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
 
     //
@@ -35472,6 +35555,7 @@
                 VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
                 VerifyOrReturn(CheckConstraintMinValue("value", value, 0U));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 65533U));
+                MinMeasuredVariable = value;
             }
             break;
         case 2:
@@ -35480,8 +35564,9 @@
                 chip::app::DataModel::Nullable<uint16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, 0U));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredVariable));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U));
+                MaxMeasuredVariable = value;
             }
             break;
         case 3:
@@ -35490,8 +35575,8 @@
                 chip::app::DataModel::Nullable<uint16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, 0U));
-                VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredVariable));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredVariable));
             }
             break;
         case 4:
@@ -38180,6 +38265,426 @@
     }
 };
 
+class Test_TC_ICDM_1_1Suite : public TestCommand
+{
+public:
+    Test_TC_ICDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_1_1", 13, credsIssuerConfig)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+
+    ~Test_TC_ICDM_1_1Suite() {}
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mTimeout;
+
+    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+    //
+    // Tests methods
+    //
+
+    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+    {
+        bool shouldContinue = false;
+
+        switch (mTestIndex - 1)
+        {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint16_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("clusterRevision", value, 1U));
+                VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
+            }
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint32_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("featureMap", value, 1UL));
+                VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32"));
+            }
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint32_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("featureMap", value, 0UL));
+                VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32"));
+            }
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::AttributeId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 0UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 1UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 2UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 65528UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 65529UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 65530UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 65531UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 65532UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 65533UL));
+            }
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::AttributeId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 3UL));
+            }
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::AttributeId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 4UL));
+            }
+            break;
+        case 7:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::AttributeId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 5UL));
+            }
+            break;
+        case 8:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::EventId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                {
+                    auto iter_0 = value.begin();
+                    VerifyOrReturn(CheckNoMoreListItems<decltype(value)>("eventList", iter_0, 0));
+                }
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+            }
+            break;
+        case 9:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::CommandId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 0UL));
+                VerifyOrReturn(CheckConstraintContains("value", value, 2UL));
+            }
+            break;
+        case 10:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::CommandId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 3UL));
+            }
+            break;
+        case 11:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::CommandId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                {
+                    auto iter_0 = value.begin();
+                    VerifyOrReturn(CheckNoMoreListItems<decltype(value)>("generatedCommandList", iter_0, 0));
+                }
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+            }
+            break;
+        case 12:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<chip::CommandId> value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+                VerifyOrReturn(CheckConstraintContains("value", value, 1UL));
+            }
+            break;
+        default:
+            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+        }
+
+        if (shouldContinue)
+        {
+            ContinueOnChipMainThread(CHIP_NO_ERROR);
+        }
+    }
+
+    CHIP_ERROR DoTestStep(uint16_t testIndex) override
+    {
+        using namespace chip::app::Clusters;
+        switch (testIndex)
+        {
+        case 0: {
+            LogStep(0, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(1, "Read the global attribute: ClusterRevision");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ClusterRevision::Id,
+                                 true, chip::NullOptional);
+        }
+        case 2: {
+            LogStep(2, "Read the global attribute: FeatureMap");
+            VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::FeatureMap::Id, true,
+                                 chip::NullOptional);
+        }
+        case 3: {
+            LogStep(3, "Read the global attribute: FeatureMap");
+            VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::FeatureMap::Id, true,
+                                 chip::NullOptional);
+        }
+        case 4: {
+            LogStep(4, "Read the global attribute: AttributeList");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id,
+                                 true, chip::NullOptional);
+        }
+        case 5: {
+            LogStep(5, "Read the optional attribute(RegisteredClients) in AttributeList");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id,
+                                 true, chip::NullOptional);
+        }
+        case 6: {
+            LogStep(6, "Read the optional attribute(IcdCounter) in AttributeList");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id,
+                                 true, chip::NullOptional);
+        }
+        case 7: {
+            LogStep(7, "Read the optional attribute(ClientsSupportedPerFabric) in AttributeList");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id,
+                                 true, chip::NullOptional);
+        }
+        case 8: {
+            LogStep(8, "Read the global attribute: EventList");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::EventList::Id, true,
+                                 chip::NullOptional);
+        }
+        case 9: {
+            LogStep(9, "Read the global attribute: AcceptedCommandList");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional);
+        }
+        case 10: {
+            LogStep(10, "Read the optional command (StayActiveRequest) in AttributeList");
+            VerifyOrDo(!ShouldSkip("ICDM.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional);
+        }
+        case 11: {
+            LogStep(11, "Read the global attribute: GeneratedCommandList");
+            VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional);
+        }
+        case 12: {
+            LogStep(12, "Read the global attribute: GeneratedCommandList");
+            VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional);
+        }
+        }
+        return CHIP_NO_ERROR;
+    }
+};
+
+class Test_TC_ICDM_2_1Suite : public TestCommand
+{
+public:
+    Test_TC_ICDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_2_1", 7, credsIssuerConfig)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+
+    ~Test_TC_ICDM_2_1Suite() {}
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mTimeout;
+
+    uint32_t IdleModeIntervalValue;
+
+    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+    //
+    // Tests methods
+    //
+
+    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+    {
+        bool shouldContinue = false;
+
+        switch (mTestIndex - 1)
+        {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint32_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u"));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, 500UL));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, 64800000UL));
+                IdleModeIntervalValue = value;
+            }
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint32_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u"));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, 300UL));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, IdleModeIntervalValue));
+            }
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint16_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, 300U));
+            }
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::DecodableList<
+                    chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType>
+                    value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "list", "list"));
+            }
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint32_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u"));
+            }
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint16_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, 1U));
+            }
+            break;
+        default:
+            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+        }
+
+        if (shouldContinue)
+        {
+            ContinueOnChipMainThread(CHIP_NO_ERROR);
+        }
+    }
+
+    CHIP_ERROR DoTestStep(uint16_t testIndex) override
+    {
+        using namespace chip::app::Clusters;
+        switch (testIndex)
+        {
+        case 0: {
+            LogStep(0, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(1, "TH reads from the DUT the IdleModeInterval attribute");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::IdleModeInterval::Id,
+                                 true, chip::NullOptional);
+        }
+        case 2: {
+            LogStep(2, "TH reads from the DUT the ActiveModeInterval attribute");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::ActiveModeInterval::Id, true, chip::NullOptional);
+        }
+        case 3: {
+            LogStep(3, "TH reads from the DUT the ActiveModeThreshold attribute");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::ActiveModeThreshold::Id, true, chip::NullOptional);
+        }
+        case 4: {
+            LogStep(4, "TH reads from the DUT the RegisteredClients attribute");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional);
+        }
+        case 5: {
+            LogStep(5, "TH reads from the DUT the IcdCounter attribute");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ICDCounter::Id, true,
+                                 chip::NullOptional);
+        }
+        case 6: {
+            LogStep(6, "TH reads from the DUT the ClientsSupportedPerFabric attribute");
+            VerifyOrDo(!ShouldSkip("ICDM.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id,
+                                 IcdManagement::Attributes::ClientsSupportedPerFabric::Id, true, chip::NullOptional);
+        }
+        }
+        return CHIP_NO_ERROR;
+    }
+};
+
 class Test_TC_I_1_1Suite : public TestCommand
 {
 public:
@@ -49010,7 +49515,11 @@
             break;
         case 14:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
-            shouldContinue = true;
+            {
+                float value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("playbackSpeed", value, -1.0f));
+            }
             break;
         case 15:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
@@ -49026,7 +49535,11 @@
             break;
         case 17:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
-            shouldContinue = true;
+            {
+                float value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("playbackSpeed", value, -2.0f));
+            }
             break;
         case 18:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
@@ -49195,15 +49708,10 @@
         }
         case 14: {
             LogStep(14, "Reads the PlaybackSpeed attribute from the DUT");
-            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"),
+            VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"),
                        return ContinueOnChipMainThread(CHIP_NO_ERROR));
-            ListFreer listFreer;
-            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
-            value.message =
-                chip::Span<const char>("Please enter 'y' if PlaybackSpeed value is -1garbage: not in length on purpose", 45);
-            value.expectedValue.Emplace();
-            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
-            return UserPrompt(kIdentityAlpha, value);
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id,
+                                 true, chip::NullOptional);
         }
         case 15: {
             LogStep(15, "Sends a Rewind command to the DUT");
@@ -49228,15 +49736,10 @@
         }
         case 17: {
             LogStep(17, "Reads the PlaybackSpeed attribute from the DUT");
-            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"),
+            VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"),
                        return ContinueOnChipMainThread(CHIP_NO_ERROR));
-            ListFreer listFreer;
-            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
-            value.message =
-                chip::Span<const char>("Please enter 'y' if PlaybackSpeed value is -2garbage: not in length on purpose", 45);
-            value.expectedValue.Emplace();
-            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
-            return UserPrompt(kIdentityAlpha, value);
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id,
+                                 true, chip::NullOptional);
         }
         case 18: {
             LogStep(18, "Sends a Play command");
@@ -50217,6 +50720,1211 @@
     }
 };
 
+class Test_TC_CONTENTLAUNCHER_10_3Suite : public TestCommand
+{
+public:
+    Test_TC_CONTENTLAUNCHER_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) :
+        TestCommand("Test_TC_CONTENTLAUNCHER_10_3", 5, credsIssuerConfig)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("data", &mData);
+        AddArgument("SearchValue", &mSearchValue);
+        AddArgument("ExternalIdName", &mExternalIdName);
+        AddArgument("ExternalIdValue", &mExternalIdValue);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+
+    ~Test_TC_CONTENTLAUNCHER_10_3Suite() {}
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<chip::CharSpan> mData;
+    chip::Optional<chip::CharSpan> mSearchValue;
+    chip::Optional<chip::CharSpan> mExternalIdName;
+    chip::Optional<chip::CharSpan> mExternalIdValue;
+    chip::Optional<uint16_t> mTimeout;
+
+    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+    //
+    // Tests methods
+    //
+
+    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+    {
+        bool shouldContinue = false;
+
+        switch (mTestIndex - 1)
+        {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+                VerifyOrReturn(CheckValuePresent("data", value.data));
+                VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(),
+                                                  mData.HasValue() ? mData.Value() : chip::Span<const char>("exampleData", 11)));
+            }
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+                VerifyOrReturn(CheckValuePresent("data", value.data));
+                VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(),
+                                                  mData.HasValue() ? mData.Value() : chip::Span<const char>("exampleData", 11)));
+            }
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        default:
+            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+        }
+
+        if (shouldContinue)
+        {
+            ContinueOnChipMainThread(CHIP_NO_ERROR);
+        }
+    }
+
+    CHIP_ERROR DoTestStep(uint16_t testIndex) override
+    {
+        using namespace chip::app::Clusters;
+        switch (testIndex)
+        {
+        case 0: {
+            LogStep(0, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(
+                1,
+                "TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set to false");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(0);
+                listHolder_1->mList[0].value =
+                    mSearchValue.HasValue() ? mSearchValue.Value() : chip::Span<const char>("exampleValue", 12);
+                listHolder_1->mList[0].externalIDList.Emplace();
+
+                {
+                    auto * listHolder_4 =
+                        new ListHolder<chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type>(1);
+                    listFreer.add(listHolder_4);
+
+                    listHolder_4->mList[0].name =
+                        mExternalIdName.HasValue() ? mExternalIdName.Value() : chip::Span<const char>("name", 4);
+                    listHolder_4->mList[0].value =
+                        mExternalIdValue.HasValue() ? mExternalIdValue.Value() : chip::Span<const char>("value", 5);
+
+                    listHolder_1->mList[0].externalIDList.Value() =
+                        chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type>(
+                            listHolder_4->mList, 1);
+                }
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = false;
+            value.data.Emplace();
+            value.data.Value() = mData.HasValue() ? mData.Value() : chip::Span<const char>("exampleData", 11);
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 2: {
+            LogStep(2, "Verify that DUT present via its user interface a list of matches based on the provided search criteria.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Please enter 'y' if DUT present via its user interface a list of matches based "
+                                                   "on the provided search criteria.garbage: not in length on purpose",
+                                                   111);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 3: {
+            LogStep(
+                3, "TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set to true");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(0);
+                listHolder_1->mList[0].value =
+                    mSearchValue.HasValue() ? mSearchValue.Value() : chip::Span<const char>("exampleValue", 12);
+                listHolder_1->mList[0].externalIDList.Emplace();
+
+                {
+                    auto * listHolder_4 =
+                        new ListHolder<chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type>(1);
+                    listFreer.add(listHolder_4);
+
+                    listHolder_4->mList[0].name =
+                        mExternalIdName.HasValue() ? mExternalIdName.Value() : chip::Span<const char>("name", 4);
+                    listHolder_4->mList[0].value =
+                        mExternalIdValue.HasValue() ? mExternalIdValue.Value() : chip::Span<const char>("value", 5);
+
+                    listHolder_1->mList[0].externalIDList.Value() =
+                        chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type>(
+                            listHolder_4->mList, 1);
+                }
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            value.data.Emplace();
+            value.data.Value() = mData.HasValue() ? mData.Value() : chip::Span<const char>("exampleData", 11);
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 4: {
+            LogStep(4, "Verify that DUT should also begin playing content that best matched the given search criteria");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Please enter 'y' if DUT begin playing content that best matched the given "
+                                                   "search criteriagarbage: not in length on purpose",
+                                                   89);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        }
+        return CHIP_NO_ERROR;
+    }
+};
+
+class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand
+{
+public:
+    Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) :
+        TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 9, credsIssuerConfig)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("GoodURL", &mGoodURL);
+        AddArgument("BadURL", &mBadURL);
+        AddArgument("UnauthorizedURL", &mUnauthorizedURL);
+        AddArgument("DisplayContent", &mDisplayContent);
+        AddArgument("providerNameString", &mProviderNameString);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+
+    ~Test_TC_CONTENTLAUNCHER_10_5Suite() {}
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<chip::CharSpan> mGoodURL;
+    chip::Optional<chip::CharSpan> mBadURL;
+    chip::Optional<chip::CharSpan> mUnauthorizedURL;
+    chip::Optional<chip::CharSpan> mDisplayContent;
+    chip::Optional<chip::CharSpan> mProviderNameString;
+    chip::Optional<uint16_t> mTimeout;
+
+    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+    //
+    // Tests methods
+    //
+
+    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+    {
+        bool shouldContinue = false;
+
+        switch (mTestIndex - 1)
+        {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+                VerifyOrReturn(CheckValuePresent("data", value.data));
+                VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(),
+                                                  mDisplayContent.HasValue() ? mDisplayContent.Value()
+                                                                             : chip::Span<const char>("exampleData", 11)));
+            }
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 7:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 1U));
+            }
+            break;
+        case 8:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 2U));
+            }
+            break;
+        default:
+            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+        }
+
+        if (shouldContinue)
+        {
+            ContinueOnChipMainThread(CHIP_NO_ERROR);
+        }
+    }
+
+    CHIP_ERROR DoTestStep(uint16_t testIndex) override
+    {
+        using namespace chip::app::Clusters;
+        switch (testIndex)
+        {
+        case 0: {
+            LogStep(0, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(1, "TH sends a LaunchURL command to the DUT with a known good content URL string");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value;
+            value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span<const char>("https://csa-iot.org/", 20);
+            value.brandingInformation.Emplace();
+
+            value.brandingInformation.Value().providerName =
+                mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span<const char>("exampleName", 11);
+
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value,
+                               chip::NullOptional
+
+            );
+        }
+        case 2: {
+            LogStep(2, "Verify that DUT launched the content at the given URL");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT launched the content at the given URLgarbage: not in length on purpose", 61);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 3: {
+            LogStep(3, "TH sends a LaunchURL command to the DUT with a known good content URL string and a display string");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value;
+            value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span<const char>("https://csa-iot.org/", 20);
+            value.displayString.Emplace();
+            value.displayString.Value() =
+                mDisplayContent.HasValue() ? mDisplayContent.Value() : chip::Span<const char>("exampleData", 11);
+            value.brandingInformation.Emplace();
+
+            value.brandingInformation.Value().providerName =
+                mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span<const char>("exampleName", 11);
+
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value,
+                               chip::NullOptional
+
+            );
+        }
+        case 4: {
+            LogStep(4,
+                    "Verify that DUT launched the content at the given URL with the given display string in the "
+                    "application-specific description area");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message =
+                chip::Span<const char>("Please enter 'y' if DUT launched the content at the given URL with the given display "
+                                       "string in the application-specific description areagarbage: not in length on purpose",
+                                       136);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 5: {
+            LogStep(5,
+                    "TH sends a LaunchURL command to the DUT with a known good content URL string and a brand information object.");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value;
+            value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span<const char>("https://csa-iot.org/", 20);
+            value.brandingInformation.Emplace();
+
+            value.brandingInformation.Value().providerName =
+                mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span<const char>("exampleName", 11);
+
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value,
+                               chip::NullOptional
+
+            );
+        }
+        case 6: {
+            LogStep(6,
+                    "Verify that DUT launched the content at the given URL with the player interface updated as per the provided "
+                    "branding information");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message =
+                chip::Span<const char>("Please enter 'y' if DUT launched the content at the given URL with the player interface "
+                                       "updated as per the provided branding informationgarbage: not in length on purpose",
+                                       136);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 7: {
+            LogStep(7, "TH sends a LaunchURL command to the DUT with a known unreachable content URL string.");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value;
+            value.contentURL = mBadURL.HasValue() ? mBadURL.Value() : chip::Span<const char>("https://badurl", 14);
+            value.brandingInformation.Emplace();
+
+            value.brandingInformation.Value().providerName =
+                mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span<const char>("exampleName", 11);
+
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value,
+                               chip::NullOptional
+
+            );
+        }
+        case 8: {
+            LogStep(8, "TH sends a LaunchURL command to the DUT with a known un-authorized content URL string.");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value;
+            value.contentURL =
+                mUnauthorizedURL.HasValue() ? mUnauthorizedURL.Value() : chip::Span<const char>("https://csa-iot.org/badauth", 27);
+            value.brandingInformation.Emplace();
+
+            value.brandingInformation.Value().providerName =
+                mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span<const char>("exampleName", 11);
+
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value,
+                               chip::NullOptional
+
+            );
+        }
+        }
+        return CHIP_NO_ERROR;
+    }
+};
+
+class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand
+{
+public:
+    Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) :
+        TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 27, credsIssuerConfig)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("PopularityName", &mPopularityName);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+
+    ~Test_TC_CONTENTLAUNCHER_10_7Suite() {}
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<chip::CharSpan> mPopularityName;
+    chip::Optional<uint16_t> mTimeout;
+
+    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+    //
+    // Tests methods
+    //
+
+    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+    {
+        bool shouldContinue = false;
+
+        switch (mTestIndex - 1)
+        {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 7:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 8:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 9:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 10:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 11:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 12:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 13:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 14:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 15:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 16:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 17:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 18:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 19:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 20:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 21:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 22:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 23:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 24:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 25:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("status", value.status, 0U));
+            }
+            break;
+        case 26:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        default:
+            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+        }
+
+        if (shouldContinue)
+        {
+            ContinueOnChipMainThread(CHIP_NO_ERROR);
+        }
+    }
+
+    CHIP_ERROR DoTestStep(uint16_t testIndex) override
+    {
+        using namespace chip::app::Clusters;
+        switch (testIndex)
+        {
+        case 0: {
+            LogStep(0, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(1,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Actor and Value as An "
+                    "Actor’s name, for example, Gaby sHoffman");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(0);
+                listHolder_1->mList[0].value = chip::Span<const char>("Gaby sHoffmangarbage: not in length on purpose", 13);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 2: {
+            LogStep(2, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 3: {
+            LogStep(3,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Channel and Value as "
+                    "Channel Name name, for example, PBS");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(1);
+                listHolder_1->mList[0].value = chip::Span<const char>("PBSgarbage: not in length on purpose", 3);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 4: {
+            LogStep(4, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 5: {
+            LogStep(5,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Character and Value "
+                    "as Character’s name,for example,Snow White");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(2);
+                listHolder_1->mList[0].value = chip::Span<const char>("Snow Whitegarbage: not in length on purpose", 10);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = false;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 6: {
+            LogStep(6, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 7: {
+            LogStep(7,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Director and Value as "
+                    "Director’s name, for example, Spike Lee");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(3);
+                listHolder_1->mList[0].value = chip::Span<const char>("Spike Leegarbage: not in length on purpose", 9);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 8: {
+            LogStep(8, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 9: {
+            LogStep(9,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Event and Value as An "
+                    "Event’s name , for example Football games");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(4);
+                listHolder_1->mList[0].value = chip::Span<const char>("Football gamesgarbage: not in length on purpose", 14);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 10: {
+            LogStep(10, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 11: {
+            LogStep(11,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Franchise and Value "
+                    "as Franchise’s name,for example Star Wars");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(5);
+                listHolder_1->mList[0].value = chip::Span<const char>("Star Warsgarbage: not in length on purpose", 9);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 12: {
+            LogStep(12, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 13: {
+            LogStep(13,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Genre and Value as "
+                    "Genre’s name, for example Horror");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(6);
+                listHolder_1->mList[0].value = chip::Span<const char>("Horrorgarbage: not in length on purpose", 6);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 14: {
+            LogStep(14, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 15: {
+            LogStep(15,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As League and Value as "
+                    "League’s name, for example NCAA");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(7);
+                listHolder_1->mList[0].value = chip::Span<const char>("NCAAgarbage: not in length on purpose", 4);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 16: {
+            LogStep(16, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 17: {
+            LogStep(17,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Popularity and Value "
+                    "as Popularity’s name");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(8);
+                listHolder_1->mList[0].value =
+                    mPopularityName.HasValue() ? mPopularityName.Value() : chip::Span<const char>("popular content", 15);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 18: {
+            LogStep(18, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 19: {
+            LogStep(19,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Provider and Value as "
+                    "Provider’s name, for example Netflix");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(9);
+                listHolder_1->mList[0].value = chip::Span<const char>("Netflixgarbage: not in length on purpose", 7);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 20: {
+            LogStep(20, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 21: {
+            LogStep(21,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Sport and Value as "
+                    "Sport’s name, for example, football");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(10);
+                listHolder_1->mList[0].value = chip::Span<const char>("footballgarbage: not in length on purpose", 8);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 22: {
+            LogStep(22, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 23: {
+            LogStep(23,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As SportsTeam and Value "
+                    "as SportTeam’s name , for example Arsenel");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(11);
+                listHolder_1->mList[0].value = chip::Span<const char>("Arsenelgarbage: not in length on purpose", 7);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 24: {
+            LogStep(24, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 25: {
+            LogStep(25,
+                    "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Type and Value as "
+                    "Type’s name, for example TVSeries");
+            VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value;
+
+            {
+                auto * listHolder_1 = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(1);
+                listFreer.add(listHolder_1);
+
+                listHolder_1->mList[0].type  = static_cast<chip::app::Clusters::ContentLauncher::ParameterEnum>(12);
+                listHolder_1->mList[0].value = chip::Span<const char>("TVSeriesgarbage: not in length on purpose", 8);
+
+                value.search.parameterList =
+                    chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>(
+                        listHolder_1->mList, 1);
+            }
+
+            value.autoPlay = true;
+            return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id,
+                               value, chip::NullOptional
+
+            );
+        }
+        case 26: {
+            LogStep(26, "Verify that DUT should play or display the search result.");
+            VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>(
+                "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        }
+        return CHIP_NO_ERROR;
+    }
+};
+
 class Test_TC_MOD_1_1Suite : public TestCommand
 {
 public:
@@ -53641,8 +55349,8 @@
                 chip::app::DataModel::Nullable<int16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, -32768));
-                VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, -32767));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766));
                 MinMeasuredValue = value;
             }
             break;
@@ -53652,7 +55360,7 @@
                 chip::app::DataModel::Nullable<int16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, -32768));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767));
                 MaxMeasuredValue = value;
             }
@@ -53683,8 +55391,8 @@
                 chip::app::DataModel::Nullable<int16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, -32768));
-                VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, -32767));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766));
                 MinScaledValue = value;
             }
             break;
@@ -53694,7 +55402,7 @@
                 chip::app::DataModel::Nullable<int16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, -32768));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, MinScaledValue));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767));
                 MaxScaledValue = value;
             }
@@ -56315,6 +58023,9 @@
     chip::Optional<chip::EndpointId> mEndpoint;
     chip::Optional<uint16_t> mTimeout;
 
+    chip::app::DataModel::Nullable<uint16_t> CurrentMinMeasured;
+    chip::app::DataModel::Nullable<uint16_t> CurrentMaxMeasured;
+
     chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
 
     //
@@ -56339,6 +58050,7 @@
                 VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
                 VerifyOrReturn(CheckConstraintMinValue("value", value, 0U));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U));
+                CurrentMinMeasured = value;
             }
             break;
         case 2:
@@ -56347,8 +58059,9 @@
                 chip::app::DataModel::Nullable<uint16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, 1U));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U));
+                CurrentMaxMeasured = value;
             }
             break;
         case 3:
@@ -56357,8 +58070,8 @@
                 chip::app::DataModel::Nullable<uint16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, 0U));
-                VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, CurrentMaxMeasured));
             }
             break;
         case 4:
@@ -58260,8 +59973,8 @@
     chip::Optional<chip::EndpointId> mEndpoint;
     chip::Optional<uint16_t> mTimeout;
 
-    chip::app::DataModel::Nullable<int16_t> MinMeasuredValue;
-    chip::app::DataModel::Nullable<int16_t> MaxMeasuredValue;
+    chip::app::DataModel::Nullable<int16_t> CurrentMinMeasured;
+    chip::app::DataModel::Nullable<int16_t> CurrentMaxMeasured;
 
     chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
 
@@ -58286,8 +59999,8 @@
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
                 VerifyOrReturn(CheckConstraintMinValue("value", value, -27315));
-                VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767));
-                MinMeasuredValue = value;
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766));
+                CurrentMinMeasured = value;
             }
             break;
         case 2:
@@ -58296,9 +60009,9 @@
                 chip::app::DataModel::Nullable<int16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, -27314));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured));
                 VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767));
-                MaxMeasuredValue = value;
+                CurrentMaxMeasured = value;
             }
             break;
         case 3:
@@ -58307,8 +60020,8 @@
                 chip::app::DataModel::Nullable<int16_t> value;
                 VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
                 VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue));
-                VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue));
+                VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured));
+                VerifyOrReturn(CheckConstraintMaxValue("value", value, CurrentMaxMeasured));
             }
             break;
         case 4:
@@ -63183,6 +64896,172 @@
     }
 };
 
+class Test_TC_TIMESYNC_2_3Suite : public TestCommand
+{
+public:
+    Test_TC_TIMESYNC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) :
+        TestCommand("Test_TC_TIMESYNC_2_3", 7, credsIssuerConfig)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+
+    ~Test_TC_TIMESYNC_2_3Suite() {}
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mTimeout;
+
+    chip::NodeId th_node_id;
+    uint8_t th_fabric_idx;
+
+    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+    //
+    // Tests methods
+    //
+
+    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+    {
+        bool shouldContinue = false;
+
+        switch (mTestIndex - 1)
+        {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                th_node_id = value.nodeId;
+            }
+            shouldContinue = true;
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                uint8_t value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                th_fabric_idx = value;
+            }
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::Nullable<
+                    chip::app::Clusters::TimeSynchronization::Structs::TrustedTimeSourceStruct::DecodableType>
+                    value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValueNonNull("trustedTimeSource", value));
+                VerifyOrReturn(CheckValue("trustedTimeSource.Value().fabricIndex", value.Value().fabricIndex, th_fabric_idx));
+                VerifyOrReturn(CheckValue("trustedTimeSource.Value().nodeID", value.Value().nodeID, th_node_id));
+                VerifyOrReturn(CheckValue("trustedTimeSource.Value().endpoint", value.Value().endpoint, 0U));
+            }
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::DataModel::Nullable<
+                    chip::app::Clusters::TimeSynchronization::Structs::TrustedTimeSourceStruct::DecodableType>
+                    value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValueNull("trustedTimeSource", value));
+            }
+            break;
+        default:
+            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+        }
+
+        if (shouldContinue)
+        {
+            ContinueOnChipMainThread(CHIP_NO_ERROR);
+        }
+    }
+
+    CHIP_ERROR DoTestStep(uint16_t testIndex) override
+    {
+        using namespace chip::app::Clusters;
+        switch (testIndex)
+        {
+        case 0: {
+            LogStep(0, "Step 0: Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(1, "Read commissioner nodeID and saves as th_node_id");
+            ListFreer listFreer;
+            chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value;
+            return GetCommissionerNodeId(kIdentityAlpha, value);
+        }
+        case 2: {
+            LogStep(2,
+                    "Step 1: TH sends the SetTrustedTimeSource command to the DUT with the TrustedTimeSource fields set as "
+                    "follows: NodeID: th_node_id, Endpoint: 0");
+            ListFreer listFreer;
+            chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Type value;
+            value.trustedTimeSource.SetNonNull();
+
+            value.trustedTimeSource.Value().nodeID   = th_node_id;
+            value.trustedTimeSource.Value().endpoint = 0U;
+
+            return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id,
+                               TimeSynchronization::Commands::SetTrustedTimeSource::Id, value, chip::NullOptional
+
+            );
+        }
+        case 3: {
+            LogStep(3,
+                    "Step 2: TH reads from the DUT the CurrentFabricIndex attribute from the Node Operational Credentials Cluster "
+                    "and saves as th_fabric_idx");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id,
+                                 OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional);
+        }
+        case 4: {
+            LogStep(4, "Step 3: TH reads from the DUT the TrustedTimeSource attribute.");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id,
+                                 TimeSynchronization::Attributes::TrustedTimeSource::Id, true, chip::NullOptional);
+        }
+        case 5: {
+            LogStep(5, "Step 4: TH sends the SetTrustedTimeSource command to the DUT with the TrustedTimeSource set to null.");
+            ListFreer listFreer;
+            chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Type value;
+            value.trustedTimeSource.SetNull();
+            return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id,
+                               TimeSynchronization::Commands::SetTrustedTimeSource::Id, value, chip::NullOptional
+
+            );
+        }
+        case 6: {
+            LogStep(6, "Step 5: TH reads from the DUT the TrustedTimeSource attribute.");
+            return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id,
+                                 TimeSynchronization::Attributes::TrustedTimeSource::Id, true, chip::NullOptional);
+        }
+        }
+        return CHIP_NO_ERROR;
+    }
+};
+
 class Test_TC_ULABEL_1_1Suite : public TestCommand
 {
 public:
@@ -117916,62 +119795,6 @@
     }
 };
 
-class Test_TC_CONTENTLAUNCHER_10_3Suite : public TestCommand
-{
-public:
-    Test_TC_CONTENTLAUNCHER_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) :
-        TestCommand("Test_TC_CONTENTLAUNCHER_10_3", 0, credsIssuerConfig)
-    {
-        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
-        AddArgument("cluster", &mCluster);
-        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
-        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
-    }
-
-    ~Test_TC_CONTENTLAUNCHER_10_3Suite() {}
-
-    chip::System::Clock::Timeout GetWaitDuration() const override
-    {
-        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
-    }
-
-private:
-    chip::Optional<chip::NodeId> mNodeId;
-    chip::Optional<chip::CharSpan> mCluster;
-    chip::Optional<chip::EndpointId> mEndpoint;
-    chip::Optional<uint16_t> mTimeout;
-
-    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
-
-    //
-    // Tests methods
-    //
-
-    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
-    {
-        bool shouldContinue = false;
-
-        switch (mTestIndex - 1)
-        {
-        default:
-            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
-        }
-
-        if (shouldContinue)
-        {
-            ContinueOnChipMainThread(CHIP_NO_ERROR);
-        }
-    }
-
-    CHIP_ERROR DoTestStep(uint16_t testIndex) override
-    {
-        using namespace chip::app::Clusters;
-        switch (testIndex)
-        {}
-        return CHIP_NO_ERROR;
-    }
-};
-
 class Test_TC_CONTENTLAUNCHER_10_4Suite : public TestCommand
 {
 public:
@@ -118028,118 +119851,6 @@
     }
 };
 
-class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand
-{
-public:
-    Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) :
-        TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 0, credsIssuerConfig)
-    {
-        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
-        AddArgument("cluster", &mCluster);
-        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
-        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
-    }
-
-    ~Test_TC_CONTENTLAUNCHER_10_5Suite() {}
-
-    chip::System::Clock::Timeout GetWaitDuration() const override
-    {
-        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
-    }
-
-private:
-    chip::Optional<chip::NodeId> mNodeId;
-    chip::Optional<chip::CharSpan> mCluster;
-    chip::Optional<chip::EndpointId> mEndpoint;
-    chip::Optional<uint16_t> mTimeout;
-
-    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
-
-    //
-    // Tests methods
-    //
-
-    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
-    {
-        bool shouldContinue = false;
-
-        switch (mTestIndex - 1)
-        {
-        default:
-            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
-        }
-
-        if (shouldContinue)
-        {
-            ContinueOnChipMainThread(CHIP_NO_ERROR);
-        }
-    }
-
-    CHIP_ERROR DoTestStep(uint16_t testIndex) override
-    {
-        using namespace chip::app::Clusters;
-        switch (testIndex)
-        {}
-        return CHIP_NO_ERROR;
-    }
-};
-
-class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand
-{
-public:
-    Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) :
-        TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 0, credsIssuerConfig)
-    {
-        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
-        AddArgument("cluster", &mCluster);
-        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
-        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
-    }
-
-    ~Test_TC_CONTENTLAUNCHER_10_7Suite() {}
-
-    chip::System::Clock::Timeout GetWaitDuration() const override
-    {
-        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
-    }
-
-private:
-    chip::Optional<chip::NodeId> mNodeId;
-    chip::Optional<chip::CharSpan> mCluster;
-    chip::Optional<chip::EndpointId> mEndpoint;
-    chip::Optional<uint16_t> mTimeout;
-
-    chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
-
-    //
-    // Tests methods
-    //
-
-    void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
-    {
-        bool shouldContinue = false;
-
-        switch (mTestIndex - 1)
-        {
-        default:
-            LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
-        }
-
-        if (shouldContinue)
-        {
-            ContinueOnChipMainThread(CHIP_NO_ERROR);
-        }
-    }
-
-    CHIP_ERROR DoTestStep(uint16_t testIndex) override
-    {
-        using namespace chip::app::Clusters;
-        switch (testIndex)
-        {}
-        return CHIP_NO_ERROR;
-    }
-};
-
 class Test_TC_MC_11_1Suite : public TestCommand
 {
 public:
@@ -123660,26 +125371,45 @@
 class Test_TC_SC_4_1Suite : public TestCommand
 {
 public:
-    Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 0, credsIssuerConfig)
+    Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 95, credsIssuerConfig)
     {
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
-        AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator);
+        AddArgument("shortDiscriminator", 0, UINT16_MAX, &mShortDiscriminator);
+        AddArgument("vendorId", 0, UINT16_MAX, &mVendorId);
+        AddArgument("productId", 0, UINT16_MAX, &mProductId);
+        AddArgument("deviceType", 0, UINT16_MAX, &mDeviceType);
+        AddArgument("PakeVerifier", &mPakeVerifier);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+        AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning);
     }
 
-    ~Test_TC_SC_4_1Suite() {}
-
-    chip::System::Clock::Timeout GetWaitDuration() const override
+    ~Test_TC_SC_4_1Suite()
     {
-        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+        if (deviceInstanceNameBeforeRebootBuffer != nullptr)
+        {
+            chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer);
+            deviceInstanceNameBeforeRebootBuffer = nullptr;
+        }
     }
 
+    chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(900)); }
+
 private:
     chip::Optional<chip::NodeId> mNodeId;
-    chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mDiscriminator;
+    chip::Optional<uint16_t> mShortDiscriminator;
+    chip::Optional<uint16_t> mVendorId;
+    chip::Optional<uint16_t> mProductId;
+    chip::Optional<uint16_t> mDeviceType;
+    chip::Optional<chip::ByteSpan> mPakeVerifier;
     chip::Optional<uint16_t> mTimeout;
+    chip::Optional<uint16_t> mWaitAfterCommissioning;
+
+    char * deviceInstanceNameBeforeRebootBuffer = nullptr;
+    chip::CharSpan deviceInstanceNameBeforeReboot;
 
     chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
 
@@ -123693,6 +125423,838 @@
 
         switch (mTestIndex - 1)
         {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true));
+                if (deviceInstanceNameBeforeRebootBuffer != nullptr)
+                {
+                    chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer);
+                }
+                deviceInstanceNameBeforeRebootBuffer = static_cast<char *>(chip::Platform::MemoryAlloc(value.instanceName.size()));
+                memcpy(deviceInstanceNameBeforeRebootBuffer, value.instanceName.data(), value.instanceName.size());
+                deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, value.instanceName.size());
+            }
+            shouldContinue = true;
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 7:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 8:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 9:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 10:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 11:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 12:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator,
+                                          mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U));
+                VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U));
+                VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U));
+            }
+            shouldContinue = true;
+            break;
+        case 13:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U));
+            }
+            shouldContinue = true;
+            break;
+        case 14:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U));
+            }
+            shouldContinue = true;
+            break;
+        case 15:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalIdle.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(),
+                                                           3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 16:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalActive.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()",
+                                                           value.mrpRetryIntervalActive.Value(), 3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 17:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U));
+            }
+            shouldContinue = true;
+            break;
+        case 18:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL));
+            }
+            shouldContinue = true;
+            break;
+        case 19:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32));
+            }
+            shouldContinue = true;
+            break;
+        case 20:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL));
+            }
+            shouldContinue = true;
+            break;
+        case 21:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U));
+            }
+            shouldContinue = true;
+            break;
+        case 22:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128));
+            }
+            shouldContinue = true;
+            break;
+        case 23:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U));
+            }
+            shouldContinue = true;
+            break;
+        case 24:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 25:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 26:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 27:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 28:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 29:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true));
+                VerifyOrReturn(CheckConstraintNotValue("value.instanceName", value.instanceName, deviceInstanceNameBeforeReboot));
+            }
+            shouldContinue = true;
+            break;
+        case 30:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 31:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 32:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 33:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 34:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 35:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 36:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 37:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 38:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator,
+                                          mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U));
+                VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U));
+                VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U));
+            }
+            shouldContinue = true;
+            break;
+        case 39:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U));
+            }
+            shouldContinue = true;
+            break;
+        case 40:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U));
+            }
+            shouldContinue = true;
+            break;
+        case 41:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalIdle.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(),
+                                                           3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 42:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalActive.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()",
+                                                           value.mrpRetryIntervalActive.Value(), 3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 43:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U));
+            }
+            shouldContinue = true;
+            break;
+        case 44:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL));
+            }
+            shouldContinue = true;
+            break;
+        case 45:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32));
+            }
+            shouldContinue = true;
+            break;
+        case 46:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL));
+            }
+            shouldContinue = true;
+            break;
+        case 47:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U));
+            }
+            shouldContinue = true;
+            break;
+        case 48:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128));
+            }
+            shouldContinue = true;
+            break;
+        case 49:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U));
+            }
+            shouldContinue = true;
+            break;
+        case 50:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 51:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 52:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 53:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 54:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 55:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 56:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 57:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 58:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 59:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 60:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 61:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 62:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U));
+            }
+            shouldContinue = true;
+            break;
+        case 63:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U));
+            }
+            shouldContinue = true;
+            break;
+        case 64:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalIdle.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(),
+                                                           3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 65:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalActive.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()",
+                                                           value.mrpRetryIntervalActive.Value(), 3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 66:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 2U));
+            }
+            shouldContinue = true;
+            break;
+        case 67:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL));
+            }
+            shouldContinue = true;
+            break;
+        case 68:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32));
+            }
+            shouldContinue = true;
+            break;
+        case 69:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL));
+            }
+            shouldContinue = true;
+            break;
+        case 70:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U));
+            }
+            shouldContinue = true;
+            break;
+        case 71:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128));
+            }
+            shouldContinue = true;
+            break;
+        case 72:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U));
+            }
+            shouldContinue = true;
+            break;
+        case 73:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 74:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 75:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 76:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            shouldContinue = true;
+            break;
+        case 77:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 78:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12));
+                VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16));
+                VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true));
+                VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true));
+            }
+            shouldContinue = true;
+            break;
+        case 79:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 80:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 81:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 82:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 83:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+            }
+            shouldContinue = true;
+            break;
+        case 84:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator,
+                                          mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U));
+                VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U));
+                VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U));
+            }
+            shouldContinue = true;
+            break;
+        case 85:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U));
+            }
+            shouldContinue = true;
+            break;
+        case 86:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U));
+            }
+            shouldContinue = true;
+            break;
+        case 87:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalIdle.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(),
+                                                           3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 88:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                if (value.mrpRetryIntervalActive.HasValue())
+                {
+                    VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()",
+                                                           value.mrpRetryIntervalActive.Value(), 3600000UL));
+                }
+            }
+            shouldContinue = true;
+            break;
+        case 89:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 0U));
+            }
+            shouldContinue = true;
+            break;
+        case 90:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL));
+            }
+            shouldContinue = true;
+            break;
+        case 91:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32));
+            }
+            shouldContinue = true;
+            break;
+        case 92:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL));
+            }
+            shouldContinue = true;
+            break;
+        case 93:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U));
+            }
+            shouldContinue = true;
+            break;
+        case 94:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            {
+                chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value;
+                VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+                VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128));
+            }
+            shouldContinue = true;
+            break;
         default:
             LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
         }
@@ -123707,7 +126269,844 @@
     {
         using namespace chip::app::Clusters;
         switch (testIndex)
-        {}
+        {
+        case 0: {
+            LogStep(0, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 1: {
+            LogStep(1, "DUT is put in Commissioning Mode using Open Basic Commissioning Window command ");
+            ListFreer listFreer;
+            chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value;
+            value.commissioningTimeout = 180U;
+            return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id,
+                               AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value,
+                               chip::Optional<uint16_t>(10000), chip::NullOptional
+
+            );
+        }
+        case 2: {
+            LogStep(2, "Waiting after opening commissioning window");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 3: {
+            LogStep(3,
+                    "Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with "
+                    "capital letters");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 4: {
+            LogStep(4, "Service type must be _matterc._udp");
+            VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Enter 'y' after successgarbage: not in length on purpose", 23);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 5: {
+            LogStep(5,
+                    "Check target hostname is derived from the 48bit or 64bit MAC address expressed as a twelve or sixteen capital "
+                    "letter hex string");
+            VerifyOrDo(!ShouldSkip("( MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 6: {
+            LogStep(6,
+                    "Check target hostname is derived from the 48bit or 64bit MAC address expressed as a twelve or sixteen capital "
+                    "letter hex string");
+            VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.WIFI) && MCORE.COM.THR"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 7: {
+            LogStep(7, "Check Long Discriminator _L");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value;
+            value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL;
+            return FindCommissionableByLongDiscriminator(kIdentityAlpha, value);
+        }
+        case 8: {
+            LogStep(8, "Check Short Discriminator (_S)");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value;
+            value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL;
+            return FindCommissionableByShortDiscriminator(kIdentityAlpha, value);
+        }
+        case 9: {
+            LogStep(9,
+                    "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V<ddddd> is present must be 16-bit vendor id, encoded as a "
+                    "variable-length decimal number in ASCII text, omitting any leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value;
+            value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL;
+            return FindCommissionableByVendorId(kIdentityAlpha, value);
+        }
+        case 10: {
+            LogStep(10,
+                    "if (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present, <ddd> represents device type from Data "
+                    "Model and must be represented as a variable length decimal number in ASCII without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value;
+            value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL;
+            return FindCommissionableByDeviceType(kIdentityAlpha, value);
+        }
+        case 11: {
+            LogStep(11, "Check Commissioning Mode (_CM) subtype _CM must be present");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value;
+            return FindCommissionableByCommissioningMode(kIdentityAlpha, value);
+        }
+        case 12: {
+            LogStep(12,
+                    "key D must be present and represents the discriminator which must be encoded as a variable-length decimal "
+                    "value with up to 4 digits omitting any leading zeros");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 13: {
+            LogStep(13, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 14: {
+            LogStep(14, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 15: {
+            LogStep(
+                15,
+                "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned integer with units of milliseconds and "
+                "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 16: {
+            LogStep(
+                16,
+                "If (MCORE.SC.SAI_OP_DISCOVERY_KEY ) present, SAI key must be an unsigned integer with units of milliseconds and "
+                "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 17: {
+            LogStep(17, "TXT key for commissioning mode (CM) CM=1 must be present");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 18: {
+            LogStep(18,
+                    "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and "
+                    "must be encoded as a variable length decimal ASCII number without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 19: {
+            LogStep(19, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 20: {
+            LogStep(20,
+                    "If (MCORE.SC.RI_KEY ) present, key RI must include the Rotating Device Identifier encoded as a uppercase "
+                    "string with a maximum length of 100 chars");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 21: {
+            LogStep(21,
+                    "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, "
+                    "omitting any leading zeros. If present value must be different of 0");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 22: {
+            LogStep(
+                22,
+                "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 23: {
+            LogStep(23,
+                    "DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter messages.");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 24: {
+            LogStep(24, "Reboot/restart the DUT");
+            VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::SystemCommands::Commands::Reboot::Type value;
+            return Reboot(kIdentityAlpha, value);
+        }
+        case 25: {
+            LogStep(25, "Reboot target device(DUT)");
+            VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message =
+                chip::Span<const char>("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 26: {
+            LogStep(26, "Wait for the commissioned device to be retrieved");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+            value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+            return WaitForCommissionee(kIdentityAlpha, value);
+        }
+        case 27: {
+            LogStep(27,
+                    "DUT put in Commissioning Mode using Open Basic Commissioning Window command, starting advertising "
+                    "Commissionable Node Discovery service using DNS-SD");
+            VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value;
+            value.commissioningTimeout = 180U;
+            return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id,
+                               AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value,
+                               chip::Optional<uint16_t>(10000), chip::NullOptional
+
+            );
+        }
+        case 28: {
+            LogStep(28, "Waiting after opening commissioning window");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 29: {
+            LogStep(29,
+                    "Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with "
+                    "capital letters and must be different from the one at step 2");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 30: {
+            LogStep(30, "service type must be _matterc._udp");
+            VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Enter 'y' after successgarbage: not in length on purpose", 23);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 31: {
+            LogStep(31,
+                    "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or 64bit MAC "
+                    "address expressed as a twelve or sixteen capital letter hex string");
+            VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 32: {
+            LogStep(32,
+                    "Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC address expressed "
+                    "as a twelve or sixteen capital letter hex string");
+            VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 33: {
+            LogStep(33, "Check Long Discriminator _L");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value;
+            value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL;
+            return FindCommissionableByLongDiscriminator(kIdentityAlpha, value);
+        }
+        case 34: {
+            LogStep(34, "Check Short Discriminator (_S)");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value;
+            value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL;
+            return FindCommissionableByShortDiscriminator(kIdentityAlpha, value);
+        }
+        case 35: {
+            LogStep(35,
+                    "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V<ddddd> is present must be 16-bit vendor id, encoded as a "
+                    "variable-length decimal number in ASCII text, omitting any leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value;
+            value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL;
+            return FindCommissionableByVendorId(kIdentityAlpha, value);
+        }
+        case 36: {
+            LogStep(36,
+                    "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present, <ddd> represents device type from Data "
+                    "Model and must be represented as a variable length decimal number in ASCII without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value;
+            value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL;
+            return FindCommissionableByDeviceType(kIdentityAlpha, value);
+        }
+        case 37: {
+            LogStep(37, "Check Commissioning Mode (_CM) subtype _CM is present");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value;
+            return FindCommissionableByCommissioningMode(kIdentityAlpha, value);
+        }
+        case 38: {
+            LogStep(38,
+                    "key D must be present and represents the discriminator which must be encoded as a variable-length decimal "
+                    "value with up to 4 digits omitting any leading zeros");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 39: {
+            LogStep(39, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 40: {
+            LogStep(40, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 41: {
+            LogStep(
+                41,
+                "If (MCORE.SC.SII_OP_DISCOVERY_KEY ) present, SII key must be an unsigned integer with units of milliseconds and "
+                "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 42: {
+            LogStep(
+                42,
+                "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned integer with units of milliseconds and "
+                "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 43: {
+            LogStep(43, "TXT key for commissioning mode (CM) key CM=1 must be present");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 44: {
+            LogStep(44,
+                    "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and "
+                    "must be encoded as a variable length decimal ASCII number without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 45: {
+            LogStep(45, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 46: {
+            LogStep(46,
+                    "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a uppercase "
+                    "string with a maximum length of 100 chars");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 47: {
+            LogStep(47,
+                    "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, "
+                    "omitting any leading zeros. If present value must be different of 0");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 48: {
+            LogStep(
+                48,
+                "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 49: {
+            LogStep(49,
+                    "DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter messages.");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 50: {
+            LogStep(50, "Wait for OpenBasicCommissioningWindow timeout to expire");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = 180000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 51: {
+            LogStep(51,
+                    "DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window command");
+            VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value;
+            value.commissioningTimeout = 180U;
+            value.PAKEPasscodeVerifier = mPakeVerifier.HasValue()
+                ? mPakeVerifier.Value()
+                : chip::ByteSpan(
+                      chip::Uint8::from_const_char(
+                          "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20"
+                          "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d"
+                          "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51"
+                          "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"),
+                      97);
+            value.discriminator        = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U;
+            value.iterations           = 1000UL;
+            value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16);
+            return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id,
+                               AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value,
+                               chip::Optional<uint16_t>(10000), chip::NullOptional
+
+            );
+        }
+        case 52: {
+            LogStep(52,
+                    "DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window command");
+            VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Enter 'y' after successgarbage: not in length on purpose", 23);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 53: {
+            LogStep(53, "Waiting after opening commissioning window");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 54: {
+            LogStep(54,
+                    "DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with capital "
+                    "letters");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 55: {
+            LogStep(55,
+                    "Check Hostname.If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or 64bit MAC "
+                    "address expressed as a twelve or sixteen capital letter hex string.");
+            VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 56: {
+            LogStep(56,
+                    "Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC extended address "
+                    "expressed as a twelve or sixteen capital letter hex string.");
+            VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 57: {
+            LogStep(57, "Check Long Discriminator _L");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value;
+            value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL;
+            return FindCommissionableByLongDiscriminator(kIdentityAlpha, value);
+        }
+        case 58: {
+            LogStep(58, "Check Short Discriminator (_S)");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value;
+            value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL;
+            return FindCommissionableByShortDiscriminator(kIdentityAlpha, value);
+        }
+        case 59: {
+            LogStep(59,
+                    "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V<ddddd> is present must be 16-bit vendor id, encoded as a "
+                    "variable-length decimal number in ASCII text, omitting any leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value;
+            value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL;
+            return FindCommissionableByVendorId(kIdentityAlpha, value);
+        }
+        case 60: {
+            LogStep(60,
+                    "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present, <ddd> represents device type from Data "
+                    "Model and must be represented as a variable length decimal number in ASCII without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value;
+            value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL;
+            return FindCommissionableByDeviceType(kIdentityAlpha, value);
+        }
+        case 61: {
+            LogStep(61, "Check Commissioning Mode (_CM) subtype _CM is present");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value;
+            return FindCommissionableByCommissioningMode(kIdentityAlpha, value);
+        }
+        case 62: {
+            LogStep(62, "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Vendor ID is present.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 63: {
+            LogStep(63, "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Product ID is present");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 64: {
+            LogStep(64,
+                    "Optional TXT key for MRP Retry Interval Idle. if (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an "
+                    "unsigned integer with units of milliseconds and shall be encoded as a variable length decimal number in "
+                    "ASCII, omitting leading zeros. Shall not exceed 3600000");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 65: {
+            LogStep(65,
+                    "Optional TXT key for MRP Retry Interval Active. if (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be "
+                    "an unsigned integer with units of milliseconds and shall be encoded as a variable length decimal number in "
+                    "ASCII, omitting leading zeros. Shall not exceed 3600000.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 66: {
+            LogStep(66, "TXT key for commissioning mode. CM=2 must be present");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 67: {
+            LogStep(67,
+                    "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and "
+                    "must be encoded as a variable length decimal ASCII number without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 68: {
+            LogStep(68, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 69: {
+            LogStep(69,
+                    "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a uppercase "
+                    "string with a maximum length of 100 chars");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 70: {
+            LogStep(70,
+                    "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, "
+                    "omitting any leading zeros. If present value must be different of 0");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 71: {
+            LogStep(
+                71,
+                "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 72: {
+            LogStep(72,
+                    "DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter messages");
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 73: {
+            LogStep(73, "Wait for OCW timeout to expire");
+            ListFreer listFreer;
+            chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+            value.ms = 180000UL;
+            return WaitForMs(kIdentityAlpha, value);
+        }
+        case 74: {
+            LogStep(74,
+                    "If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery. DUT should start to send Commissionable Node "
+                    "Discovery DNS-SD advertisements");
+            VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Enter 'y' after successgarbage: not in length on purpose", 23);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 75: {
+            LogStep(75,
+                    "Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with "
+                    "capital letters");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 76: {
+            LogStep(76, "service type must be _matterc._udp");
+            VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+            value.message = chip::Span<const char>("Enter 'y' after successgarbage: not in length on purpose", 23);
+            value.expectedValue.Emplace();
+            value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+            return UserPrompt(kIdentityAlpha, value);
+        }
+        case 77: {
+            LogStep(77,
+                    "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or 64bit MAC "
+                    "address expressed as a twelve or sixteen capital letter hex string");
+            VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 78: {
+            LogStep(78,
+                    "Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC extended address "
+                    "expressed as a twelve or sixteen capital letter hex string.");
+            VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 79: {
+            LogStep(79, "Check Long Discriminator _L");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value;
+            value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL;
+            return FindCommissionableByLongDiscriminator(kIdentityAlpha, value);
+        }
+        case 80: {
+            LogStep(80, "Check Short Discriminator (_S)");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value;
+            value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL;
+            return FindCommissionableByShortDiscriminator(kIdentityAlpha, value);
+        }
+        case 81: {
+            LogStep(81,
+                    "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V<ddddd> is present must be 16-bit vendor id, encoded as a "
+                    "variable-length decimal number in ASCII text, omitting any leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value;
+            value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL;
+            return FindCommissionableByVendorId(kIdentityAlpha, value);
+        }
+        case 82: {
+            LogStep(82,
+                    "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T<ddd> is present, <ddd> represents device type from Data "
+                    "Model and must be represented as a variable length decimal number in ASCII without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value;
+            value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL;
+            return FindCommissionableByDeviceType(kIdentityAlpha, value);
+        }
+        case 83: {
+            LogStep(83, "Check Commissioning Mode (_CM)");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value;
+            return FindCommissionableByCommissioningMode(kIdentityAlpha, value);
+        }
+        case 84: {
+            LogStep(84, "TXT key for discriminator (D)");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 85: {
+            LogStep(85, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 86: {
+            LogStep(86, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 87: {
+            LogStep(
+                87,
+                "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned integer with units of milliseconds and "
+                "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 88: {
+            LogStep(
+                88,
+                "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned integer with units of milliseconds and "
+                "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000.");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 89: {
+            LogStep(89, "TXT key for commissioning mode (CM), CM=0 may be present");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 90: {
+            LogStep(90,
+                    "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and "
+                    "must be encoded as a variable length decimal ASCII number without leading zeros");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 91: {
+            LogStep(91, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 92: {
+            LogStep(92,
+                    "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a uppercase "
+                    "string with a maximum length of 100 chars");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 93: {
+            LogStep(93,
+                    "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, "
+                    "omitting any leading zeros. If present value must be different of 0");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        case 94: {
+            LogStep(
+                94,
+                "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes");
+            VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY && MCORE.SC.EXTENDED_DISCOVERY"),
+                       return ContinueOnChipMainThread(CHIP_NO_ERROR));
+            ListFreer listFreer;
+            chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value;
+            return FindCommissionable(kIdentityAlpha, value);
+        }
+        }
         return CHIP_NO_ERROR;
     }
 };
@@ -135296,6 +138695,8 @@
         make_unique<Test_TC_CGEN_2_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_DGGEN_1_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_DGGEN_2_1Suite>(credsIssuerConfig),
+        make_unique<Test_TC_ICDM_1_1Suite>(credsIssuerConfig),
+        make_unique<Test_TC_ICDM_2_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_I_1_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_I_2_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_I_2_2Suite>(credsIssuerConfig),
@@ -135353,6 +138754,9 @@
         make_unique<Test_TC_CONTENTLAUNCHER_10_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_WAKEONLAN_4_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_ALOGIN_12_1Suite>(credsIssuerConfig),
+        make_unique<Test_TC_CONTENTLAUNCHER_10_3Suite>(credsIssuerConfig),
+        make_unique<Test_TC_CONTENTLAUNCHER_10_5Suite>(credsIssuerConfig),
+        make_unique<Test_TC_CONTENTLAUNCHER_10_7Suite>(credsIssuerConfig),
         make_unique<Test_TC_MOD_1_1Suite>(credsIssuerConfig),
         make_unique<OTA_SuccessfulTransferSuite>(credsIssuerConfig),
         make_unique<Test_TC_OCC_1_1Suite>(credsIssuerConfig),
@@ -135393,6 +138797,7 @@
         make_unique<Test_TC_DGTHREAD_2_3Suite>(credsIssuerConfig),
         make_unique<Test_TC_DGTHREAD_2_4Suite>(credsIssuerConfig),
         make_unique<Test_TC_TIMESYNC_1_1Suite>(credsIssuerConfig),
+        make_unique<Test_TC_TIMESYNC_2_3Suite>(credsIssuerConfig),
         make_unique<Test_TC_ULABEL_1_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_ULABEL_2_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_ULABEL_2_2Suite>(credsIssuerConfig),
@@ -135634,10 +139039,7 @@
         make_unique<Test_TC_MEDIAPLAYBACK_6_7Suite>(credsIssuerConfig),
         make_unique<Test_TC_AUDIOOUTPUT_7_3Suite>(credsIssuerConfig),
         make_unique<Test_TC_AUDIOOUTPUT_7_4Suite>(credsIssuerConfig),
-        make_unique<Test_TC_CONTENTLAUNCHER_10_3Suite>(credsIssuerConfig),
         make_unique<Test_TC_CONTENTLAUNCHER_10_4Suite>(credsIssuerConfig),
-        make_unique<Test_TC_CONTENTLAUNCHER_10_5Suite>(credsIssuerConfig),
-        make_unique<Test_TC_CONTENTLAUNCHER_10_7Suite>(credsIssuerConfig),
         make_unique<Test_TC_MC_11_1Suite>(credsIssuerConfig),
         make_unique<Test_TC_MC_11_2Suite>(credsIssuerConfig),
         make_unique<Test_TC_ALOGIN_12_2Suite>(credsIssuerConfig),
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
index dff6c7b..0eefdf9 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
@@ -142,6 +142,9 @@
         printf("Test_TC_CONTENTLAUNCHER_10_1\n");
         printf("Test_TC_WAKEONLAN_4_1\n");
         printf("Test_TC_ALOGIN_12_1\n");
+        printf("Test_TC_CONTENTLAUNCHER_10_3\n");
+        printf("Test_TC_CONTENTLAUNCHER_10_5\n");
+        printf("Test_TC_CONTENTLAUNCHER_10_7\n");
         printf("Test_TC_MOD_1_1\n");
         printf("OTA_SuccessfulTransfer\n");
         printf("Test_TC_OCC_1_1\n");
@@ -20724,6 +20727,7 @@
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
         AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
     }
     // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
@@ -20913,12 +20917,16 @@
             err = TestTurnOffLightThatWeTurnedOn_19();
             break;
         case 20:
-            ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n");
+            ChipLogProgress(chipTool, " ***** Test Step 20 : Wait to turn Off light\n");
+            err = TestWaitToTurnOffLight_20();
+            break;
+        case 21:
+            ChipLogProgress(chipTool, " ***** Test Step 21 : Check on/off attribute value is false after off command\n");
             if (ShouldSkip("OO.S.A0000")) {
                 NextTest();
                 return;
             }
-            err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20();
+            err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21();
             break;
         }
 
@@ -20994,6 +21002,9 @@
         case 20:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             break;
+        case 21:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
         }
 
         // Go on to the next test.
@@ -21007,11 +21018,12 @@
 
 private:
     std::atomic_uint16_t mTestIndex;
-    const uint16_t mTestCount = 21;
+    const uint16_t mTestCount = 22;
 
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mConfigWait;
     chip::Optional<uint16_t> mTimeout;
 
     CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
@@ -21383,7 +21395,15 @@
         return CHIP_NO_ERROR;
     }
 
-    CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20()
+    CHIP_ERROR TestWaitToTurnOffLight_20()
+    {
+
+        chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+        value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL;
+        return WaitForMs("alpha", value);
+    }
+
+    CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21()
     {
 
         MTRBaseDevice * device = GetDevice("alpha");
@@ -21417,6 +21437,7 @@
         AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
         AddArgument("cluster", &mCluster);
         AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait);
         AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
     }
     // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
@@ -21577,6 +21598,26 @@
             }
             err = TestThReadsEnhancedColorModeAttributeFromDut_16();
             break;
+        case 17:
+            ChipLogProgress(chipTool, " ***** Test Step 17 : Turn Off light that we turned on\n");
+            if (ShouldSkip("OO.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestTurnOffLightThatWeTurnedOn_17();
+            break;
+        case 18:
+            ChipLogProgress(chipTool, " ***** Test Step 18 : Wait to turn Off light\n");
+            err = TestWaitToTurnOffLight_18();
+            break;
+        case 19:
+            ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n");
+            if (ShouldSkip("OO.S.A0000")) {
+                NextTest();
+                return;
+            }
+            err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19();
+            break;
         }
 
         if (CHIP_NO_ERROR != err) {
@@ -21639,6 +21680,15 @@
         case 16:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             break;
+        case 17:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 18:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 19:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
         }
 
         // Go on to the next test.
@@ -21652,11 +21702,12 @@
 
 private:
     std::atomic_uint16_t mTestIndex;
-    const uint16_t mTestCount = 17;
+    const uint16_t mTestCount = 20;
 
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
     chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<uint16_t> mConfigWait;
     chip::Optional<uint16_t> mTimeout;
 
     CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
@@ -21977,6 +22028,55 @@
 
         return CHIP_NO_ERROR;
     }
+
+    CHIP_ERROR TestTurnOffLightThatWeTurnedOn_17()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        [cluster offWithCompletion:^(NSError * _Nullable err) {
+            NSLog(@"Turn Off light that we turned on Error: %@", err);
+
+            VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+            NextTest();
+        }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestWaitToTurnOffLight_18()
+    {
+
+        chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value;
+        value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL;
+        return WaitForMs("alpha", value);
+    }
+
+    CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) {
+            NSLog(@"Check on/off attribute value is false after off command Error: %@", err);
+
+            VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+            {
+                id actualValue = value;
+                VerifyOrReturn(CheckValue("OnOff", actualValue, 0));
+            }
+
+            NextTest();
+        }];
+
+        return CHIP_NO_ERROR;
+    }
 };
 
 class Test_TC_CC_7_3 : public TestCommandBridge {
@@ -31773,6 +31873,7 @@
         value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
         return WaitForCommissionee("alpha", value);
     }
+    NSNumber * _Nullable MinMeasuredVariable;
 
     CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1()
     {
@@ -31792,12 +31893,16 @@
                 VerifyOrReturn(CheckConstraintMinValue<uint16_t>("minMeasuredValue", [value unsignedShortValue], 0U));
                 VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("minMeasuredValue", [value unsignedShortValue], 65533U));
             }
+            {
+                MinMeasuredVariable = value;
+            }
 
             NextTest();
         }];
 
         return CHIP_NO_ERROR;
     }
+    NSNumber * _Nullable MaxMeasuredVariable;
 
     CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2()
     {
@@ -31814,9 +31919,13 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue<uint16_t>("maxMeasuredValue", [value unsignedShortValue], 0U));
+                VerifyOrReturn(
+                    CheckConstraintMinValue<uint16_t>("maxMeasuredValue", [value unsignedShortValue], MinMeasuredVariable));
                 VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("maxMeasuredValue", [value unsignedShortValue], 65534U));
             }
+            {
+                MaxMeasuredVariable = value;
+            }
 
             NextTest();
         }];
@@ -31839,8 +31948,8 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue<uint16_t>("measuredValue", [value unsignedShortValue], 0U));
-                VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("measuredValue", [value unsignedShortValue], 65535U));
+                VerifyOrReturn(CheckConstraintMinValue<uint16_t>("measuredValue", [value unsignedShortValue], MinMeasuredVariable));
+                VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("measuredValue", [value unsignedShortValue], MaxMeasuredVariable));
             }
 
             NextTest();
@@ -54673,7 +54782,7 @@
             break;
         case 14:
             ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the PlaybackSpeed attribute from the DUT\n");
-            if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) {
+            if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) {
                 NextTest();
                 return;
             }
@@ -54698,7 +54807,7 @@
             break;
         case 17:
             ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the PlaybackSpeed attribute from the DUT\n");
-            if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) {
+            if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) {
                 NextTest();
                 return;
             }
@@ -55120,12 +55229,24 @@
     CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_14()
     {
 
-        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
-        value.message
-            = chip::Span<const char>("Please enter 'y' if PlaybackSpeed value is -1garbage: not in length on purpose", 45);
-        value.expectedValue.Emplace();
-        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
-        return UserPrompt("alpha", value);
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        [cluster readAttributePlaybackSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) {
+            NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err);
+
+            VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+            {
+                id actualValue = value;
+                VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, -1.0f));
+            }
+
+            NextTest();
+        }];
+
+        return CHIP_NO_ERROR;
     }
 
     CHIP_ERROR TestSendsARewindCommandToTheDut_15()
@@ -55165,12 +55286,24 @@
     CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_17()
     {
 
-        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
-        value.message
-            = chip::Span<const char>("Please enter 'y' if PlaybackSpeed value is -2garbage: not in length on purpose", 45);
-        value.expectedValue.Emplace();
-        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
-        return UserPrompt("alpha", value);
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        [cluster readAttributePlaybackSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) {
+            NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err);
+
+            VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+            {
+                id actualValue = value;
+                VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, -2.0f));
+            }
+
+            NextTest();
+        }];
+
+        return CHIP_NO_ERROR;
     }
 
     CHIP_ERROR TestSendsAPlayCommand_18()
@@ -56739,6 +56872,1813 @@
     }
 };
 
+class Test_TC_CONTENTLAUNCHER_10_3 : public TestCommandBridge {
+public:
+    // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
+    Test_TC_CONTENTLAUNCHER_10_3()
+        : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_3")
+        , mTestIndex(0)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("data", &mData);
+        AddArgument("SearchValue", &mSearchValue);
+        AddArgument("ExternalIdName", &mExternalIdName);
+        AddArgument("ExternalIdValue", &mExternalIdValue);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+    // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
+
+    ~Test_TC_CONTENTLAUNCHER_10_3() {}
+
+    /////////// TestCommand Interface /////////
+    void NextTest() override
+    {
+        CHIP_ERROR err = CHIP_NO_ERROR;
+
+        if (0 == mTestIndex) {
+            ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_3\n");
+        }
+
+        if (mTestCount == mTestIndex) {
+            ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_3\n");
+            SetCommandExitStatus(CHIP_NO_ERROR);
+            return;
+        }
+
+        Wait();
+
+        // Ensure we increment mTestIndex before we start running the relevant
+        // command.  That way if we lose the timeslice after we send the message
+        // but before our function call returns, we won't end up with an
+        // incorrect mTestIndex value observed when we get the response.
+        switch (mTestIndex++) {
+        case 0:
+            ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n");
+            err = TestWaitForTheCommissionedDeviceToBeRetrieved_0();
+            break;
+        case 1:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 1 : TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay "
+                "flag set to false\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToFalse_1();
+            break;
+        case 2:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 2 : Verify that DUT present via its user interface a list of matches based on the provided "
+                "search criteria.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutPresentViaItsUserInterfaceAListOfMatchesBasedOnTheProvidedSearchCriteria_2();
+            break;
+        case 3:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 3 : TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay "
+                "flag set to true\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToTrue_3();
+            break;
+        case 4:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 4 : Verify that DUT should also begin playing content that best matched the given search "
+                "criteria\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldAlsoBeginPlayingContentThatBestMatchedTheGivenSearchCriteria_4();
+            break;
+        }
+
+        if (CHIP_NO_ERROR != err) {
+            ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err));
+            SetCommandExitStatus(err);
+        }
+    }
+
+    void OnStatusUpdate(const chip::app::StatusIB & status) override
+    {
+        switch (mTestIndex - 1) {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        }
+
+        // Go on to the next test.
+        ContinueOnChipMainThread(CHIP_NO_ERROR);
+    }
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    std::atomic_uint16_t mTestIndex;
+    const uint16_t mTestCount = 5;
+
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<chip::CharSpan> mData;
+    chip::Optional<chip::CharSpan> mSearchValue;
+    chip::Optional<chip::CharSpan> mExternalIdName;
+    chip::Optional<chip::CharSpan> mExternalIdValue;
+    chip::Optional<uint16_t> mTimeout;
+
+    CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
+    {
+
+        chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+        value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+        return WaitForCommissionee("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToFalse_1()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:0U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = mSearchValue.HasValue()
+                ? [[NSString alloc] initWithBytes:mSearchValue.Value().data()
+                                           length:mSearchValue.Value().size()
+                                         encoding:NSUTF8StringEncoding]
+                : @"exampleValue";
+            {
+                NSMutableArray * temp_4 = [[NSMutableArray alloc] init];
+                temp_4[0] = [[MTRContentLauncherClusterAdditionalInfoStruct alloc] init];
+                ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).name = mExternalIdName.HasValue()
+                    ? [[NSString alloc] initWithBytes:mExternalIdName.Value().data()
+                                               length:mExternalIdName.Value().size()
+                                             encoding:NSUTF8StringEncoding]
+                    : @"name";
+                ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).value = mExternalIdValue.HasValue()
+                    ? [[NSString alloc] initWithBytes:mExternalIdValue.Value().data()
+                                               length:mExternalIdValue.Value().size()
+                                             encoding:NSUTF8StringEncoding]
+                    : @"value";
+
+                ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).externalIDList = temp_4;
+            }
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:false];
+        params.data = mData.HasValue()
+            ? [[NSString alloc] initWithBytes:mData.Value().data() length:mData.Value().size() encoding:NSUTF8StringEncoding]
+            : @"exampleData";
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay "
+                                   @"flag set to false Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             {
+                                 id actualValue = values.data;
+                                 VerifyOrReturn(CheckValueAsString("Data", actualValue,
+                                     mData.HasValue() ? [[NSString alloc] initWithBytes:mData.Value().data()
+                                                                                 length:mData.Value().size()
+                                                                               encoding:NSUTF8StringEncoding]
+                                                      : @"exampleData"));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutPresentViaItsUserInterfaceAListOfMatchesBasedOnTheProvidedSearchCriteria_2()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>("Please enter 'y' if DUT present via its user interface a list of matches based on "
+                                               "the provided search criteria.garbage: not in length on purpose",
+            111);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToTrue_3()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:0U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = mSearchValue.HasValue()
+                ? [[NSString alloc] initWithBytes:mSearchValue.Value().data()
+                                           length:mSearchValue.Value().size()
+                                         encoding:NSUTF8StringEncoding]
+                : @"exampleValue";
+            {
+                NSMutableArray * temp_4 = [[NSMutableArray alloc] init];
+                temp_4[0] = [[MTRContentLauncherClusterAdditionalInfoStruct alloc] init];
+                ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).name = mExternalIdName.HasValue()
+                    ? [[NSString alloc] initWithBytes:mExternalIdName.Value().data()
+                                               length:mExternalIdName.Value().size()
+                                             encoding:NSUTF8StringEncoding]
+                    : @"name";
+                ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).value = mExternalIdValue.HasValue()
+                    ? [[NSString alloc] initWithBytes:mExternalIdValue.Value().data()
+                                               length:mExternalIdValue.Value().size()
+                                             encoding:NSUTF8StringEncoding]
+                    : @"value";
+
+                ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).externalIDList = temp_4;
+            }
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        params.data = mData.HasValue()
+            ? [[NSString alloc] initWithBytes:mData.Value().data() length:mData.Value().size() encoding:NSUTF8StringEncoding]
+            : @"exampleData";
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay "
+                                   @"flag set to true Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             {
+                                 id actualValue = values.data;
+                                 VerifyOrReturn(CheckValueAsString("Data", actualValue,
+                                     mData.HasValue() ? [[NSString alloc] initWithBytes:mData.Value().data()
+                                                                                 length:mData.Value().size()
+                                                                               encoding:NSUTF8StringEncoding]
+                                                      : @"exampleData"));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldAlsoBeginPlayingContentThatBestMatchedTheGivenSearchCriteria_4()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>("Please enter 'y' if DUT begin playing content that best matched the given search "
+                                               "criteriagarbage: not in length on purpose",
+            89);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+};
+
+class Test_TC_CONTENTLAUNCHER_10_5 : public TestCommandBridge {
+public:
+    // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
+    Test_TC_CONTENTLAUNCHER_10_5()
+        : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_5")
+        , mTestIndex(0)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("GoodURL", &mGoodURL);
+        AddArgument("BadURL", &mBadURL);
+        AddArgument("UnauthorizedURL", &mUnauthorizedURL);
+        AddArgument("DisplayContent", &mDisplayContent);
+        AddArgument("providerNameString", &mProviderNameString);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+    // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
+
+    ~Test_TC_CONTENTLAUNCHER_10_5() {}
+
+    /////////// TestCommand Interface /////////
+    void NextTest() override
+    {
+        CHIP_ERROR err = CHIP_NO_ERROR;
+
+        if (0 == mTestIndex) {
+            ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_5\n");
+        }
+
+        if (mTestCount == mTestIndex) {
+            ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_5\n");
+            SetCommandExitStatus(CHIP_NO_ERROR);
+            return;
+        }
+
+        Wait();
+
+        // Ensure we increment mTestIndex before we start running the relevant
+        // command.  That way if we lose the timeslice after we send the message
+        // but before our function call returns, we won't end up with an
+        // incorrect mTestIndex value observed when we get the response.
+        switch (mTestIndex++) {
+        case 0:
+            ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n");
+            err = TestWaitForTheCommissionedDeviceToBeRetrieved_0();
+            break;
+        case 1:
+            ChipLogProgress(
+                chipTool, " ***** Test Step 1 : TH sends a LaunchURL command to the DUT with a known good content URL string\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlString_1();
+            break;
+        case 2:
+            ChipLogProgress(chipTool, " ***** Test Step 2 : Verify that DUT launched the content at the given URL\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutLaunchedTheContentAtTheGivenUrl_2();
+            break;
+        case 3:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 3 : TH sends a LaunchURL command to the DUT with a known good content URL string and a display "
+                "string\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndADisplayString_3();
+            break;
+        case 4:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 4 : Verify that DUT launched the content at the given URL with the given display string in the "
+                "application-specific description area\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithTheGivenDisplayStringInTheApplicationSpecificDescriptionArea_4();
+            break;
+        case 5:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 5 : TH sends a LaunchURL command to the DUT with a known good content URL string and a brand "
+                "information object.\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndABrandInformationObject_5();
+            break;
+        case 6:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 6 : Verify that DUT launched the content at the given URL with the player interface updated as "
+                "per the provided branding information\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithThePlayerInterfaceUpdatedAsPerTheProvidedBrandingInformation_6();
+            break;
+        case 7:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 7 : TH sends a LaunchURL command to the DUT with a known unreachable content URL string.\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchURLCommandToTheDutWithAKnownUnreachableContentUrlString_7();
+            break;
+        case 8:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 8 : TH sends a LaunchURL command to the DUT with a known un-authorized content URL string.\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchURLCommandToTheDutWithAKnownUnAuthorizedContentUrlString_8();
+            break;
+        }
+
+        if (CHIP_NO_ERROR != err) {
+            ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err));
+            SetCommandExitStatus(err);
+        }
+    }
+
+    void OnStatusUpdate(const chip::app::StatusIB & status) override
+    {
+        switch (mTestIndex - 1) {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 7:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 8:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        }
+
+        // Go on to the next test.
+        ContinueOnChipMainThread(CHIP_NO_ERROR);
+    }
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    std::atomic_uint16_t mTestIndex;
+    const uint16_t mTestCount = 9;
+
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<chip::CharSpan> mGoodURL;
+    chip::Optional<chip::CharSpan> mBadURL;
+    chip::Optional<chip::CharSpan> mUnauthorizedURL;
+    chip::Optional<chip::CharSpan> mDisplayContent;
+    chip::Optional<chip::CharSpan> mProviderNameString;
+    chip::Optional<uint16_t> mTimeout;
+
+    CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
+    {
+
+        chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+        value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+        return WaitForCommissionee("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlString_1()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init];
+        params.contentURL = mGoodURL.HasValue()
+            ? [[NSString alloc] initWithBytes:mGoodURL.Value().data() length:mGoodURL.Value().size() encoding:NSUTF8StringEncoding]
+            : @"https://csa-iot.org/";
+        params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init];
+        ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName
+            = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data()
+                                                                        length:mProviderNameString.Value().size()
+                                                                      encoding:NSUTF8StringEncoding]
+                                             : @"exampleName";
+
+        [cluster
+            launchURLWithParams:params
+                     completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                         NSLog(@"TH sends a LaunchURL command to the DUT with a known good content URL string Error: %@", err);
+
+                         VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                         {
+                             id actualValue = values.status;
+                             VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                         }
+
+                         NextTest();
+                     }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutLaunchedTheContentAtTheGivenUrl_2()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT launched the content at the given URLgarbage: not in length on purpose", 61);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndADisplayString_3()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init];
+        params.contentURL = mGoodURL.HasValue()
+            ? [[NSString alloc] initWithBytes:mGoodURL.Value().data() length:mGoodURL.Value().size() encoding:NSUTF8StringEncoding]
+            : @"https://csa-iot.org/";
+        params.displayString = mDisplayContent.HasValue() ? [[NSString alloc] initWithBytes:mDisplayContent.Value().data()
+                                                                                     length:mDisplayContent.Value().size()
+                                                                                   encoding:NSUTF8StringEncoding]
+                                                          : @"exampleData";
+        params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init];
+        ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName
+            = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data()
+                                                                        length:mProviderNameString.Value().size()
+                                                                      encoding:NSUTF8StringEncoding]
+                                             : @"exampleName";
+
+        [cluster
+            launchURLWithParams:params
+                     completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                         NSLog(@"TH sends a LaunchURL command to the DUT with a known good content URL string and a display string "
+                               @"Error: %@",
+                             err);
+
+                         VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                         {
+                             id actualValue = values.status;
+                             VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                         }
+
+                         {
+                             id actualValue = values.data;
+                             VerifyOrReturn(CheckValueAsString("Data", actualValue,
+                                 mDisplayContent.HasValue() ? [[NSString alloc] initWithBytes:mDisplayContent.Value().data()
+                                                                                       length:mDisplayContent.Value().size()
+                                                                                     encoding:NSUTF8StringEncoding]
+                                                            : @"exampleData"));
+                         }
+
+                         NextTest();
+                     }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithTheGivenDisplayStringInTheApplicationSpecificDescriptionArea_4()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message
+            = chip::Span<const char>("Please enter 'y' if DUT launched the content at the given URL with the given display string "
+                                     "in the application-specific description areagarbage: not in length on purpose",
+                136);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndABrandInformationObject_5()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init];
+        params.contentURL = mGoodURL.HasValue()
+            ? [[NSString alloc] initWithBytes:mGoodURL.Value().data() length:mGoodURL.Value().size() encoding:NSUTF8StringEncoding]
+            : @"https://csa-iot.org/";
+        params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init];
+        ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName
+            = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data()
+                                                                        length:mProviderNameString.Value().size()
+                                                                      encoding:NSUTF8StringEncoding]
+                                             : @"exampleName";
+
+        [cluster
+            launchURLWithParams:params
+                     completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                         NSLog(@"TH sends a LaunchURL command to the DUT with a known good content URL string and a brand "
+                               @"information object. Error: %@",
+                             err);
+
+                         VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                         {
+                             id actualValue = values.status;
+                             VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                         }
+
+                         NextTest();
+                     }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithThePlayerInterfaceUpdatedAsPerTheProvidedBrandingInformation_6()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message
+            = chip::Span<const char>("Please enter 'y' if DUT launched the content at the given URL with the player interface "
+                                     "updated as per the provided branding informationgarbage: not in length on purpose",
+                136);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownUnreachableContentUrlString_7()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init];
+        params.contentURL = mBadURL.HasValue()
+            ? [[NSString alloc] initWithBytes:mBadURL.Value().data() length:mBadURL.Value().size() encoding:NSUTF8StringEncoding]
+            : @"https://badurl";
+        params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init];
+        ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName
+            = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data()
+                                                                        length:mProviderNameString.Value().size()
+                                                                      encoding:NSUTF8StringEncoding]
+                                             : @"exampleName";
+
+        [cluster
+            launchURLWithParams:params
+                     completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                         NSLog(@"TH sends a LaunchURL command to the DUT with a known unreachable content URL string. Error: %@",
+                             err);
+
+                         VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                         {
+                             id actualValue = values.status;
+                             VerifyOrReturn(CheckValue("Status", actualValue, 1U));
+                         }
+
+                         NextTest();
+                     }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownUnAuthorizedContentUrlString_8()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init];
+        params.contentURL = mUnauthorizedURL.HasValue() ? [[NSString alloc] initWithBytes:mUnauthorizedURL.Value().data()
+                                                                                   length:mUnauthorizedURL.Value().size()
+                                                                                 encoding:NSUTF8StringEncoding]
+                                                        : @"https://csa-iot.org/badauth";
+        params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init];
+        ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName
+            = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data()
+                                                                        length:mProviderNameString.Value().size()
+                                                                      encoding:NSUTF8StringEncoding]
+                                             : @"exampleName";
+
+        [cluster
+            launchURLWithParams:params
+                     completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                         NSLog(@"TH sends a LaunchURL command to the DUT with a known un-authorized content URL string. Error: %@",
+                             err);
+
+                         VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                         {
+                             id actualValue = values.status;
+                             VerifyOrReturn(CheckValue("Status", actualValue, 2U));
+                         }
+
+                         NextTest();
+                     }];
+
+        return CHIP_NO_ERROR;
+    }
+};
+
+class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge {
+public:
+    // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
+    Test_TC_CONTENTLAUNCHER_10_7()
+        : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_7")
+        , mTestIndex(0)
+    {
+        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+        AddArgument("cluster", &mCluster);
+        AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+        AddArgument("PopularityName", &mPopularityName);
+        AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+    }
+    // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
+
+    ~Test_TC_CONTENTLAUNCHER_10_7() {}
+
+    /////////// TestCommand Interface /////////
+    void NextTest() override
+    {
+        CHIP_ERROR err = CHIP_NO_ERROR;
+
+        if (0 == mTestIndex) {
+            ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_7\n");
+        }
+
+        if (mTestCount == mTestIndex) {
+            ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_7\n");
+            SetCommandExitStatus(CHIP_NO_ERROR);
+            return;
+        }
+
+        Wait();
+
+        // Ensure we increment mTestIndex before we start running the relevant
+        // command.  That way if we lose the timeslice after we send the message
+        // but before our function call returns, we won't end up with an
+        // incorrect mTestIndex value observed when we get the response.
+        switch (mTestIndex++) {
+        case 0:
+            ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n");
+            err = TestWaitForTheCommissionedDeviceToBeRetrieved_0();
+            break;
+        case 1:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 1 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Actor and Value as An Actor’s name, for example, Gaby sHoffman\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsActorAndValueAsAnActorsNameForExampleGabySHoffman_1();
+            break;
+        case 2:
+            ChipLogProgress(chipTool, " ***** Test Step 2 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_2();
+            break;
+        case 3:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 3 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Channel and Value as Channel Name name, for example, PBS\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsChannelAndValueAsChannelNameNameForExamplePbs_3();
+            break;
+        case 4:
+            ChipLogProgress(chipTool, " ***** Test Step 4 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_4();
+            break;
+        case 5:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 5 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Character and Value as Character’s name,for example,Snow White\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsCharacterAndValueAsCharactersNameforExampleSnowWhite_5();
+            break;
+        case 6:
+            ChipLogProgress(chipTool, " ***** Test Step 6 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_6();
+            break;
+        case 7:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 7 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Director and Value as Director’s name, for example, Spike Lee\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsDirectorAndValueAsDirectorsNameForExampleSpikeLee_7();
+            break;
+        case 8:
+            ChipLogProgress(chipTool, " ***** Test Step 8 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_8();
+            break;
+        case 9:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 9 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Event and Value as An Event’s name , for example Football games\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsEventAndValueAsAnEventsNameForExampleFootballGames_9();
+            break;
+        case 10:
+            ChipLogProgress(chipTool, " ***** Test Step 10 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_10();
+            break;
+        case 11:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 11 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Franchise and Value as Franchise’s name,for example Star Wars\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsFranchiseAndValueAsFranchisesNameforExampleStarWars_11();
+            break;
+        case 12:
+            ChipLogProgress(chipTool, " ***** Test Step 12 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_12();
+            break;
+        case 13:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 13 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Genre and Value as Genre’s name, for example Horror\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsGenreAndValueAsGenresNameForExampleHorror_13();
+            break;
+        case 14:
+            ChipLogProgress(chipTool, " ***** Test Step 14 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_14();
+            break;
+        case 15:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 15 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "League and Value as League’s name, for example NCAA\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsLeagueAndValueAsLeaguesNameForExampleNcaa_15();
+            break;
+        case 16:
+            ChipLogProgress(chipTool, " ***** Test Step 16 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_16();
+            break;
+        case 17:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 17 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Popularity and Value as Popularity’s name\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsPopularityAndValueAsPopularitysName_17();
+            break;
+        case 18:
+            ChipLogProgress(chipTool, " ***** Test Step 18 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_18();
+            break;
+        case 19:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 19 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Provider and Value as Provider’s name, for example Netflix\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsProviderAndValueAsProvidersNameForExampleNetflix_19();
+            break;
+        case 20:
+            ChipLogProgress(chipTool, " ***** Test Step 20 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_20();
+            break;
+        case 21:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 21 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Sport and Value as Sport’s name, for example, football\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportAndValueAsSportsNameForExampleFootball_21();
+            break;
+        case 22:
+            ChipLogProgress(chipTool, " ***** Test Step 22 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_22();
+            break;
+        case 23:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 23 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "SportsTeam and Value as SportTeam’s name , for example Arsenel\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportsTeamAndValueAsSportTeamsNameForExampleArsenel_23();
+            break;
+        case 24:
+            ChipLogProgress(chipTool, " ***** Test Step 24 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_24();
+            break;
+        case 25:
+            ChipLogProgress(chipTool,
+                " ***** Test Step 25 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                "Type and Value as Type’s name, for example TVSeries\n");
+            if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsTypeAndValueAsTypesNameForExampleTVSeries_25();
+            break;
+        case 26:
+            ChipLogProgress(chipTool, " ***** Test Step 26 : Verify that DUT should play or display the search result.\n");
+            if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) {
+                NextTest();
+                return;
+            }
+            err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_26();
+            break;
+        }
+
+        if (CHIP_NO_ERROR != err) {
+            ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err));
+            SetCommandExitStatus(err);
+        }
+    }
+
+    void OnStatusUpdate(const chip::app::StatusIB & status) override
+    {
+        switch (mTestIndex - 1) {
+        case 0:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 1:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 3:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 4:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 5:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 6:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 7:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 8:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 9:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 10:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 11:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 12:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 13:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 14:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 15:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 16:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 17:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 18:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 19:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 20:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 21:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 22:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 23:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 24:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 25:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        case 26:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
+        }
+
+        // Go on to the next test.
+        ContinueOnChipMainThread(CHIP_NO_ERROR);
+    }
+
+    chip::System::Clock::Timeout GetWaitDuration() const override
+    {
+        return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+    }
+
+private:
+    std::atomic_uint16_t mTestIndex;
+    const uint16_t mTestCount = 27;
+
+    chip::Optional<chip::NodeId> mNodeId;
+    chip::Optional<chip::CharSpan> mCluster;
+    chip::Optional<chip::EndpointId> mEndpoint;
+    chip::Optional<chip::CharSpan> mPopularityName;
+    chip::Optional<uint16_t> mTimeout;
+
+    CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
+    {
+
+        chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+        value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+        return WaitForCommissionee("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsActorAndValueAsAnActorsNameForExampleGabySHoffman_1()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:0U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Gaby sHoffman";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Actor "
+                                   @"and Value as An Actor’s name, for example, Gaby sHoffman Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_2()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsChannelAndValueAsChannelNameNameForExamplePbs_3()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:1U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"PBS";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"Channel and Value as Channel Name name, for example, PBS Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_4()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsCharacterAndValueAsCharactersNameforExampleSnowWhite_5()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:2U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Snow White";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:false];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"Character and Value as Character’s name,for example,Snow White Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_6()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsDirectorAndValueAsDirectorsNameForExampleSpikeLee_7()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:3U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Spike Lee";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"Director and Value as Director’s name, for example, Spike Lee Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_8()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsEventAndValueAsAnEventsNameForExampleFootballGames_9()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:4U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Football games";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Event "
+                                   @"and Value as An Event’s name , for example Football games Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_10()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsFranchiseAndValueAsFranchisesNameforExampleStarWars_11()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:5U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Star Wars";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"Franchise and Value as Franchise’s name,for example Star Wars Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_12()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsGenreAndValueAsGenresNameForExampleHorror_13()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:6U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Horror";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Genre "
+                                   @"and Value as Genre’s name, for example Horror Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_14()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsLeagueAndValueAsLeaguesNameForExampleNcaa_15()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:7U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"NCAA";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"League and Value as League’s name, for example NCAA Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_16()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsPopularityAndValueAsPopularitysName_17()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:8U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = mPopularityName.HasValue()
+                ? [[NSString alloc] initWithBytes:mPopularityName.Value().data()
+                                           length:mPopularityName.Value().size()
+                                         encoding:NSUTF8StringEncoding]
+                : @"popular content";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"Popularity and Value as Popularity’s name Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_18()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsProviderAndValueAsProvidersNameForExampleNetflix_19()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:9U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Netflix";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"Provider and Value as Provider’s name, for example Netflix Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_20()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportAndValueAsSportsNameForExampleFootball_21()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:10U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"football";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Sport "
+                                   @"and Value as Sport’s name, for example, football Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_22()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportsTeamAndValueAsSportTeamsNameForExampleArsenel_23()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:11U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Arsenel";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As "
+                                   @"SportsTeam and Value as SportTeam’s name , for example Arsenel Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_24()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+
+    CHIP_ERROR
+    TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsTypeAndValueAsTypesNameForExampleTVSeries_25()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init];
+        params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init];
+        {
+            NSMutableArray * temp_1 = [[NSMutableArray alloc] init];
+            temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:12U];
+            ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"TVSeries";
+
+            ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1;
+        }
+
+        params.autoPlay = [NSNumber numberWithBool:true];
+        [cluster
+            launchContentWithParams:params
+                         completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) {
+                             NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Type "
+                                   @"and Value as Type’s name, for example TVSeries Error: %@",
+                                 err);
+
+                             VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+                             {
+                                 id actualValue = values.status;
+                                 VerifyOrReturn(CheckValue("Status", actualValue, 0U));
+                             }
+
+                             NextTest();
+                         }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_26()
+    {
+
+        chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value;
+        value.message = chip::Span<const char>(
+            "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58);
+        value.expectedValue.Emplace();
+        value.expectedValue.Value() = chip::Span<const char>("ygarbage: not in length on purpose", 1);
+        return UserPrompt("alpha", value);
+    }
+};
+
 class Test_TC_MOD_1_1 : public TestCommandBridge {
 public:
     // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
@@ -62950,8 +64890,8 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue<int16_t>("minMeasuredValue", [value shortValue], -32768));
-                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("minMeasuredValue", [value shortValue], 32767));
+                VerifyOrReturn(CheckConstraintMinValue<int16_t>("minMeasuredValue", [value shortValue], -32767));
+                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("minMeasuredValue", [value shortValue], 32766));
             }
             {
                 MinMeasuredValue = value;
@@ -62981,7 +64921,7 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue<int16_t>("maxMeasuredValue", [value shortValue], -32768));
+                VerifyOrReturn(CheckConstraintMinValue<int16_t>("maxMeasuredValue", [value shortValue], MinMeasuredValue));
                 VerifyOrReturn(CheckConstraintMaxValue<int16_t>("maxMeasuredValue", [value shortValue], 32767));
             }
             {
@@ -63063,8 +65003,8 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("minScaledValue", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue<int16_t>("minScaledValue", [value shortValue], -32768));
-                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("minScaledValue", [value shortValue], 32767));
+                VerifyOrReturn(CheckConstraintMinValue<int16_t>("minScaledValue", [value shortValue], -32767));
+                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("minScaledValue", [value shortValue], 32766));
             }
             {
                 MinScaledValue = value;
@@ -63094,7 +65034,7 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("maxScaledValue", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue<int16_t>("maxScaledValue", [value shortValue], -32768));
+                VerifyOrReturn(CheckConstraintMinValue<int16_t>("maxScaledValue", [value shortValue], MinScaledValue));
                 VerifyOrReturn(CheckConstraintMaxValue<int16_t>("maxScaledValue", [value shortValue], 32767));
             }
             {
@@ -67928,6 +69868,7 @@
         value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
         return WaitForCommissionee("alpha", value);
     }
+    NSNumber * _Nullable CurrentMinMeasured;
 
     CHIP_ERROR TestThReadsTheMinMeasuredValueAttributeFromTheDut_1()
     {
@@ -67949,12 +69890,16 @@
                 VerifyOrReturn(CheckConstraintMinValue<uint16_t>("minMeasuredValue", [value unsignedShortValue], 0U));
                 VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("minMeasuredValue", [value unsignedShortValue], 9999U));
             }
+            {
+                CurrentMinMeasured = value;
+            }
 
             NextTest();
         }];
 
         return CHIP_NO_ERROR;
     }
+    NSNumber * _Nullable CurrentMaxMeasured;
 
     CHIP_ERROR TestThReadsTheMaxMeasuredValueAttributeFromTheDut_2()
     {
@@ -67973,9 +69918,13 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue<uint16_t>("maxMeasuredValue", [value unsignedShortValue], 1U));
+                VerifyOrReturn(
+                    CheckConstraintMinValue<uint16_t>("maxMeasuredValue", [value unsignedShortValue], CurrentMinMeasured));
                 VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("maxMeasuredValue", [value unsignedShortValue], 10000U));
             }
+            {
+                CurrentMaxMeasured = value;
+            }
 
             NextTest();
         }];
@@ -68000,8 +69949,8 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u"));
-                VerifyOrReturn(CheckConstraintMinValue<uint16_t>("measuredValue", [value unsignedShortValue], 0U));
-                VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("measuredValue", [value unsignedShortValue], 10000U));
+                VerifyOrReturn(CheckConstraintMinValue<uint16_t>("measuredValue", [value unsignedShortValue], CurrentMinMeasured));
+                VerifyOrReturn(CheckConstraintMaxValue<uint16_t>("measuredValue", [value unsignedShortValue], CurrentMaxMeasured));
             }
 
             NextTest();
@@ -70096,7 +72045,7 @@
         value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
         return WaitForCommissionee("alpha", value);
     }
-    NSNumber * _Nullable MinMeasuredValue;
+    NSNumber * _Nullable CurrentMinMeasured;
 
     CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1()
     {
@@ -70116,10 +72065,10 @@
 
                 VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16s", "int16s"));
                 VerifyOrReturn(CheckConstraintMinValue<int16_t>("minMeasuredValue", [value shortValue], -27315));
-                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("minMeasuredValue", [value shortValue], 32767));
+                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("minMeasuredValue", [value shortValue], 32766));
             }
             {
-                MinMeasuredValue = value;
+                CurrentMinMeasured = value;
             }
 
             NextTest();
@@ -70127,7 +72076,7 @@
 
         return CHIP_NO_ERROR;
     }
-    NSNumber * _Nullable MaxMeasuredValue;
+    NSNumber * _Nullable CurrentMaxMeasured;
 
     CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2()
     {
@@ -70146,11 +72095,11 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue<int16_t>("maxMeasuredValue", [value shortValue], -27314));
+                VerifyOrReturn(CheckConstraintMinValue<int16_t>("maxMeasuredValue", [value shortValue], CurrentMinMeasured));
                 VerifyOrReturn(CheckConstraintMaxValue<int16_t>("maxMeasuredValue", [value shortValue], 32767));
             }
             {
-                MaxMeasuredValue = value;
+                CurrentMaxMeasured = value;
             }
 
             NextTest();
@@ -70176,8 +72125,8 @@
             if (value != nil) {
 
                 VerifyOrReturn(CheckConstraintType("measuredValue", "int16s", "int16s"));
-                VerifyOrReturn(CheckConstraintMinValue<int16_t>("measuredValue", [value shortValue], MinMeasuredValue));
-                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("measuredValue", [value shortValue], MaxMeasuredValue));
+                VerifyOrReturn(CheckConstraintMinValue<int16_t>("measuredValue", [value shortValue], CurrentMinMeasured));
+                VerifyOrReturn(CheckConstraintMaxValue<int16_t>("measuredValue", [value shortValue], CurrentMaxMeasured));
             }
 
             NextTest();
@@ -147939,6 +149888,9 @@
         make_unique<Test_TC_CONTENTLAUNCHER_10_1>(),
         make_unique<Test_TC_WAKEONLAN_4_1>(),
         make_unique<Test_TC_ALOGIN_12_1>(),
+        make_unique<Test_TC_CONTENTLAUNCHER_10_3>(),
+        make_unique<Test_TC_CONTENTLAUNCHER_10_5>(),
+        make_unique<Test_TC_CONTENTLAUNCHER_10_7>(),
         make_unique<Test_TC_MOD_1_1>(),
         make_unique<OTA_SuccessfulTransfer>(),
         make_unique<Test_TC_OCC_1_1>(),
