2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2021-04-13 08:38:12 +00:00
|
|
|
"net/url"
|
2019-11-24 20:27:59 +00:00
|
|
|
"testing"
|
|
|
|
)
|
2019-11-02 14:32:58 +00:00
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
func (wds *WebDriverSession) doLogout(ctx context.Context, t *testing.T) {
|
2020-05-27 11:55:44 +00:00
|
|
|
wds.doVisit(t, fmt.Sprintf("%s%s", GetLoginBaseURL(), "/logout"))
|
2019-11-24 20:27:59 +00:00
|
|
|
wds.verifyIsFirstFactorPage(ctx, t)
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|
2021-04-13 08:38:12 +00: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)
|
|
|
|
}
|