Skip to content

Commit 4e28cd2

Browse files
committed
ignoring phanotmjs in python alert tests
1 parent 8544b9e commit 4e28cd2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

py/test/selenium/webdriver/common/alerts_tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ def testShouldHandleAlertOnPageLoad(self):
252252
self.assertEquals("onload", value)
253253

254254
def testShouldHandleAlertOnPageLoadUsingGet(self):
255+
if self.driver.capabilities['browserName'] == 'phantomjs':
256+
pytest.xfail("phantomjs driver does not support alerts")
255257
self.driver.get(self._pageURL("pageWithOnLoad"))
256258

257259
alert = self._waitForAlert()
@@ -262,6 +264,8 @@ def testShouldHandleAlertOnPageLoadUsingGet(self):
262264
WebDriverWait(self.driver, 3).until(EC.text_to_be_present_in_element((By.TAG_NAME, "p"), "Page with onload event handler"))
263265

264266
def testShouldHandleAlertOnPageBeforeUnload(self):
267+
if self.driver.capabilities['browserName'] == 'phantomjs':
268+
pytest.xfail("phantomjs driver does not support alerts")
265269
self.driver.get(self._pageURL("pageWithOnBeforeUnloadMessage"))
266270

267271
element = self.driver.find_element(By.ID, "navigate")
@@ -277,6 +281,8 @@ def testShouldHandleAlertOnPageBeforeUnload(self):
277281
WebDriverWait(self.driver, 3).until(EC.title_is("Testing Alerts"))
278282

279283
def _testShouldHandleAlertOnPageBeforeUnloadAtQuit(self):
284+
if self.driver.capabilities['browserName'] == 'phantomjs':
285+
pytest.xfail("phantomjs driver does not support alerts")
280286
# TODO: Add the ability to get a new session
281287
self.driver.get(self._pageURL("pageWithOnBeforeUnloadMessage"))
282288

@@ -298,6 +304,8 @@ def testShouldAllowTheUserToGetTheTextOfAnAlert(self):
298304
self.assertEqual("cheese", value)
299305

300306
def testShouldAllowTheUserToGetTheTextOfAPrompt(self):
307+
if self.driver.capabilities['browserName'] == 'phantomjs':
308+
pytest.xfail("phantomjs driver does not support alerts")
301309
self._loadPage("alerts")
302310
self.driver.find_element(By.ID, "prompt").click()
303311

@@ -308,6 +316,8 @@ def testShouldAllowTheUserToGetTheTextOfAPrompt(self):
308316
self.assertEquals("Enter something", value)
309317

310318
def testAlertShouldNotAllowAdditionalCommandsIfDismissed(self):
319+
if self.driver.capabilities['browserName'] == 'phantomjs':
320+
pytest.xfail("phantomjs driver does not support alerts")
311321
self._loadPage("alerts")
312322
self.driver.find_element(By.ID, "alert").click()
313323

0 commit comments

Comments
 (0)