Merge remote-tracking branch 'forgejo/forgejo-dependency' into wip-forgejo

This commit is contained in:
Earl Warren 2023-09-04 13:11:44 +02:00
commit 9283604810
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
48 changed files with 504 additions and 40 deletions

View file

@ -547,3 +547,18 @@ func GetCSRF(t testing.TB, session *TestSession, urlStr string) string {
doc := NewHTMLParser(t, resp.Body)
return doc.GetCSRF()
}
func GetHTMLTitle(t testing.TB, session *TestSession, urlStr string) string {
t.Helper()
req := NewRequest(t, "GET", urlStr)
var resp *httptest.ResponseRecorder
if session == nil {
resp = MakeRequest(t, req, http.StatusOK)
} else {
resp = session.MakeRequest(t, req, http.StatusOK)
}
doc := NewHTMLParser(t, resp.Body)
return doc.Find("head title").Text()
}