Search is not available for this dataset
text
stringlengths
75
104k
def DOMDebugger_setXHRBreakpoint(self, url): """ Function path: DOMDebugger.setXHRBreakpoint Domain: DOMDebugger Method name: setXHRBreakpoint Parameters: Required arguments: 'url' (type: string) -> Resource URL substring. All XHRs having this substring in the URL will get stopped upon. No r...
def DOMDebugger_removeXHRBreakpoint(self, url): """ Function path: DOMDebugger.removeXHRBreakpoint Domain: DOMDebugger Method name: removeXHRBreakpoint Parameters: Required arguments: 'url' (type: string) -> Resource URL substring. No return value. Description: Removes breakpoint from ...
def Target_setDiscoverTargets(self, discover): """ Function path: Target.setDiscoverTargets Domain: Target Method name: setDiscoverTargets Parameters: Required arguments: 'discover' (type: boolean) -> Whether to discover available targets. No return value. Description: Controls whether...
def Target_setAutoAttach(self, autoAttach, waitForDebuggerOnStart): """ Function path: Target.setAutoAttach Domain: Target Method name: setAutoAttach Parameters: Required arguments: 'autoAttach' (type: boolean) -> Whether to auto-attach to related targets. 'waitForDebuggerOnStart' (type: b...
def Target_setAttachToFrames(self, value): """ Function path: Target.setAttachToFrames Domain: Target Method name: setAttachToFrames Parameters: Required arguments: 'value' (type: boolean) -> Whether to attach to frames. No return value. """ assert isinstance(value, (bool,) ), "...
def Target_setRemoteLocations(self, locations): """ Function path: Target.setRemoteLocations Domain: Target Method name: setRemoteLocations Parameters: Required arguments: 'locations' (type: array) -> List of remote locations. No return value. Description: Enables target discovery for ...
def Target_sendMessageToTarget(self, message, **kwargs): """ Function path: Target.sendMessageToTarget Domain: Target Method name: sendMessageToTarget Parameters: Required arguments: 'message' (type: string) -> No description Optional arguments: 'sessionId' (type: SessionID) -> Identif...
def ServiceWorker_unregister(self, scopeURL): """ Function path: ServiceWorker.unregister Domain: ServiceWorker Method name: unregister Parameters: Required arguments: 'scopeURL' (type: string) -> No description No return value. """ assert isinstance(scopeURL, (str,) ), "Argumen...
def ServiceWorker_updateRegistration(self, scopeURL): """ Function path: ServiceWorker.updateRegistration Domain: ServiceWorker Method name: updateRegistration Parameters: Required arguments: 'scopeURL' (type: string) -> No description No return value. """ assert isinstance(scopeURL, ...
def ServiceWorker_startWorker(self, scopeURL): """ Function path: ServiceWorker.startWorker Domain: ServiceWorker Method name: startWorker Parameters: Required arguments: 'scopeURL' (type: string) -> No description No return value. """ assert isinstance(scopeURL, (str,) ), "Argu...
def ServiceWorker_skipWaiting(self, scopeURL): """ Function path: ServiceWorker.skipWaiting Domain: ServiceWorker Method name: skipWaiting Parameters: Required arguments: 'scopeURL' (type: string) -> No description No return value. """ assert isinstance(scopeURL, (str,) ), "Argu...
def ServiceWorker_stopWorker(self, versionId): """ Function path: ServiceWorker.stopWorker Domain: ServiceWorker Method name: stopWorker Parameters: Required arguments: 'versionId' (type: string) -> No description No return value. """ assert isinstance(versionId, (str,) ), "Argu...
def ServiceWorker_inspectWorker(self, versionId): """ Function path: ServiceWorker.inspectWorker Domain: ServiceWorker Method name: inspectWorker Parameters: Required arguments: 'versionId' (type: string) -> No description No return value. """ assert isinstance(versionId, (str,) ...
def ServiceWorker_setForceUpdateOnPageLoad(self, forceUpdateOnPageLoad): """ Function path: ServiceWorker.setForceUpdateOnPageLoad Domain: ServiceWorker Method name: setForceUpdateOnPageLoad Parameters: Required arguments: 'forceUpdateOnPageLoad' (type: boolean) -> No description No return v...
def ServiceWorker_deliverPushMessage(self, origin, registrationId, data): """ Function path: ServiceWorker.deliverPushMessage Domain: ServiceWorker Method name: deliverPushMessage Parameters: Required arguments: 'origin' (type: string) -> No description 'registrationId' (type: string) -> N...
def ServiceWorker_dispatchSyncEvent(self, origin, registrationId, tag, lastChance): """ Function path: ServiceWorker.dispatchSyncEvent Domain: ServiceWorker Method name: dispatchSyncEvent Parameters: Required arguments: 'origin' (type: string) -> No description 'registrationId' (type:...
def Input_setIgnoreInputEvents(self, ignore): """ Function path: Input.setIgnoreInputEvents Domain: Input Method name: setIgnoreInputEvents Parameters: Required arguments: 'ignore' (type: boolean) -> Ignores input events processing when set to true. No return value. Description: Ignore...
def Input_dispatchMouseEvent(self, type, x, y, **kwargs): """ Function path: Input.dispatchMouseEvent Domain: Input Method name: dispatchMouseEvent Parameters: Required arguments: 'type' (type: string) -> Type of the mouse event. 'x' (type: number) -> X coordinate of the event relative to ...
def Input_dispatchTouchEvent(self, type, touchPoints, **kwargs): """ Function path: Input.dispatchTouchEvent Domain: Input Method name: dispatchTouchEvent WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'type' (type: string) -> Type of the touch event. Tou...
def Input_synthesizePinchGesture(self, x, y, scaleFactor, **kwargs): """ Function path: Input.synthesizePinchGesture Domain: Input Method name: synthesizePinchGesture WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'x' (type: number) -> X coordinate of the...
def LayerTree_loadSnapshot(self, tiles): """ Function path: LayerTree.loadSnapshot Domain: LayerTree Method name: loadSnapshot Parameters: Required arguments: 'tiles' (type: array) -> An array of tiles composing the snapshot. Returns: 'snapshotId' (type: SnapshotId) -> The id of the snap...
def Tracing_recordClockSyncMarker(self, syncId): """ Function path: Tracing.recordClockSyncMarker Domain: Tracing Method name: recordClockSyncMarker Parameters: Required arguments: 'syncId' (type: string) -> The ID of this clock sync marker No return value. Description: Record a clock ...
def Animation_setPlaybackRate(self, playbackRate): """ Function path: Animation.setPlaybackRate Domain: Animation Method name: setPlaybackRate Parameters: Required arguments: 'playbackRate' (type: number) -> Playback rate for animations on page No return value. Description: Sets the pl...
def Animation_getCurrentTime(self, id): """ Function path: Animation.getCurrentTime Domain: Animation Method name: getCurrentTime Parameters: Required arguments: 'id' (type: string) -> Id of animation. Returns: 'currentTime' (type: number) -> Current time of the page. Description: ...
def Animation_setPaused(self, animations, paused): """ Function path: Animation.setPaused Domain: Animation Method name: setPaused Parameters: Required arguments: 'animations' (type: array) -> Animations to set the pause state of. 'paused' (type: boolean) -> Paused state to set to. No r...
def Animation_setTiming(self, animationId, duration, delay): """ Function path: Animation.setTiming Domain: Animation Method name: setTiming Parameters: Required arguments: 'animationId' (type: string) -> Animation id. 'duration' (type: number) -> Duration of the animation. 'delay' (t...
def Animation_seekAnimations(self, animations, currentTime): """ Function path: Animation.seekAnimations Domain: Animation Method name: seekAnimations Parameters: Required arguments: 'animations' (type: array) -> List of animation ids to seek. 'currentTime' (type: number) -> Set the curren...
def Animation_releaseAnimations(self, animations): """ Function path: Animation.releaseAnimations Domain: Animation Method name: releaseAnimations Parameters: Required arguments: 'animations' (type: array) -> List of animation ids to seek. No return value. Description: Releases a set o...
def Animation_resolveAnimation(self, animationId): """ Function path: Animation.resolveAnimation Domain: Animation Method name: resolveAnimation Parameters: Required arguments: 'animationId' (type: string) -> Animation id. Returns: 'remoteObject' (type: Runtime.RemoteObject) -> Correspon...
def Storage_clearDataForOrigin(self, origin, storageTypes): """ Function path: Storage.clearDataForOrigin Domain: Storage Method name: clearDataForOrigin Parameters: Required arguments: 'origin' (type: string) -> Security origin. 'storageTypes' (type: string) -> Comma separated origin name...
def Storage_getUsageAndQuota(self, origin): """ Function path: Storage.getUsageAndQuota Domain: Storage Method name: getUsageAndQuota Parameters: Required arguments: 'origin' (type: string) -> Security origin. Returns: 'usage' (type: number) -> Storage usage (bytes). 'quota' (type: n...
def Storage_trackCacheStorageForOrigin(self, origin): """ Function path: Storage.trackCacheStorageForOrigin Domain: Storage Method name: trackCacheStorageForOrigin Parameters: Required arguments: 'origin' (type: string) -> Security origin. No return value. Description: Registers origin...
def Storage_untrackCacheStorageForOrigin(self, origin): """ Function path: Storage.untrackCacheStorageForOrigin Domain: Storage Method name: untrackCacheStorageForOrigin Parameters: Required arguments: 'origin' (type: string) -> Security origin. No return value. Description: Unregister...
def Log_startViolationsReport(self, config): """ Function path: Log.startViolationsReport Domain: Log Method name: startViolationsReport Parameters: Required arguments: 'config' (type: array) -> Configuration for violations. No return value. Description: start violation reporting. ""...
def Tethering_bind(self, port): """ Function path: Tethering.bind Domain: Tethering Method name: bind Parameters: Required arguments: 'port' (type: integer) -> Port number to bind. No return value. Description: Request browser port binding. """ assert isinstance(port, (int,) ...
def Tethering_unbind(self, port): """ Function path: Tethering.unbind Domain: Tethering Method name: unbind Parameters: Required arguments: 'port' (type: integer) -> Port number to unbind. No return value. Description: Request browser port unbinding. """ assert isinstance(port, (in...
def Browser_setWindowBounds(self, windowId, bounds): """ Function path: Browser.setWindowBounds Domain: Browser Method name: setWindowBounds Parameters: Required arguments: 'windowId' (type: WindowID) -> Browser window id. 'bounds' (type: Bounds) -> New window bounds. The 'minimized', 'max...
def Runtime_evaluate(self, expression, **kwargs): """ Function path: Runtime.evaluate Domain: Runtime Method name: evaluate Parameters: Required arguments: 'expression' (type: string) -> Expression to evaluate. Optional arguments: 'objectGroup' (type: string) -> Symbolic group name tha...
def Runtime_callFunctionOn(self, functionDeclaration, **kwargs): """ Function path: Runtime.callFunctionOn Domain: Runtime Method name: callFunctionOn Parameters: Required arguments: 'functionDeclaration' (type: string) -> Declaration of the function to call. Optional arguments: 'objec...
def Runtime_releaseObjectGroup(self, objectGroup): """ Function path: Runtime.releaseObjectGroup Domain: Runtime Method name: releaseObjectGroup Parameters: Required arguments: 'objectGroup' (type: string) -> Symbolic object group name. No return value. Description: Releases all remote...
def Runtime_setCustomObjectFormatterEnabled(self, enabled): """ Function path: Runtime.setCustomObjectFormatterEnabled Domain: Runtime Method name: setCustomObjectFormatterEnabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'enabled' (type: boolean) ->...
def Runtime_compileScript(self, expression, sourceURL, persistScript, **kwargs ): """ Function path: Runtime.compileScript Domain: Runtime Method name: compileScript Parameters: Required arguments: 'expression' (type: string) -> Expression to compile. 'sourceURL' (type: string) -> Sou...
def Runtime_runScript(self, scriptId, **kwargs): """ Function path: Runtime.runScript Domain: Runtime Method name: runScript Parameters: Required arguments: 'scriptId' (type: ScriptId) -> Id of the script to run. Optional arguments: 'executionContextId' (type: ExecutionContextId) -> Sp...
def Debugger_setBreakpointsActive(self, active): """ Function path: Debugger.setBreakpointsActive Domain: Debugger Method name: setBreakpointsActive Parameters: Required arguments: 'active' (type: boolean) -> New value for breakpoints active state. No return value. Description: Activat...
def Debugger_setSkipAllPauses(self, skip): """ Function path: Debugger.setSkipAllPauses Domain: Debugger Method name: setSkipAllPauses Parameters: Required arguments: 'skip' (type: boolean) -> New value for skip pauses state. No return value. Description: Makes page not interrupt on an...
def Debugger_setScriptSource(self, scriptId, scriptSource, **kwargs): """ Function path: Debugger.setScriptSource Domain: Debugger Method name: setScriptSource Parameters: Required arguments: 'scriptId' (type: Runtime.ScriptId) -> Id of the script to edit. 'scriptSource' (type: string) -> ...
def Debugger_setPauseOnExceptions(self, state): """ Function path: Debugger.setPauseOnExceptions Domain: Debugger Method name: setPauseOnExceptions Parameters: Required arguments: 'state' (type: string) -> Pause on exceptions mode. No return value. Description: Defines pause on excepti...
def Debugger_setVariableValue(self, scopeNumber, variableName, newValue, callFrameId): """ Function path: Debugger.setVariableValue Domain: Debugger Method name: setVariableValue Parameters: Required arguments: 'scopeNumber' (type: integer) -> 0-based number of scope as was listed in scope...
def Debugger_setAsyncCallStackDepth(self, maxDepth): """ Function path: Debugger.setAsyncCallStackDepth Domain: Debugger Method name: setAsyncCallStackDepth Parameters: Required arguments: 'maxDepth' (type: integer) -> Maximum depth of async call stacks. Setting to <code>0</code> will effective...
def Debugger_setBlackboxPatterns(self, patterns): """ Function path: Debugger.setBlackboxPatterns Domain: Debugger Method name: setBlackboxPatterns WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'patterns' (type: array) -> Array of regexps that will be us...
def Debugger_setBlackboxedRanges(self, scriptId, positions): """ Function path: Debugger.setBlackboxedRanges Domain: Debugger Method name: setBlackboxedRanges WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'scriptId' (type: Runtime.ScriptId) -> Id of the ...
def Profiler_setSamplingInterval(self, interval): """ Function path: Profiler.setSamplingInterval Domain: Profiler Method name: setSamplingInterval Parameters: Required arguments: 'interval' (type: integer) -> New sampling interval in microseconds. No return value. Description: Changes...
def update_headers(self, header_args): ''' Given a set of headers, update both the user-agent and additional headers for the remote browser. header_args must be a dict. Keys are the names of the corresponding HTTP header. return value is a 2-tuple of the results of the user-agent update, as well as the ...
def get_cookies(self): ''' Retreive the cookies from the remote browser. Return value is a list of http.cookiejar.Cookie() instances. These can be directly used with the various http.cookiejar.XXXCookieJar cookie management classes. ''' ret = self.Network_getAllCookies() assert 'result' in ret, "No re...
def set_cookie(self, cookie): ''' Add a cookie to the remote chromium instance. Passed value `cookie` must be an instance of `http.cookiejar.Cookie()`. ''' # Function path: Network.setCookie # Domain: Network # Method name: setCookie # WARNING: This function is marked 'Experimental'! # Parameters: ...
def get_current_url(self): ''' Probe the remote session for the current window URL. This is primarily used to do things like unwrap redirects, or circumvent outbound url wrappers. ''' res = self.Page_getNavigationHistory() assert 'result' in res assert 'currentIndex' in res['result'] assert 'entries...
def get_page_url_title(self): ''' Get the title and current url from the remote session. Return is a 2-tuple: (page_title, page_url). ''' cr_tab_id = self.transport._get_cr_tab_meta_for_key(self.tab_id)['id'] targets = self.Target_getTargets() assert 'result' in targets assert 'targetInfos' in targe...
def execute_javascript(self, *args, **kwargs): ''' Execute a javascript string in the context of the browser tab. ''' ret = self.__exec_js(*args, **kwargs) return ret
def find_element(self, search): ''' DOM_performSearch(self, query, includeUserAgentShadowDOM) Python Function: DOM_performSearch Domain: DOM Method name: performSearch WARNING: This function is marked 'Experimental'! Parameters: 'query' (type: string) -...
def get_unpacked_response_body(self, requestId, mimetype="application/unknown"): ''' Return a unpacked, decoded resposne body from Network_getResponseBody() ''' content = self.Network_getResponseBody(requestId) assert 'result' in content result = content['result'] assert 'base64Encoded' in result asse...
def handle_page_location_changed(self, timeout=None): ''' If the chrome tab has internally redirected (generally because jerberscript), this will walk the page navigation responses and attempt to fetch the response body for the tab's latest location. ''' # In general, this is often called after other mecha...
def blocking_navigate_and_get_source(self, url, timeout=DEFAULT_TIMEOUT_SECS): ''' Do a blocking navigate to url `url`, and then extract the response body and return that. This effectively returns the *unrendered* page content that's sent over the wire. As such, if the page does any modification of the conta...
def get_rendered_page_source(self, dom_idle_requirement_secs=3, max_wait_timeout=30): ''' Get the HTML markup for the current page. This is done by looking up the root DOM node, and then requesting the outer HTML for that node ID. This calls return will reflect any modifications made by javascript to the ...
def take_screeshot(self): ''' Take a screenshot of the virtual viewport content. Return value is a png image as a bytestring. ''' resp = self.Page_captureScreenshot() assert 'result' in resp assert 'data' in resp['result'] imgdat = base64.b64decode(resp['result']['data']) return imgdat
def blocking_navigate(self, url, timeout=DEFAULT_TIMEOUT_SECS): ''' Do a blocking navigate to url `url`. This function triggers a navigation, and then waits for the browser to claim the page has finished loading. Roughly, this corresponds to the javascript `DOMContentLoaded` event, meaning the dom for the...
def tab(self, netloc=None, url=None, extra_id=None, use_tid=False): ''' Get a chromium tab from the pool, optionally one that has an association with a specific netloc/URL. If no url or netloc is specified, the per-thread identifier will be used. If `extra_id` is specified, it's stringified value will be mixed...
def on_parent_exit(signame): """ Return a function to be run in a child process which will trigger SIGNAME to be sent when the parent process dies """ signum = getattr(signal, signame) def set_parent_exit_signal(): # http://linux.die.net/man/2/prctl result = cdll['libc.so.6'].prc...
def ChromeContext(*args, **kwargs): ''' Context manager for conveniently handling the lifetime of the underlying chromium instance. In general, this should be the preferred way to use an instance of `ChromeRemoteDebugInterface`. All parameters are forwarded through to the underlying ChromeRemoteDebugInterface() c...
def synchronous_command(self, *args, **kwargs): ''' Forward a command to the remote chrome instance via the transport connection, and check the return for an error. If the command resulted in an error, a `ChromeController.ChromeError` is raised, with the error string containing the response from the remote ...
def drain_transport(self): ''' "Drain" the transport connection. This command simply returns all waiting messages sent from the remote chrome instance. This can be useful when waiting for a specific asynchronous message from chrome, but higher level calls are better suited for managing wait-for-message typ...
def resetLoggingLocks(): ''' This function is a HACK! Basically, if we fork() while a logging lock is held, the lock is /copied/ while in the acquired state. However, since we've forked, the thread that acquired the lock no longer exists, so it can never unlock the lock, and we end up blocking forever. Theref...
def stream_emit(self, record, source_name): """ Emit a record. If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. I...
def emit(self, record): """ Emit a record. If the stream was not opened because 'delay' was specified in the constructor, open it before calling the superclass's emit. """ failures = 0 while failures < 3: try: self.stream_emit(record, record.name) break except: failures += 1 else: ...
def run_suite(self, suite, **kwargs): """This is the version from Django 1.7.""" return self.test_runner( verbosity=self.verbosity, failfast=self.failfast, no_colour=self.no_colour, ).run(suite)
def generate_private_key(self): """ Generates a private key of key_length bits and attaches it to the object as the __private_key variable. :return: void :rtype: void """ key_length = self.key_length // 8 + 8 key = 0 try: key = int.from_bytes...
def generate_public_key(self): """ Generates public key. :return: void :rtype: void """ self.public_key = pow(self.generator, self.__private_key, self.prime)
def generate_shared_secret(self, other_public_key, echo_return_key=False): """ Generates shared secret from the other party's public key. :param other_public_key: Other party's public key :type other_public_key: int :param echo_return_key: Echo return shared key :type bo...
def requires_private_key(func): """ Decorator for functions that require the private key to be defined. """ def func_wrapper(self, *args, **kwargs): if hasattr(self, "_DiffieHellman__private_key"): func(self, *args, **kwargs) else: self.generate_private_key() ...
def requires_public_key(func): """ Decorator for functions that require the public key to be defined. By definition, this includes the private key, as such, it's enough to use this to effect definition of both public and private key. """ def func_wrapper(self, *args, **kwargs): if hasattr(self,...
def print_debug(*args, **kwargs): """ Print if and only if the debug flag is set true in the config.yaml file. Args: args : var args of print arguments. """ if WTF_CONFIG_READER.get("debug", False) == True: print(*args, **kwargs)
def print_time(self, message="Time is now: ", print_frame_info=True): """ Print the current elapsed time. Kwargs: message (str) : Message to prefix the time stamp. print_frame_info (bool) : Add frame info to the print message. """ if print_frame_info: ...
def check_url(url): ''' Check if resource at URL is fetchable. (by trying to fetch it and checking for 200 status. Args: url (str): Url to check. Returns: Returns a tuple of {True/False, response code} ''' request = urllib2.Request(url) ...
def get_base_url(webdriver): """ Get the current base URL. Args: webdriver: Selenium WebDriver instance. Returns: str - base URL. Usage:: driver.get("http://www.google.com/?q=hello+world") WebUtils.get_base_url(driver) ...
def get_browser_datetime(webdriver): """ Get the current date/time on the web browser as a Python datetime object. This date matches 'new Date();' when ran in JavaScript console. Args: webdriver: Selenium WebDriver instance Returns: datetime - Py...
def is_webdriver_mobile(webdriver): """ Check if a web driver if mobile. Args: webdriver (WebDriver): Selenium webdriver. """ browser = webdriver.capabilities['browserName'] if (browser == u('iPhone') or browser == u('android')): re...
def is_webdriver_ios(webdriver): """ Check if a web driver if mobile. Args: webdriver (WebDriver): Selenium webdriver. """ browser = webdriver.capabilities['browserName'] if (browser == u('iPhone') or browser == u('iPad')): return T...
def row_to_dictionary(header_row_web_element, row_webelement): """ Converts a row into a dictionary of key/values. (Note: assumes all rows/columns have uniform cells. Does not account for any row or column spans) Args: header_row_web_element (WebElement): W...
def switch_to_window(page_class, webdriver): """ Utility method for switching between windows. It will search through currently open windows, then switch to the window matching the provided PageObject class. Args: page_class (PageObject): Page class to search for/instantia...
def start_standby(cls, webdriver=None, max_time=WTF_TIMEOUT_MANAGER.EPIC, sleep=5): """ Create an instance of BrowserStandBy() and immediately return a running instance. This is best used in a 'with' block. Example:: with BrowserStandBy.start_standby(): # N...
def start(self): """ Start standing by. A periodic command like 'current_url' will be sent to the webdriver instance to prevent it from timing out. """ self._end_time = datetime.now() + timedelta(seconds=self._max_time) self._thread = Thread(target=lambda: self.__stand...
def temp_path(file_name=None): """ Gets a temp path. Kwargs: file_name (str) : if file name is specified, it gets appended to the temp dir. Usage:: temp_file_path = temp_path("myfile") copyfile("myfile", temp_file_path) # copies 'myfile' to '/tmp/myfile' """ if file_...
def create_temp_file(file_name=None, string_or_another_file=""): """ Creates a temp file using a given name. Temp files are placed in the Project/temp/ directory. Any temp files being created with an existing temp file, will be overridden. This is useful for testing uploads, where you would want to...
def download_to_tempfile(url, file_name=None, extension=None): """ Downloads a URL contents to a tempfile. This is useful for testing downloads. It will download the contents of a URL to a tempfile, which you then can open and use to validate the downloaded contents. Args: url (str) : URL...
def create_page(cls, webdriver=None, **kwargs): """Class method short cut to call PageFactory on itself. Use it to instantiate this PageObject using a webdriver. Args: webdriver (Webdriver): Instance of Selenium Webdriver. Returns: PageObject Raises: ...
def create_page(page_object_class_or_interface, webdriver=None, **kwargs): """ Instantiate a page object from a given Interface or Abstract class. Args: page_object_class_or_interface (Class): PageObject class, AbstractBaseClass, or Interface to atte...
def __instantiate_page_object(page_obj_class, webdriver, **kwargs): """ Attempts to instantiate a page object. Args: page_obj_class (PageObject) - PageObject to instantiate. webdriver (WebDriver) - Selenium webdriver to associate with the PageObject Retu...
def __itersubclasses(cls, _seen=None): """ Credit goes to: http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/ itersubclasses(cls) Generator over all subclasses of a given class, in depth first order. >>> list(itersubclasses(int)) == [bool...
def check_css_selectors(webdriver, *selectors): """Returns true if all CSS selectors passed in is found. This can be used to quickly validate a page. Args: webdriver (Webdriver) : Selenium Webdriver instance selectors (str) : N number of CSS selectors strings to match ...
def wait_until_page_loaded(page_obj_class, webdriver=None, timeout=WTF_TIMEOUT_MANAGER.NORMAL, sleep=0.5, bad_page_classes=[], message=None, ...
def wait_until_page_ready(page_object, timeout=WTF_TIMEOUT_MANAGER.NORMAL): """Waits until document.readyState == Complete (e.g. ready to execute javascript commands) Args: page_object (PageObject) : PageObject class Kwargs: timeout (number) : timeout period """...