Bug 1107336: Update imports to new Marionette Driver from runner; r=jgriffin

--HG--
extra : rebase_source : a10f5b8e538a02dfc02fdca59ee0b7b2c57aaade
extra : source : 6aca01a96d378e24c3a094263bd7780e9a138c6b
This commit is contained in:
David Burns 2015-01-05 21:51:03 +00:00
Родитель 748a5b4c12
Коммит c240465531
4 изменённых файлов: 10 добавлений и 72 удалений

Просмотреть файл

@ -2,11 +2,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gestures import smooth_scroll, pinch
from by import By
from marionette import Marionette, HTMLElement, Actions, MultiActions
from marionette_driver.gestures import smooth_scroll, pinch
from marionette_driver.by import By
from marionette_driver.marionette import Marionette, HTMLElement, Actions, MultiActions
from marionette_test import MarionetteTestCase, MarionetteJSTestCase, CommonTestCase, expectedFailure, skip, SkipTest
from errors import (
from marionette_driver.errors import (
ElementNotVisibleException,
ElementNotAccessibleException,
ErrorCodes,
@ -50,6 +50,6 @@ from runner import (
TestResult,
TestResultCollection
)
from wait import Wait
from date_time_value import DateTimeValue
import decorators
from marionette_driver.wait import Wait
from marionette_driver.date_time_value import DateTimeValue
import marionette_driver.decorators

Просмотреть файл

@ -3,8 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_test import MarionetteTestCase
from errors import ElementNotAccessibleException
from errors import ElementNotVisibleException
from marionette_driver.errors import (ElementNotAccessibleException,
ElementNotVisibleException)
class TestAccessibility(MarionetteTestCase):

Просмотреть файл

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import errors
from marionette_driver import errors
import marionette_test

Просмотреть файл

@ -2,13 +2,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_test import MarionetteTestCase, skip_if_e10s
from marionette import Keys
class TestWindowHandles(MarionetteTestCase):
@skip_if_e10s # Interactions with about: pages need e10s support (bug 1096488).
def test_new_tab_window_handles(self):
keys = [Keys.SHIFT]
if self.marionette.session_capabilities['platformName'] == 'DARWIN':
@ -93,63 +90,4 @@ class TestWindowHandles(MarionetteTestCase):
self.marionette.switch_to_window(start_tab)
def test_tab_and_window_handles(self):
start_tab = self.marionette.current_window_handle
start_chrome_window = self.marionette.current_chrome_window_handle
tab_open_page = self.marionette.absolute_url("windowHandles.html")
window_open_page = self.marionette.absolute_url("test_windows.html")
# Open a new tab and switch to it.
self.marionette.navigate(tab_open_page)
link = self.marionette.find_element("id", "new-tab")
link.click()
self.wait_for_condition(lambda mn: len(mn.window_handles) == 2)
self.assertEqual(len(self.marionette.chrome_window_handles), 1)
self.assertEqual(self.marionette.current_chrome_window_handle, start_chrome_window)
handles = self.marionette.window_handles
handles.remove(start_tab)
new_tab = handles.pop()
self.marionette.switch_to_window(new_tab)
self.assertEqual(self.marionette.get_url(), "about:blank")
# Open a new window from the new tab.
self.marionette.navigate(window_open_page)
link = self.marionette.find_element("link text", "Open new window")
link.click()
self.wait_for_condition(lambda mn: len(mn.window_handles) == 3)
self.assertEqual(len(self.marionette.chrome_window_handles), 2)
self.assertEqual(self.marionette.current_chrome_window_handle, start_chrome_window)
# Find the new window and switch to it.
handles = self.marionette.window_handles
handles.remove(start_tab)
handles.remove(new_tab)
new_window = handles.pop()
self.marionette.switch_to_window(new_window)
results_page = self.marionette.absolute_url("resultPage.html")
self.assertEqual(self.marionette.get_url(), results_page)
self.assertEqual(len(self.marionette.chrome_window_handles), 2)
self.assertNotEqual(self.marionette.current_chrome_window_handle, start_chrome_window)
# Return to our original tab and close it.
self.marionette.switch_to_window(start_tab)
self.marionette.close()
self.assertEquals(len(self.marionette.window_handles), 2)
# Close the opened window and carry on in our new tab.
self.marionette.switch_to_window(new_window)
self.marionette.close()
self.assertEqual(len(self.marionette.window_handles), 1)
self.marionette.switch_to_window(new_tab)
self.assertEqual(self.marionette.get_url(), results_page)
self.marionette.navigate("about:blank")
self.assertEqual(len(self.marionette.chrome_window_handles), 1)
self.assertEqual(self.marionette.current_chrome_window_handle, start_chrome_window)