2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2019-11-24 20:27:59 +00:00
|
|
|
"testing"
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
func (wds *WebDriverSession) doVisit(t *testing.T, url string) {
|
|
|
|
err := wds.WebDriver.Get(url)
|
|
|
|
assert.NoError(t, err)
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|
|
|
|
|
2020-01-18 14:57:42 +00:00
|
|
|
func (wds *WebDriverSession) doVisitAndVerifyOneFactorStep(ctx context.Context, t *testing.T, url string) {
|
2019-11-24 20:27:59 +00:00
|
|
|
wds.doVisit(t, url)
|
2020-01-18 14:57:42 +00:00
|
|
|
wds.verifyIsFirstFactorPage(ctx, t)
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
func (wds *WebDriverSession) doVisitLoginPage(ctx context.Context, t *testing.T, targetURL string) {
|
2019-11-02 14:32:58 +00:00
|
|
|
suffix := ""
|
|
|
|
if targetURL != "" {
|
2019-11-24 20:27:59 +00:00
|
|
|
suffix = fmt.Sprintf("?rd=%s", targetURL)
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|
2020-05-05 19:35:32 +00:00
|
|
|
|
2020-05-27 11:55:44 +00:00
|
|
|
wds.doVisitAndVerifyOneFactorStep(ctx, t, fmt.Sprintf("%s/%s", GetLoginBaseURL(), suffix))
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|