2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2019-11-24 20:27:59 +00:00
|
|
|
"testing"
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/tebeka/selenium"
|
|
|
|
)
|
|
|
|
|
2019-11-24 20:27:59 +00: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 14:32:58 +00:00
|
|
|
currentURL, err := driver.CurrentURL()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
return currentURL == url, nil
|
|
|
|
})
|
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
assert.NoError(t, err)
|
2019-11-02 14:32:58 +00:00
|
|
|
}
|