authelia/internal/suites/verify_url_is.go

24 lines
430 B
Go
Raw Normal View History

package suites
import (
"context"
"testing"
2019-12-08 19:16:13 +07:00
"github.com/stretchr/testify/require"
"github.com/tebeka/selenium"
)
func (wds *WebDriverSession) verifyURLIs(ctx context.Context, t *testing.T, url string) {
err := wds.Wait(ctx, func(driver selenium.WebDriver) (bool, error) {
currentURL, err := driver.CurrentURL()
if err != nil {
return false, err
}
return currentURL == url, nil
})
2019-12-08 19:16:13 +07:00
require.NoError(t, err)
}