Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start running webdriver tests #13261

Closed
wants to merge 9 commits into from
Prev

Replace uses of Session.window_handle[s] with Session.handle[s].

  • Loading branch information
jdm committed Sep 14, 2016
commit 2449bc73165a66a7a344d720f399e0918d9bfdec
@@ -66,29 +66,29 @@ def session(self, request):

def dismiss_user_prompts(self):
"""Dismisses any open user prompts in windows."""
current_window = self.client.window_handle
current_window = self.client.handle

for window in self.windows():
self.client.window_handle = window
self.client.handle = window
try:
self.client.alert.dismiss()
except webdriver.NoSuchAlertException:
pass

self.client.window_handle = current_window
self.client.handle = current_window

def restore_windows(self):
"""Closes superfluous windows opened by the test without ending
the session implicitly by closing the last window.
"""
current_window = self.client.window_handle
current_window = self.client.handle

for window in self.windows(exclude=[current_window]):
self.client.window_handle = window
if len(self.client.window_handles) > 1:
self.client.handle = window
if len(self.client.handles) > 1:
self.client.close()

self.client.window_handle = current_window
self.client.handle = current_window

def switch_to_top_level_browsing_context(self):
"""If the current browsing context selected by WebDriver is a
@@ -103,5 +103,5 @@ def windows(self, exclude=None):
"""
if exclude is None:
exclude = []
wins = [w for w in self.client.window_handles if w not in exclude]
wins = [w for w in self.client.handles if w not in exclude]
return set(wins)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.