1
0
Fork 0

simulator: test: Grey box stopwatch test

Currently we can act on the controls but we cannot "see" the display
in the test suite. That leads us to a slightly odd form of "grey box"
testing. It's functionally black box testing but some of the asserts
have to reach inside the components instead of looking at the display.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-12-04 20:34:23 +00:00
parent 901e43870e
commit 46bd454392

View file

@ -44,3 +44,24 @@ def test_app(system, name):
for i in range(4):
system.step()
system.switch(system.quick_ring[0])
def test_stopwatch(system):
system.switch(system.apps['Timer'])
system.step()
wasp.watch.button.value(0)
system.step()
assert(system.app._started_at > 0)
wasp.watch.button.value(1)
system.step()
system.step()
system.step()
wasp.watch.button.value(0)
system.step()
assert(system.app._started_at == 0)
wasp.watch.button.value(1)
system.step()