Method: Protractor#sync

Defined in:
lib/angular_webdriver/protractor/protractor.rb

#sync(webdriver_command) ⇒ Object

Syncs the webdriver command if it’s white listed

Parameters:

  • webdriver_command (Symbol)

    the webdriver command to check for syncing



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/angular_webdriver/protractor/protractor.rb', line 332

def sync webdriver_command
  return unless webdriver_command
  webdriver_command = webdriver_command.intern
  # Note get must not sync here because the get command is redirected to
  # protractor.get which already has the sync logic built in.
  #
  # also don't sync set location (protractor custom command already waits
  # for angular). the selenium set location is for latitude/longitude/altitude
  # and that doesn't require syncing
  #
  sync_whitelist    = %i(
    getCurrentUrl
    refresh
    getPageSource
    getTitle
    findElement
    findElements
    findChildElement
    findChildElements
  )
  must_sync         = sync_whitelist.include? webdriver_command

  waitForAngular if must_sync
end