mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-18 16:49:18 +03:00
allow monkey tests to stop navigation
This commit is contained in:
parent
eeeca4b712
commit
c74c8332ac
@ -235,6 +235,14 @@ def run_test_step_action_navigate(ctx, step):
|
|||||||
assert(win is not None)
|
assert(win is not None)
|
||||||
win.go(step['url'])
|
win.go(step['url'])
|
||||||
|
|
||||||
|
def run_test_step_action_stop(ctx, step):
|
||||||
|
print(get_indent(ctx) + "Action: " + step["action"])
|
||||||
|
assert_browser(ctx)
|
||||||
|
tag = step['window']
|
||||||
|
win = ctx['windows'].get(tag)
|
||||||
|
assert(win is not None)
|
||||||
|
win.stop()
|
||||||
|
|
||||||
def run_test_step_action_sleep_ms(ctx, step):
|
def run_test_step_action_sleep_ms(ctx, step):
|
||||||
print(get_indent(ctx) + "Action: " + step["action"])
|
print(get_indent(ctx) + "Action: " + step["action"])
|
||||||
conds = step['conditions']
|
conds = step['conditions']
|
||||||
@ -438,6 +446,7 @@ step_handlers = {
|
|||||||
"window-new": run_test_step_action_window_new,
|
"window-new": run_test_step_action_window_new,
|
||||||
"window-close": run_test_step_action_window_close,
|
"window-close": run_test_step_action_window_close,
|
||||||
"navigate": run_test_step_action_navigate,
|
"navigate": run_test_step_action_navigate,
|
||||||
|
"stop": run_test_step_action_stop,
|
||||||
"sleep-ms": run_test_step_action_sleep_ms,
|
"sleep-ms": run_test_step_action_sleep_ms,
|
||||||
"block": run_test_step_action_block,
|
"block": run_test_step_action_block,
|
||||||
"repeat": run_test_step_action_repeat,
|
"repeat": run_test_step_action_repeat,
|
||||||
|
@ -359,6 +359,9 @@ class BrowserWindow:
|
|||||||
self.winid, url, referer))
|
self.winid, url, referer))
|
||||||
self.wait_start_loading()
|
self.wait_start_loading()
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
self.browser.farmer.tell_monkey("WINDOW STOP %s" % (self.winid))
|
||||||
|
|
||||||
def reload(self):
|
def reload(self):
|
||||||
self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
|
self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user