test/ui_test_helper.rb
# wait until a specific modal has completed opening (will be once shown.bs.modal fires and OPEN_MODAL has a value)
wait until a specific modal has completed opening (will be once shown.bs.modal fires and OPEN_MODAL has a value)
wait until a specific modal has completed opening ( will be once shown . bs . modal fires and OPEN_MODAL has a value )
def wait_for_modal_open(id)
    i = 0
    $verbose ? puts("waiting for open of requested modal #{id}") : nil
    while @driver.execute_script("return OPEN_MODAL") == ''
      if i == 30
        $verbose ? puts("Exiting wait_for_modal_open(#{id}) after 30 seconds - no modal open") : nil
        return true
      else
        $verbose ? puts("waiting; OPEN_MODAL: #{@driver.execute_script("return OPEN_MODAL")}") : nil
        sleep(1)
        i += 1
      end
    end
    $verbose ? puts("current open modal: #{@driver.execute_script("return OPEN_MODAL")}") : nil
    @wait.until {@driver.execute_script("return OPEN_MODAL") == id}
    $verbose ? puts("requested modal #{id} now open") : nil
    true
  end
def wait_for_modal_open ( id ) i = 0 $verbose ? puts ( "waiting for open of requested modal #{id}" ) : nil while @driver . execute_script ( "return OPEN_MODAL" ) == '' if i == 30 $verbose ? puts ( "Exiting wait_for_modal_open(#{id}) after 30 seconds - no modal open" ) : nil return true else $verbose ? puts ( "waiting; OPEN_MODAL: #{@driver.execute_script("return OPEN_MODAL")}" ) : nil sleep ( 1 ) i += 1 end end $verbose ? puts ( "current open modal: #{@driver.execute_script("return OPEN_MODAL")}" ) : nil @wait . until { @driver . execute_script ( "return OPEN_MODAL" ) == id } $verbose ? puts ( "requested modal #{id} now open" ) : nil true end
wait until a specific modal has completed opening (will be once shown.bs.modal fires and OPEN_MODAL has a value)
wait until a specific modal has completed opening ( will be once shown . bs . modal fires and OPEN_MODAL has a value )
# sanity check in case modal has already opened and closed - if no modal opens in 10 seconds then exit and continue # need to wait until modal is in the page and has completed opening
id
<not_specific>