mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
b27c1fbae9
Add a suite for testing the PathPrefix feature implemented earlier to serve authelia under a multi-purpose domain. Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
29 lines
667 B
Go
29 lines
667 B
Go
package suites
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func (wds *WebDriverSession) doVisit(t *testing.T, url string) {
|
|
err := wds.WebDriver.Get(url)
|
|
assert.NoError(t, err)
|
|
}
|
|
|
|
func (wds *WebDriverSession) doVisitAndVerifyOneFactorStep(ctx context.Context, t *testing.T, url string) {
|
|
wds.doVisit(t, url)
|
|
wds.verifyIsFirstFactorPage(ctx, t)
|
|
}
|
|
|
|
func (wds *WebDriverSession) doVisitLoginPage(ctx context.Context, t *testing.T, targetURL string) {
|
|
suffix := ""
|
|
if targetURL != "" {
|
|
suffix = fmt.Sprintf("?rd=%s", targetURL)
|
|
}
|
|
|
|
wds.doVisitAndVerifyOneFactorStep(ctx, t, fmt.Sprintf("%s/%s", GetLoginBaseURL(), suffix))
|
|
}
|