2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
2023-01-25 09:36:40 +00:00
|
|
|
"regexp"
|
2019-11-24 20:27:59 +00:00
|
|
|
"testing"
|
2019-11-02 14:32:58 +00:00
|
|
|
|
2021-11-05 13:14:42 +00:00
|
|
|
"github.com/go-rod/rod"
|
2019-12-08 12:16:13 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
2019-11-02 14:32:58 +00:00
|
|
|
)
|
|
|
|
|
2021-11-05 13:14:42 +00:00
|
|
|
func (rs *RodSession) verifyURLIs(t *testing.T, page *rod.Page, url string) {
|
|
|
|
currentURL := page.MustInfo().URL
|
|
|
|
require.Equal(t, url, currentURL, "they should be equal")
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|
2023-01-25 09:36:40 +00:00
|
|
|
|
|
|
|
func (rs *RodSession) verifyURLIsRegexp(t *testing.T, page *rod.Page, rx *regexp.Regexp) {
|
|
|
|
currentURL := page.MustInfo().URL
|
|
|
|
|
|
|
|
require.Regexp(t, rx, currentURL, "url should match the expression")
|
|
|
|
}
|