summaryrefslogtreecommitdiff
path: root/internal/suites/verify_url_is.go
blob: 1b269a188ac40801cb2596457e85fa8a0cecac11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package suites

import (
	"regexp"
	"testing"

	"github.com/go-rod/rod"
	"github.com/stretchr/testify/require"
)

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")
}

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")
}