     @waitUntilLoaded()
     # TODO: Make this a `data-title` attribute
     # HACK: Might need to scroll the item to click on into view
-    el = wait(@test).for(css: "[data-title='#{title}']")
+    el = @test.utils.wait.for(css: "[data-title='#{title}']")
     windowPosition(test).scrollTo(el)
     el.click()
     windowPosition(test).scrollTop()

  verify(test)
  # TODO: Make this a `data-title` attribute
  # HACK: Might need to scroll the item to click on into view
  el = wait(test).for(css: "[data-title='#{title}']")
  windowPosition(test).scrollTo(el)
  el.click()
  windowPosition(test).scrollTop()

goPerformanceForecast = (test) ->
  wait(test).click(linkText: 'Performance Forecast')

Popup =
  verify: (test) ->
    # wait until the calendar is open
    wait(test).for(css: '.plan-modal .panel.panel-default')
  close: (test) ->
    wait(test).click(css: '.plan-modal .close')
    test.sleep(2000) # Wait for the modal to animate and disappear

  goEdit: (test) ->
    wait(test).click(linkText: 'Edit Assignment')

  goReview: (test) ->
    # BUG: Should rely on button classes
    wait(test).click(linkText: 'Review Metrics')
    # Verify the review page loaded
    wait(test).for(css: '.task-teacher-review .task-breadcrumbs')

module.exports = {verify, createNew, goOpen, goPerformanceForecast, Popup}

# Make sure the current screen is the calendar
verify = (test, ms) ->
  # wait until the calendar is open
  test.utils.wait.for(css: '.calendar-container:not(.calendar-loading)', ms)


# type: 'READING', 'HOMEWORK', 'EXTERNAL'
