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
|
|
|
}
|
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
func (wds *WebDriverSession) doVisitAndVerifyURLIs(ctx context.Context, t *testing.T, url string) {
|
|
|
|
wds.doVisit(t, url)
|
|
|
|
wds.verifyURLIs(ctx, t, url)
|
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
|
|
|
}
|
2019-11-24 20:27:59 +00:00
|
|
|
wds.doVisitAndVerifyURLIs(ctx, t, fmt.Sprintf("%s/%s", LoginBaseURL, suffix))
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|