MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / js_send_key

Method js_send_key

web/regression/feature_utils/pgadmin_page.py:867–884  ·  view source on GitHub ↗
(self, field, sele_key)

Source from the content-addressed store, hash-verified

865 )
866
867 def js_send_key(self, field, sele_key):
868 keycode = None
869
870 if sele_key in (Keys.RETURN, Keys.ENTER):
871 keycode = 13
872 elif sele_key == Keys.ARROW_DOWN:
873 keycode = 40
874
875 self.driver.execute_script(
876 "arguments[0].dispatchEvent(new KeyboardEvent('keydown', "
877 "{'keyCode':arguments[1], 'which':arguments[1]}));"
878 "arguments[0].dispatchEvent(new KeyboardEvent('keypress', "
879 "{'keyCode':arguments[1], 'which':arguments[1]}));"
880 "arguments[0].dispatchEvent(new KeyboardEvent('keyup', "
881 "{'keyCode':arguments[1], 'which':arguments[1]}));"
882 "arguments[0].dispatchEvent(new Event('input'));"
883 "arguments[0].dispatchEvent(new Event('change'));",
884 field, keycode)
885
886 def js_loose_focus(self, field):
887 self.driver.execute_script(

Callers 1

fill_inputMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected