コード例 #1
0
 def test_raises_error_if_default_max_wait_time_is_less_than_timeout(
         self, session):
     button = session.find("css", "#openWindowWithLongerTimeout")
     with capybara.using_wait_time(0.4):
         with pytest.raises(WindowError):
             session.window_opened_by(lambda: button.click())
     assert_windows_open(session, 2)
コード例 #2
0
 def test_raises_error_when_two_windows_have_been_opened_by_lambda(
         self, session):
     button = session.find("css", "#openTwoWindows")
     with pytest.raises(WindowError):
         # It's possible for ``window_opened_by`` to be fulfilled before the second
         # window opens.
         session.window_opened_by(lambda: button.click() or sleep(1))
     assert_windows_open(session, 3)
コード例 #3
0
ファイル: test_with_window.py プロジェクト: ofek/capybara.py
 def setup_session(self, session):
     session.visit("/with_windows")
     session.find("css", "#openTwoWindows").click()
     assert_windows_open(session, 3)