diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-06-12 22:45:07 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-06-12 22:59:40 +0100 |
commit | c90bd806a68a4d5e80ff985ad626e14cc8605204 (patch) | |
tree | c596353e14f4b60ec749abeacc6f6a2f836b5946 /test/monkey_driver.py | |
parent | c1dc4e61bd87abdfc120888e79c2da6bad8ce26b (diff) | |
download | netsurf-c90bd806a68a4d5e80ff985ad626e14cc8605204.tar.gz netsurf-c90bd806a68a4d5e80ff985ad626e14cc8605204.tar.bz2 |
make the timer-start and timer-restart action name the timer in the same way
Diffstat (limited to 'test/monkey_driver.py')
-rwxr-xr-x | test/monkey_driver.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/test/monkey_driver.py b/test/monkey_driver.py index 16f286a5f..03906d805 100755 --- a/test/monkey_driver.py +++ b/test/monkey_driver.py @@ -301,7 +301,10 @@ def run_test_step_action_plot_check(ctx, step): print(get_indent(ctx) + "Action: " + step["action"]) assert_browser(ctx) win = ctx['windows'][step['window']] - checks = step['checks'] + if 'checks' in step.keys(): + checks = step['checks'] + else: + checks = {} all_text = [] bitmaps = [] for plot in win.redraw(): @@ -310,23 +313,22 @@ def run_test_step_action_plot_check(ctx, step): if plot[0] == 'BITMAP': bitmaps.append(plot[1:]) all_text = " ".join(all_text) - if checks is not None: - for check in checks: - if 'text-contains' in check.keys(): - print("Check {} in {}".format(repr(check['text-contains']),repr(all_text))) - assert(check['text-contains'] in all_text) - elif 'text-not-contains' in check.keys(): - print("Check {} NOT in {}".format(repr(check['text-not-contains']),repr(all_text))) - assert(check['text-not-contains'] not in all_text) - elif 'bitmap-count' in check.keys(): - print("Check bitmap count is {}".format(int(check['bitmap-count']))) - assert(len(bitmaps) == int(check['bitmap-count'])) - else: - raise AssertionError("Unknown check: {}".format(repr(check))) + for check in checks: + if 'text-contains' in check.keys(): + print("Check {} in {}".format(repr(check['text-contains']),repr(all_text))) + assert(check['text-contains'] in all_text) + elif 'text-not-contains' in check.keys(): + print("Check {} NOT in {}".format(repr(check['text-not-contains']),repr(all_text))) + assert(check['text-not-contains'] not in all_text) + elif 'bitmap-count' in check.keys(): + print("Check bitmap count is {}".format(int(check['bitmap-count']))) + assert(len(bitmaps) == int(check['bitmap-count'])) + else: + raise AssertionError("Unknown check: {}".format(repr(check))) def run_test_step_action_timer_start(ctx, step): print(get_indent(ctx) + "Action: " + step["action"]) - tag = step['tag'] + tag = step['timer'] assert_browser(ctx) assert(ctx['timers'].get(tag) is None) ctx['timers'][tag] = {} |