       .waitForElementVisible  'form.login-form', 20000
       .setValue               'input[name=username]', user.username
       .setValue               'input[name=password]', user.password
-      .click                  'button[testpath=login-button]'
-
-    @loginAssertion(browser)
-
-
-  loginTeam: (browser, invalidCredentials = no) ->
+      .click                  'button[testpath=login-button]', => @loginAssertion browser, callback
+
+
+
+  loginTeam: (browser, invalidCredentials = no, callback = -> ) ->
 
     user               = utils.getUser()
     url                = helpers.getUrl(yes)

      .click                 joinButton

    if assertLoggedIn
      @loginAssertion(browser)


  getInvitationUrl: (browser, email, callback) ->

    browser.execute fn, params


  fillJoinForm: (browser, userData, assertLoggedIn = yes, callback = -> ) ->

    loginForm     = '.TeamsModal.TeamsModal--groupCreation.join'
    emailInput    = "#{loginForm} input[name=email]"
