Monkey: Properly support reload in farmer and driver
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
095a0639d3
commit
5c9d54d05b
|
@ -299,6 +299,15 @@ def run_test_step_action_stop(ctx, step):
|
|||
win.stop()
|
||||
|
||||
|
||||
def run_test_step_action_reload(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.reload()
|
||||
|
||||
|
||||
def run_test_step_action_sleep_ms(ctx, step):
|
||||
print(get_indent(ctx) + "Action: " + step["action"])
|
||||
conds = step['conditions']
|
||||
|
@ -540,6 +549,7 @@ STEP_HANDLERS = {
|
|||
"window-new": run_test_step_action_window_new,
|
||||
"window-close": run_test_step_action_window_close,
|
||||
"navigate": run_test_step_action_navigate,
|
||||
"reload": run_test_step_action_reload,
|
||||
"stop": run_test_step_action_stop,
|
||||
"sleep-ms": run_test_step_action_sleep_ms,
|
||||
"block": run_test_step_action_block,
|
||||
|
|
|
@ -426,8 +426,10 @@ class BrowserWindow:
|
|||
def stop(self):
|
||||
self.browser.farmer.tell_monkey("WINDOW STOP %s" % (self.winid))
|
||||
|
||||
def reload(self):
|
||||
self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
|
||||
def reload(self, all=False):
|
||||
all = " ALL" if all else ""
|
||||
self.browser.farmer.tell_monkey("WINDOW RELOAD %s%s" % (self.winid, all))
|
||||
self.wait_start_loading()
|
||||
|
||||
def js_exec(self, src):
|
||||
self.browser.farmer.tell_monkey("WINDOW EXEC WIN %s %s" % (self.winid, src))
|
||||
|
|
Loading…
Reference in New Issue