Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"os"
"path/filepath"
"strings"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -260,9 +261,12 @@ func loginUserWithPassword(t testing.TB, userName, password string) *TestSession

// token has to be unique this counter take care of
var tokenCounter int64
var tokenCounterMutex sync.Mutex

func getTokenForLoggedInUser(t testing.TB, session *TestSession) string {
t.Helper()
tokenCounterMutex.Lock()
defer tokenCounterMutex.Unlock()
tokenCounter++
req := NewRequest(t, "GET", "/user/settings/applications")
resp := session.MakeRequest(t, req, http.StatusOK)
Expand All @@ -276,6 +280,7 @@ func getTokenForLoggedInUser(t testing.TB, session *TestSession) string {
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
token := htmlDoc.doc.Find(".ui.info p").Text()
assert.NotEmpty(t, token)
return token
}

Expand Down