Skip to content

Commit

Permalink
[py] remove phantomjs from test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
lmtierney committed Dec 6, 2017
1 parent b3daa03 commit bd3e7a7
Show file tree
Hide file tree
Showing 19 changed files with 3 additions and 184 deletions.
1 change: 0 additions & 1 deletion py/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
'Firefox',
'Ie',
'Marionette',
'PhantomJS',
'Remote',
'Safari',
'WebKitGTK',
Expand Down
2 changes: 1 addition & 1 deletion py/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The `selenium` package is used to automate web browser interaction from Python.
| **IRC**: | **#selenium** channel on freenode |
+-----------+--------------------------------------------------------------------------------------+

Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer, PhantomJS), as well as the Remote protocol.
Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer), as well as the Remote protocol.

Supported Python Versions
=========================
Expand Down
66 changes: 0 additions & 66 deletions py/test/selenium/webdriver/common/alerts_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def testShouldBeAbleToOverrideTheWindowAlertMethod(driver, pages):
raise e


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldAllowUsersToAcceptAnAlertManually(driver, pages):
Expand All @@ -71,9 +68,6 @@ def testShouldAllowUsersToAcceptAnAlertManually(driver, pages):
assert "Testing Alerts" == driver.title


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldAllowUsersToAcceptAnAlertWithNoTextManually(driver, pages):
Expand All @@ -86,9 +80,6 @@ def testShouldAllowUsersToAcceptAnAlertWithNoTextManually(driver, pages):
assert "Testing Alerts" == driver.title


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldGetTextOfAlertOpenedInSetTimeout(driver, pages):
Expand All @@ -109,9 +100,6 @@ def testShouldGetTextOfAlertOpenedInSetTimeout(driver, pages):
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=26 and https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500',
run=False)
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testShouldAllowUsersToDismissAnAlertManually(driver, pages):
pages.load("alerts.html")
driver.find_element(by=By.ID, value="alert").click()
Expand All @@ -121,9 +109,6 @@ def testShouldAllowUsersToDismissAnAlertManually(driver, pages):
assert "Testing Alerts" == driver.title


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldAllowAUserToAcceptAPrompt(driver, pages):
Expand All @@ -136,9 +121,6 @@ def testShouldAllowAUserToAcceptAPrompt(driver, pages):
assert "Testing Alerts" == driver.title


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldAllowAUserToDismissAPrompt(driver, pages):
Expand All @@ -153,9 +135,6 @@ def testShouldAllowAUserToDismissAPrompt(driver, pages):

@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testShouldAllowAUserToSetTheValueOfAPrompt(driver, pages):
pages.load("alerts.html")
driver.find_element(by=By.ID, value="prompt").click()
Expand All @@ -169,9 +148,6 @@ def testShouldAllowAUserToSetTheValueOfAPrompt(driver, pages):

@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1353')
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testSettingTheValueOfAnAlertThrows(driver, pages):
pages.load("alerts.html")
driver.find_element(By.ID, "alert").click()
Expand All @@ -186,9 +162,6 @@ def testSettingTheValueOfAnAlertThrows(driver, pages):
condition=sys.platform == 'darwin',
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=26',
run=False)
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testAlertShouldNotAllowAdditionalCommandsIfDimissed(driver, pages):
pages.load("alerts.html")
driver.find_element(By.ID, "alert").click()
Expand All @@ -200,9 +173,6 @@ def testAlertShouldNotAllowAdditionalCommandsIfDimissed(driver, pages):
alert.text


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
@pytest.mark.xfail_marionette(reason='Fails on travis')
Expand All @@ -217,9 +187,6 @@ def testShouldAllowUsersToAcceptAnAlertInAFrame(driver, pages):
assert "Testing Alerts" == driver.title


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
@pytest.mark.xfail_marionette(reason='Fails on travis')
Expand All @@ -241,9 +208,6 @@ def testShouldThrowAnExceptionIfAnAlertHasNotBeenDealtWithAndDismissTheAlert():
# //TODO(David) Complete this test


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testPromptShouldUseDefaultValueIfNoKeysSent(driver, pages):
Expand All @@ -257,9 +221,6 @@ def testPromptShouldUseDefaultValueIfNoKeysSent(driver, pages):
assert "This is a default value" == txt


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testPromptShouldHaveNullValueIfDismissed(driver, pages):
Expand All @@ -271,9 +232,6 @@ def testPromptShouldHaveNullValueIfDismissed(driver, pages):
assert "null" == driver.find_element(By.ID, "text").text


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testHandlesTwoAlertsFromOneInteraction(driver, pages):
Expand All @@ -293,9 +251,6 @@ def testHandlesTwoAlertsFromOneInteraction(driver, pages):
assert driver.find_element(By.ID, "text2").text == "cheddar"


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldHandleAlertOnPageLoad(driver, pages):
Expand All @@ -307,9 +262,6 @@ def testShouldHandleAlertOnPageLoad(driver, pages):
assert "onload" == value


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testShouldHandleAlertOnPageLoadUsingGet(driver, pages):
pages.load("pageWithOnLoad.html")
alert = _waitForAlert(driver)
Expand All @@ -320,9 +272,6 @@ def testShouldHandleAlertOnPageLoadUsingGet(driver, pages):
WebDriverWait(driver, 3).until(EC.text_to_be_present_in_element((By.TAG_NAME, "p"), "Page with onload event handler"))


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldHandleAlertOnPageBeforeUnload(driver, pages):
Expand All @@ -341,9 +290,6 @@ def testShouldHandleAlertOnPageBeforeUnload(driver, pages):
WebDriverWait(driver, 3).until(EC.title_is("Testing Alerts"))


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def _testShouldHandleAlertOnPageBeforeUnloadAtQuit(driver, pages):
Expand All @@ -358,9 +304,6 @@ def _testShouldHandleAlertOnPageBeforeUnloadAtQuit(driver, pages):
driver.quit()


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testShouldAllowTheUserToGetTheTextOfAnAlert(driver, pages):
Expand All @@ -374,9 +317,6 @@ def testShouldAllowTheUserToGetTheTextOfAnAlert(driver, pages):

@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testShouldAllowTheUserToGetTheTextOfAPrompt(driver, pages):
pages.load("alerts.html")
driver.find_element(By.ID, "prompt").click()
Expand All @@ -388,9 +328,6 @@ def testShouldAllowTheUserToGetTheTextOfAPrompt(driver, pages):
assert "Enter something" == value


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500')
def testAlertShouldNotAllowAdditionalCommandsIfDismissed(driver, pages):
Expand All @@ -408,9 +345,6 @@ def testAlertShouldNotAllowAdditionalCommandsIfDismissed(driver, pages):
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1537')
@pytest.mark.xfail_marionette(
reason='https://bugzilla.mozilla.org/show_bug.cgi?id=1279211')
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20',
raises=WebDriverException)
def testUnexpectedAlertPresentExceptionContainsAlertText(driver, pages):
pages.load("alerts.html")
driver.find_element(by=By.ID, value="alert").click()
Expand Down
2 changes: 0 additions & 2 deletions py/test/selenium/webdriver/common/api_example_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ def testIsElementDisplayed(driver, pages):
assert not not_visible


@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/466')
def testMoveWindowPosition(driver, pages):
pages.load("blank.html")
loc = driver.get_window_position()
Expand Down
1 change: 0 additions & 1 deletion py/test/selenium/webdriver/common/appcache_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

@pytest.mark.xfail_chrome
@pytest.mark.xfail_marionette(raises=WebDriverException)
@pytest.mark.xfail_phantomjs(raises=WebDriverException)
@pytest.mark.xfail_remote
def testWeCanGetTheStatusOfTheAppCache(driver, pages):
pages.load('html5Page')
Expand Down
14 changes: 0 additions & 14 deletions py/test/selenium/webdriver/common/driver_element_finding_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ def test_Should_Not_Be_Able_To_Locate_By_Id_Multiple_Elements_That_Do_Not_Exist(
assert len(elements) == 0


@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
def test_Finding_ASingle_Element_By_Empty_Id_Should_Throw(driver, pages):
pages.load("formPage.html")
with pytest.raises(NoSuchElementException):
driver.find_element(By.ID, "")


@pytest.mark.xfail_phantomjs(raises=NoSuchElementException)
def test_Finding_Multiple_Elements_By_Empty_Id_Should_Return_Empty_List(driver, pages):
pages.load("formPage.html")
elements = driver.find_elements(By.ID, "")
Expand Down Expand Up @@ -132,14 +130,12 @@ def test_Should_Not_Be_Able_To_Locate_By_Name_Multiple_Elements_That_Do_Not_Exis
assert len(elements) == 0


@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
def test_Finding_ASingle_Element_By_Empty_Name_Should_Throw(driver, pages):
pages.load("formPage.html")
with pytest.raises(NoSuchElementException):
driver.find_element(By.NAME, "")


@pytest.mark.xfail_phantomjs(raises=NoSuchElementException)
def test_Finding_Multiple_Elements_By_Empty_Name_Should_Return_Empty_List(driver, pages):
pages.load("formPage.html")
elements = driver.find_elements(By.NAME, "")
Expand Down Expand Up @@ -188,7 +184,6 @@ def test_Should_Not_Be_Able_To_Locate_By_Tag_Name_Multiple_Elements_That_Do_Not_

@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1541')
@pytest.mark.xfail_phantomjs
def test_Finding_ASingle_Element_By_Empty_Tag_Name_Should_Throw(driver, pages):
pages.load("formPage.html")
with pytest.raises(InvalidSelectorException):
Expand All @@ -197,7 +192,6 @@ def test_Finding_ASingle_Element_By_Empty_Tag_Name_Should_Throw(driver, pages):

@pytest.mark.xfail_chrome(
reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=1541')
@pytest.mark.xfail_phantomjs
def test_Finding_Multiple_Elements_By_Empty_Tag_Name_Should_Throw(driver, pages):
pages.load("formPage.html")
with pytest.raises(InvalidSelectorException):
Expand Down Expand Up @@ -269,7 +263,6 @@ def test_Should_Not_Find_Element_By_Class_When_The_Name_Queried_Is_Shorter_Than_
driver.find_element(By.CLASS_NAME, "name_B")


@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
def test_Finding_ASingle_Element_By_Empty_Class_Name_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
Expand All @@ -282,21 +275,18 @@ def test_Finding_Multiple_Elements_By_Empty_Class_Name_Should_Throw(driver, page
driver.find_elements(By.CLASS_NAME, "")


@pytest.mark.xfail_phantomjs(raises=WebDriverException)
def test_Finding_ASingle_Element_By_Compound_Class_Name_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
driver.find_element(By.CLASS_NAME, "a b")


@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
def test_Finding_ASingle_Element_By_Invalid_Class_Name_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
driver.find_element(By.CLASS_NAME, "!@#$%^&*")


@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
def test_Finding_Multiple_Elements_By_Invalid_Class_Name_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
Expand Down Expand Up @@ -356,7 +346,6 @@ def test_Finding_ALink_By_Xpath_Using_Contains_Keyword_Should_Work(driver, pages
@pytest.mark.xfail_firefox(raises=InvalidSelectorException)
@pytest.mark.xfail_remote(raises=InvalidSelectorException)
@pytest.mark.xfail_marionette(raises=WebDriverException)
@pytest.mark.xfail_phantomjs(raises=InvalidSelectorException)
@pytest.mark.xfail_safari(raises=NoSuchElementException)
@pytest.mark.xfail_webkitgtk(raises=InvalidSelectorException)
def test_Should_Be_Able_To_Find_Element_By_XPath_With_Namespace(driver, pages):
Expand Down Expand Up @@ -493,7 +482,6 @@ def test_Should_Not_Find_Elements_By_Css_Selector_When_There_Is_No_Such_Element(
assert len(elements) == 0


@pytest.mark.xfail_phantomjs(raises=NoSuchWindowException)
def test_Finding_ASingle_Element_By_Empty_Css_Selector_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
Expand All @@ -506,14 +494,12 @@ def test_Finding_Multiple_Elements_By_Empty_Css_Selector_Should_Throw(driver, pa
driver.find_elements(By.CSS_SELECTOR, "")


@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
def test_Finding_ASingle_Element_By_Invalid_Css_Selector_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
driver.find_element(By.CSS_SELECTOR, "//a/b/c[@id='1']")


@pytest.mark.xfail_phantomjs(raises=InvalidElementStateException)
def test_Finding_Multiple_Elements_By_Invalid_Css_Selector_Should_Throw(driver, pages):
pages.load("xhtmlTest.html")
with pytest.raises(NoSuchElementException):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ def testShouldBeAbleToReturnArraysOfWebElementsFromAsyncScripts(driver, pages):
# assert list_[0] == list_[1]


@pytest.mark.xfail_phantomjs(run=False)
def testShouldTimeoutIfScriptDoesNotInvokeCallback(driver, pages):
pages.load("ajaxy_page.html")
with pytest.raises(TimeoutException):
# Script is expected to be async and explicitly callback, so this should timeout.
driver.execute_async_script("return 1 + 2;")


@pytest.mark.xfail_phantomjs(run=False)
def testShouldTimeoutIfScriptDoesNotInvokeCallbackWithAZeroTimeout(driver, pages):
pages.load("ajaxy_page.html")
with pytest.raises(TimeoutException):
Expand Down
Loading

0 comments on commit bd3e7a7

Please sign in to comment.