Browse Source

Added a test plan to the documentation. I use this test plan to check for regression, before releasing new versions of the code.

pull/20/head
Maurice Makaay 3 years ago
parent
commit
52e1a20014
2 changed files with 76 additions and 5 deletions
  1. +4
    -5
      doc/example.yaml
  2. +72
    -0
      doc/testplan.md

+ 4
- 5
doc/example.yaml View File

@ -138,15 +138,14 @@ output:
id: ${id_front_panel_illumination} id: ${id_front_panel_illumination}
# Binary sensors can be created for handling front panel touch / release # Binary sensors can be created for handling front panel touch / release
# events. To specify what part of the front panel to look at, the "part"
# parameter can be set to: "any" (i.e. the default), "POWER_BUTTON",
# "COLOR_BUTTON" or "SLIDER".
# events. To specify what part of the front panel to look at, the "for"
# parameter can be set to: "POWER_BUTTON", "COLOR_BUTTON" or "SLIDER".
binary_sensor: binary_sensor:
# When tapping the power button, toggle the light. # When tapping the power button, toggle the light.
# When holding the power button, turn on night light mode. # When holding the power button, turn on night light mode.
- platform: xiaomi_bslamp2 - platform: xiaomi_bslamp2
id: ${id_power_button} id: ${id_power_button}
part: POWER_BUTTON
for: POWER_BUTTON
on_multi_click: on_multi_click:
- timing: - timing:
- ON for at most 0.8s - ON for at most 0.8s
@ -166,7 +165,7 @@ binary_sensor:
# When holding the color button, activate the next preset group. # When holding the color button, activate the next preset group.
- platform: xiaomi_bslamp2 - platform: xiaomi_bslamp2
id: ${id_color_button} id: ${id_color_button}
part: COLOR_BUTTON
for: COLOR_BUTTON
on_multi_click: on_multi_click:
- timing: - timing:
- ON for at most 0.6s - ON for at most 0.6s


+ 72
- 0
doc/testplan.md View File

@ -0,0 +1,72 @@
# Testplan
This is the test plan that I follow for every release.
I use it to ensure that no regression has been introduced.
## Step 1: Preparation - build and flash the firmware
* Use the latest stable release for ESPHome (to make sure that my code
builds and works with that release). In my clone I make sure that I
checked out the master branch and that it's up-to-date with the origin.
* Remove the cached framework package:
`/bin/rm -fR ~/.platformio/packages/framework-arduinoespressif32`
* Copy `doc/example.yaml` to a clean build directory, and update the
first two sections for the local setup (substitutions, wifi, api, ota).
* Use `esphome example.yaml compile` to build the code.
* Upload this code to the lamp.
## Step 2: Perform the tests
* Touch the power button --> the light must turn on.
* Touch the power button again --> the light must turn off.
* Touch the slider at any level --> the light must turn on, using the
level at which the slider was touched as the brightness. The front panel
illumination is turned on and shows the brightness level.
* Touch the slider at various points and touch the slider while moving your
finger up and down --> the brightness of the light and the brightness
level on the front panel must follow the touches.
* Touch and hold the power button --> the light must go into "night light"
mode. This means that it will become very dim. The front panel
illumination must be turned off.
* Touch the slider at a random level --> the light must go back to its
normal brightness levels and the front panel illumination must be turned
on again.
* Touch the color button a few times in a row --> the light must loop through
the various preset light colors.
* Touch and hold the color button --> the light must switch to a different
preset group. There are two groups: one with rgb colors and one with white
light colors, and holding the color button will switch between these two.
* Touch the color button to select a light color, long touch it to switch to
the other preset group, then long touch again to switch the preset group
again -> the lamp must remember what light colors were active within the
preset groups. If the red preset was selected, you switch to the white
light group, select a different white preset and then go back to the rgb
presets, then the light must become red again.
* Go to Home Assistant and check:
* if you can turn on/off the lamp
* if you can select colors from the RGB color model
* if you can select colors from the white light color temperature model
* if you can set the brightness of the lamp
* if selecting the lowest possible brightness results in the lamp
switching to "night light" mode
## Step 3: Release the new version
Only after performing these tests successfully, the new version can be
released.

Loading…
Cancel
Save