mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-10 18:50:57 +00:00
Merge remote-tracking branch 'forgejo/forgejo-dependency' into forgejo
This commit is contained in:
commit
188573d069
60 changed files with 780 additions and 43 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue