ci: add onroad alerts to ui report (#33394)

* add onroad alerts to ui report

* print
pull/33395/head
Dean Lee 12 months ago committed by GitHub
parent 8aff0ce9c7
commit 5fe1f5fa87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .github/workflows/ui_preview.yaml
  2. 27
      selfdrive/ui/tests/test_ui/run.py

@ -84,6 +84,11 @@ jobs:
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/settings_device.png"></td> <td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/settings_device.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/onroad_alert_small.png"></td>
</tr>
<tr>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/onroad_alert_mid.png"></td>
<td><img src="https://raw.githubusercontent.com/commaai/ci-artifacts/openpilot/pr-${{ github.event.number }}/onroad_alert_full.png"></td>
</tr> </tr>
</table> </table>
comment_tag: run_id_screenshots comment_tag: run_id_screenshots

@ -95,12 +95,37 @@ def setup_onroad_sidebar(click, pm: PubMaster):
setup_onroad(click, pm) setup_onroad(click, pm)
click(500, 500) click(500, 500)
def setup_onroad_alert(click, pm: PubMaster, text1, text2, size, status=log.ControlsState.AlertStatus.normal):
print(f'setup onroad alert, size: {size}')
setup_onroad(click, pm)
dat = messaging.new_message('controlsState')
cs = dat.controlsState
cs.alertText1 = text1
cs.alertText2 = text2
cs.alertSize = size
cs.alertStatus = status
cs.alertType = "test_onorad_alert"
pm.send('controlsState', dat)
def setup_onroad_alert_small(click, pm: PubMaster):
setup_onroad_alert(click, pm, 'This is a small alert message', '', log.ControlsState.AlertSize.small)
def setup_onroad_alert_mid(click, pm: PubMaster):
setup_onroad_alert(click, pm, 'Medium Alert', 'This is a medium alert message', log.ControlsState.AlertSize.mid)
def setup_onroad_alert_full(click, pm: PubMaster):
setup_onroad_alert(click, pm, 'Full Alert', 'This is a full alert message', log.ControlsState.AlertSize.full)
CASES = { CASES = {
"homescreen": setup_homescreen, "homescreen": setup_homescreen,
"settings_device": setup_settings_device, "settings_device": setup_settings_device,
"settings_network": setup_settings_network, "settings_network": setup_settings_network,
"onroad": setup_onroad, "onroad": setup_onroad,
"onroad_sidebar": setup_onroad_sidebar "onroad_sidebar": setup_onroad_sidebar,
"onroad_alert_small": setup_onroad_alert_small,
"onroad_alert_mid": setup_onroad_alert_mid,
"onroad_alert_full": setup_onroad_alert_full,
} }
TEST_DIR = pathlib.Path(__file__).parent TEST_DIR = pathlib.Path(__file__).parent

Loading…
Cancel
Save