def test_switch_to_new_window(self):
     page = AlertPage()
     handler = WindowsHandler()
     page.open()
     parent = handler.active_window
     handler.save_window_set()
     assert not (handler.is_new_window_present())
     page.open_new_window_link.click()
     assert (handler.is_new_window_present())
     new = handler.new_window
     handler.switch_to_new_window()
     assert new == handler.active_window
     handler.drop_active_window()
     assert parent == handler.active_window
 def test_switch_to_new_window(self):
     page = AlertPage()
     handler = WindowsHandler()
     page.open()
     parent = handler.active_window
     handler.save_window_set()
     assert_false(handler.is_new_window_present())
     page.open_new_window_link.click()
     ok_(handler.is_new_window_present())
     new = handler.new_window
     handler.switch_to_new_window()
     eq_(new, handler.active_window)
     handler.drop_active_window()
     eq_(parent, handler.active_window)
Beispiel #3
0
 def test_alert_presence(self):
     page = AlertPage()
     page.open()
     handler = WindowsHandler()
     assert not (handler.is_alert_present())
     page.alert_link.click()
     assert handler.is_alert_present()
     assert handler.get_alert_text() == 'cheese'
     handler.accept_alert()
     assert not (handler.is_alert_present())
Beispiel #4
0
 def test_alert_presence(self):
     page = AlertPage()
     page.open()
     handler = WindowsHandler()
     assert_false(handler.is_alert_present())
     page.alert_link.click()
     ok_(handler.is_alert_present())
     eq_(handler.get_alert_text(), 'cheese')
     handler.accept_alert()
     assert_false(handler.is_alert_present())
 def test_switch_to_new_window(self):
     page = AlertPage()
     handler = WindowsHandler()
     page.open()
     parent = handler.active_window
     handler.save_window_set()
     assert_false(handler.is_new_window_present())
     page.open_new_window_link.click()
     ok_(handler.is_new_window_present())
     new = handler.new_window
     handler.switch_to_new_window()
     eq_(new, handler.active_window)
     handler.drop_active_window()
     eq_(parent, handler.active_window)