2019-11-02 21:32:58 +07:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2019-11-25 03:27:59 +07:00
|
|
|
"testing"
|
2019-11-02 21:32:58 +07:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2019-11-25 03:27:59 +07:00
|
|
|
func (wds *WebDriverSession) doVisit(t *testing.T, url string) {
|
|
|
|
err := wds.WebDriver.Get(url)
|
|
|
|
assert.NoError(t, err)
|
2019-11-02 21:32:58 +07:00
|
|
|
}
|
|
|
|
|
2019-11-25 03:27:59 +07: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 21:32:58 +07:00
|
|
|
}
|
|
|
|
|
2019-11-25 03:27:59 +07:00
|
|
|
func (wds *WebDriverSession) doVisitLoginPage(ctx context.Context, t *testing.T, targetURL string) {
|
2019-11-02 21:32:58 +07:00
|
|
|
suffix := ""
|
|
|
|
if targetURL != "" {
|
2019-11-25 03:27:59 +07:00
|
|
|
suffix = fmt.Sprintf("?rd=%s", targetURL)
|
2019-11-02 21:32:58 +07:00
|
|
|
}
|
2019-11-25 03:27:59 +07:00
|
|
|
wds.doVisitAndVerifyURLIs(ctx, t, fmt.Sprintf("%s/%s", LoginBaseURL, suffix))
|
2019-11-02 21:32:58 +07:00
|
|
|
}
|