2019-11-02 21:32:58 +07:00
|
|
|
package suites
|
|
|
|
|
2019-11-25 03:27:59 +07:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2021-04-13 15:38:12 +07:00
|
|
|
"net/url"
|
2019-11-25 03:27:59 +07:00
|
|
|
"testing"
|
|
|
|
)
|
2019-11-02 21:32:58 +07:00
|
|
|
|
2019-11-25 03:27:59 +07:00
|
|
|
func (wds *WebDriverSession) doLogout(ctx context.Context, t *testing.T) {
|
2020-05-27 18:55:44 +07:00
|
|
|
wds.doVisit(t, fmt.Sprintf("%s%s", GetLoginBaseURL(), "/logout"))
|
2019-11-25 03:27:59 +07:00
|
|
|
wds.verifyIsFirstFactorPage(ctx, t)
|
2019-11-02 21:32:58 +07:00
|
|
|
}
|
2021-04-13 15:38:12 +07:00
|
|
|
|
|
|
|
func (wds *WebDriverSession) doLogoutWithRedirect(ctx context.Context, t *testing.T, targetURL string, firstFactor bool) {
|
|
|
|
wds.doVisit(t, fmt.Sprintf("%s%s%s", GetLoginBaseURL(), "/logout?rd=", url.QueryEscape(targetURL)))
|
|
|
|
|
|
|
|
if firstFactor {
|
|
|
|
wds.verifyIsFirstFactorPage(ctx, t)
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
wds.verifyURLIs(ctx, t, targetURL)
|
|
|
|
}
|