mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
28 lines
586 B
Go
28 lines
586 B
Go
|
package suites
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
"net/url"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func doVisit(s *SeleniumSuite, url string) {
|
||
|
err := s.WebDriver().Get(url)
|
||
|
assert.NoError(s.T(), err)
|
||
|
}
|
||
|
|
||
|
func doVisitAndVerifyURLIs(ctx context.Context, s *SeleniumSuite, url string) {
|
||
|
doVisit(s, url)
|
||
|
verifyURLIs(ctx, s, url)
|
||
|
}
|
||
|
|
||
|
func doVisitLoginPage(ctx context.Context, s *SeleniumSuite, targetURL string) {
|
||
|
suffix := ""
|
||
|
if targetURL != "" {
|
||
|
suffix = fmt.Sprintf("?rd=%s", url.QueryEscape(targetURL))
|
||
|
}
|
||
|
doVisitAndVerifyURLIs(ctx, s, fmt.Sprintf("%s%s", LoginBaseURL, suffix))
|
||
|
}
|