Skip to content

Commit

Permalink
[wdspec] Run each "Send Alert Text" in its own tab.
Browse files Browse the repository at this point in the history
To prevent possible rate limits by the browser when running the
tests in verify mode, each test should run in its own tab.

Differential Revision: https://phabricator.services.mozilla.com/D20312

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1528463
gecko-commit: 83a92a1a4986eaccd94bb16e9b38b41aa1ab445e
gecko-integration-branch: autoland
gecko-reviewers: jgraham
  • Loading branch information
whimboo authored and moz-wptsync-bot committed Feb 20, 2019
1 parent 048fff6 commit 40a57e1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions webdriver/tests/send_alert_text/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pytest

from webdriver.error import NoSuchAlertException, NoSuchWindowException


@pytest.fixture(name="session")
def fixture_session(capabilities, session, create_window):
"""Prevent dialog rate limits by running the test in a new window."""
original_handle = session.window_handle
session.window_handle = create_window()

yield session

try:
session.alert.dismiss()
except NoSuchAlertException:
pass

try:
session.close()
except NoSuchWindowException:
pass

session.window_handle = original_handle

0 comments on commit 40a57e1

Please sign in to comment.