2019-11-02 21:32:58 +07:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2019-11-25 03:27:59 +07:00
|
|
|
"testing"
|
2019-11-02 21:32:58 +07:00
|
|
|
|
2019-12-08 19:16:13 +07:00
|
|
|
"github.com/stretchr/testify/require"
|
2019-11-02 21:32:58 +07:00
|
|
|
"github.com/tebeka/selenium"
|
|
|
|
)
|
|
|
|
|
2019-11-25 03:27:59 +07:00
|
|
|
func (wds *WebDriverSession) verifyURLIs(ctx context.Context, t *testing.T, url string) {
|
|
|
|
err := wds.Wait(ctx, func(driver selenium.WebDriver) (bool, error) {
|
2019-11-02 21:32:58 +07:00
|
|
|
currentURL, err := driver.CurrentURL()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
2021-04-13 15:38:12 +07:00
|
|
|
|
2019-11-02 21:32:58 +07:00
|
|
|
return currentURL == url, nil
|
|
|
|
})
|
|
|
|
|
2019-12-08 19:16:13 +07:00
|
|
|
require.NoError(t, err)
|
2019-11-02 21:32:58 +07:00
|
|
|
}
|