Test drag-and-drop schedule editor
This commit is contained in:
parent
6e276b2787
commit
163b12a804
4 changed files with 97 additions and 0 deletions
14
spec/support/jquery_macros.rb
Normal file
14
spec/support/jquery_macros.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module JQueryMacros
|
||||
# Wait for one jQuery Ajax request during the block
|
||||
def wait_for_ajax
|
||||
flag = "window.ajax_#{SecureRandom.alphanumeric(16)}"
|
||||
page.execute_script "#{flag} = false; $(document).one('ajaxComplete', () => #{flag} = true);"
|
||||
|
||||
yield
|
||||
|
||||
Timeout.timeout(Capybara.default_max_wait_time) { loop until page.evaluate_script(flag) }
|
||||
page.execute_script "delete #{flag};"
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue