|
18 | 18 |
|
19 | 19 | """
|
20 | 20 | In this file, we define the test sequences with the relevant steps that will be used in the `scripts/tests/run_tv_casting_test.py`
|
21 |
| -for validating the casting experience between the Linux tv-casting-app and the Linux tv-app. |
| 21 | +test script for validating the casting experience between the Linux tv-casting-app and the Linux tv-app. |
22 | 22 |
|
23 | 23 | At the beginning of each test sequence we need to indicate the start up of the tv-app using the `START_APP` string as the `input_cmd`
|
24 | 24 | followed by the same for the tv-casting-app. On the other hand, at the end of each test sequence we need to ensure that each app will
|
|
71 | 71 | PRODUCT_ID = 0x8001 # Test product id
|
72 | 72 | DEVICE_TYPE_CASTING_VIDEO_PLAYER = 0x23 # Device type library 10.3: Casting Video Player
|
73 | 73 |
|
74 |
| -TEST_TV_CASTING_APP_DEVICE_NAME = 'Test TV casting app' # Test device name for identifying the tv-casting-app |
75 |
| - |
76 |
| -# Values to verify the subscription state against from the `ReportDataMessage` in the Linux tv-casting-app output. |
77 |
| -CLUSTER_MEDIA_PLAYBACK = '0x506' # Application Cluster Spec 6.10.3 Cluster ID: Media Playback |
78 |
| -ATTRIBUTE_CURRENT_PLAYBACK_STATE = '0x0000_0000' # Application Cluster Spec 6.10.6 Attribute ID: Current State of Playback |
| 74 | +# Value to verify the subscription state against in the Linux tv-casting-app output. |
| 75 | +ATTRIBUTE_CURRENT_PLAYBACK_STATE = 0x0000_0000 # Application Cluster Spec 6.10.6 Attribute ID: Current State of Playback |
79 | 76 |
|
80 | 77 | test_sequences = [
|
81 | 78 | Sequence(
|
|
93 | 90 | # Validate that the server is properly initialized in the tv-casting-app output.
|
94 | 91 | Step(app=App.TV_CASTING_APP, timeout_sec=APP_MAX_START_WAIT_SEC, output_msg=['Server initialization complete']),
|
95 | 92 |
|
96 |
| - # Validate that there is a valid discovered commissioner with {VENDOR_ID}, {PRODUCT_ID}, and {DEVICE_TYPE_CASTING_VIDEO_PLAYER} in the tv-casting-app output. |
97 |
| - Step(app=App.TV_CASTING_APP, output_msg=['Discovered Commissioner #0', f'Vendor ID: {VENDOR_ID}', f'Product ID: {PRODUCT_ID}', |
| 93 | + # Validate that there is a valid discovered casting player with {PRODUCT_ID}, {VENDOR_ID}, and {DEVICE_TYPE_CASTING_VIDEO_PLAYER} in the tv-casting-app output. |
| 94 | + Step(app=App.TV_CASTING_APP, output_msg=['Discovered CastingPlayer #0', f'Product ID: {PRODUCT_ID}', f'Vendor ID: {VENDOR_ID}', |
98 | 95 | f'Device Type: {DEVICE_TYPE_CASTING_VIDEO_PLAYER}', 'Supports Commissioner Generated Passcode: true']),
|
99 | 96 |
|
100 |
| - # Validate that we are ready to send `cast request` command to the tv-casting-app subprocess. |
101 |
| - Step(app=App.TV_CASTING_APP, output_msg=['Example: cast request 0']), |
102 |
| - |
103 | 97 | # Send `cast request {valid_discovered_commissioner_number}\n` command to the tv-casting-app subprocess.
|
104 | 98 | Step(app=App.TV_CASTING_APP, input_cmd='cast request 0\n'),
|
105 | 99 |
|
106 |
| - # Validate that the `Identification Declaration` message block in the tv-casting-app output has the expected values for `device Name`, `vendor id`, and `product id`. |
107 |
| - Step(app=App.TV_CASTING_APP, output_msg=['Identification Declaration Start', f'device Name: {TEST_TV_CASTING_APP_DEVICE_NAME}', |
108 |
| - f'vendor id: {VENDOR_ID}', f'product id: {PRODUCT_ID}', 'Identification Declaration End']), |
| 100 | + # Validate that the tv-casting-app begins the commissioning process. |
| 101 | + Step(app=App.TV_CASTING_APP, output_msg=[ |
| 102 | + 'CastingPlayer::VerifyOrEstablishConnection() calling OpenBasicCommissioningWindow()']), |
109 | 103 |
|
110 |
| - # Validate that the `Identification Declaration` message block in the tv-app output has the expected values for `device Name`, `vendor id`, and `product id`. |
111 |
| - Step(app=App.TV_APP, output_msg=['Identification Declaration Start', f'device Name: {TEST_TV_CASTING_APP_DEVICE_NAME}', |
112 |
| - f'vendor id: {VENDOR_ID}', f'product id: {PRODUCT_ID}', 'Identification Declaration End']), |
| 104 | + # Validate that the `IdentificationDeclaration` message sent from the tv-casting-app to the tv-app will contain the {VENDOR_ID} of the target content app. |
| 105 | + Step(app=App.TV_CASTING_APP, output_msg=['IdentificationDeclarationOptions::TargetAppInfos list:']), |
| 106 | + Step(app=App.TV_CASTING_APP, output_msg=[f'TargetAppInfo 1, Vendor ID: {VENDOR_ID}']), |
113 | 107 |
|
114 | 108 | # Validate that we received the cast request from the tv-casting-app on the tv-app output.
|
115 | 109 | Step(app=App.TV_APP,
|
116 |
| - output_msg=['PROMPT USER: Test TV casting app is requesting permission to cast to this TV, approve?']), |
| 110 | + output_msg=['------PROMPT USER: Test TV casting app is requesting permission to cast to this TV, approve?']), |
117 | 111 |
|
118 | 112 | # Validate that we received the instructions on the tv-app output for sending the `controller ux ok` command.
|
119 | 113 | Step(app=App.TV_APP, output_msg=['Via Shell Enter: controller ux ok|cancel']),
|
|
124 | 118 | # Validate that pairing succeeded between the tv-casting-app and the tv-app.
|
125 | 119 | Step(app=App.TV_APP, output_msg=['Secure Pairing Success']),
|
126 | 120 |
|
127 |
| - # Validate that commissioning succeeded in the tv-casting-app output. |
128 |
| - Step(app=App.TV_CASTING_APP, output_msg=['Commissioning completed successfully']), |
| 121 | + # Validate that the connection succeeded in the tv-casting-app output. |
| 122 | + Step(app=App.TV_CASTING_APP, output_msg=['Successfully connected to CastingPlayer']), |
129 | 123 |
|
130 | 124 | # Validate that commissioning succeeded in the tv-app output.
|
131 | 125 | Step(app=App.TV_APP, output_msg=['------PROMPT USER: commissioning success']),
|
132 | 126 |
|
133 |
| - # Validate the subscription state by looking at the `Cluster` and `Attribute` values in the `ReportDataMessage` block in the tv-casting-app output. |
134 |
| - Step(app=App.TV_CASTING_APP, output_msg=[ |
135 |
| - 'ReportDataMessage =', f'Cluster = {CLUSTER_MEDIA_PLAYBACK}', f'Attribute = {ATTRIBUTE_CURRENT_PLAYBACK_STATE}', 'InteractionModelRevision =', '}']), |
| 127 | + # Validate that we are able to read the application VendorID value and that it matches {VENDOR_ID}. |
| 128 | + Step(app=App.TV_CASTING_APP, output_msg=[f'Read VendorID value: {VENDOR_ID}']), |
| 129 | + |
| 130 | + # Validate that we are able to subscribe to the media playback cluster by reading the CurrentState value and that it matches {ATTRIBUTE_CURRENT_PLAYBACK_STATE}. |
| 131 | + Step(app=App.TV_CASTING_APP, output_msg=[f'Read CurrentState value: {ATTRIBUTE_CURRENT_PLAYBACK_STATE}']), |
136 | 132 |
|
137 | 133 | # Validate the LaunchURL in the tv-app output.
|
138 | 134 | Step(app=App.TV_APP,
|
139 | 135 | output_msg=['ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://www.test.com/videoid DisplayString=Test video']),
|
140 | 136 |
|
141 | 137 | # Validate the LaunchURL in the tv-casting-app output.
|
142 |
| - Step(app=App.TV_CASTING_APP, output_msg=['InvokeResponseMessage =', |
143 |
| - 'exampleData', 'InteractionModelRevision =', '},']), |
| 138 | + Step(app=App.TV_CASTING_APP, output_msg=['LaunchURL Success with response.data: exampleData']), |
144 | 139 |
|
145 | 140 | # Signal to stop the tv-casting-app as we finished validation.
|
146 | 141 | Step(app=App.TV_CASTING_APP, input_cmd=STOP_APP),
|
|
0 commit comments