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:
parent
901e43870e
commit
46bd454392
1 changed files with 21 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue