Capybara doesn't recognize dynamically added DOM elements?

前端 未结 3 410
旧巷少年郎
旧巷少年郎 2021-02-01 22:04

I seem to be having trouble testing the slick javascript things I do with jQuery when using Capybara and Selenium. The expected behavior is for a form to be dynamically generat

3条回答
  •  醉梦人生
    2021-02-01 22:31

    From the Capybara docs:

    When working with asynchronous JavaScript, you might come across situations where you are attempting to interact with an element which is not yet present on the page. Capybara automatically deals with this by waiting for elements to appear on the page.

    You might have some luck increasing the wait time:

    Capybara.default_wait_time = 10
    

    If that doesn't help then I would encorage you to contact somebody from the project on GitHub, write to the mailing list or submit an issue report.

提交回复
热议问题