Capybara doesn't recognize dynamically added DOM elements?

前端 未结 3 426
旧巷少年郎
旧巷少年郎 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条回答
  •  旧时难觅i
    2021-02-01 22:23

    Even wait_until deleted from Capybara 2.0. Still that's useful and grab code from below:

     def wait_until(delay = 1)   
     seconds_waited = 0   
     while ! yield && seconds_waited < Capybara.default_wait_time     
        sleep delay     
        seconds_waited += 1   
      end   
      raise "Waited for #{Capybara.default_wait_time} seconds but condition did not become true" unless yield 
    end
    

提交回复
热议问题