Documentation ¶
Overview ¶
Package browsersteps provides browser automation Cucumber Steps using https://github.com/cucumber/godog and https://github.com/tebeka/selenium.
Provided Steps ¶
The following steps are provided:
I am an anonymous user ¶
This step deletes all cookies from the browser
Index ¶
- Constants
- func RunWithTimeout(f func() error, timeout, pingDuration time.Duration) error
- type BrowserSteps
- func (b *BrowserSteps) AfterScenario(m *messages.Pickle, err error)
- func (b *BrowserSteps) BeforeScenario(a *messages.Pickle)
- func (b *BrowserSteps) GetCurrentWindowInnerSize() (*selenium.Size, error)
- func (b *BrowserSteps) GetCurrentWindowScroll() (*selenium.Point, error)
- func (b *BrowserSteps) GetCurrentWindowViewport() (image.Rectangle, error)
- func (b *BrowserSteps) GetElementRect(element selenium.WebElement) (image.Rectangle, error)
- func (b *BrowserSteps) GetURL(URL string) (*url.URL, error)
- func (b *BrowserSteps) GetWebDriver() selenium.WebDriver
- func (b *BrowserSteps) SetBaseURL(url *url.URL) error
Constants ¶
const ByOption = `(id|xpath|link text|partial link text|name|tag name|class name|css selector)`
ByOption is the regular expression for allowed selenium.By* in step definitions
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BrowserSteps ¶
type BrowserSteps struct { Capabilities selenium.Capabilities DefaultURL string URL *url.URL ScreenshotPath string Timeout time.Duration PingDuration time.Duration // contains filtered or unexported fields }
BrowserSteps represents a WebDriver context to run the Scenarios
func NewBrowserSteps ¶
func NewBrowserSteps(s *godog.Suite, cap selenium.Capabilities, defaultURL string) *BrowserSteps
NewBrowserSteps starts a new BrowserSteps instance.
func (*BrowserSteps) AfterScenario ¶
func (b *BrowserSteps) AfterScenario(m *messages.Pickle, err error)
AfterScenario is executed after each scenario
func (*BrowserSteps) BeforeScenario ¶
func (b *BrowserSteps) BeforeScenario(a *messages.Pickle)
BeforeScenario is executed before each scenario
func (*BrowserSteps) GetCurrentWindowInnerSize ¶
func (b *BrowserSteps) GetCurrentWindowInnerSize() (*selenium.Size, error)
GetCurrentWindowInnerSize returns window inner size
func (*BrowserSteps) GetCurrentWindowScroll ¶
func (b *BrowserSteps) GetCurrentWindowScroll() (*selenium.Point, error)
GetCurrentWindowScroll returns window scroll
func (*BrowserSteps) GetCurrentWindowViewport ¶
func (b *BrowserSteps) GetCurrentWindowViewport() (image.Rectangle, error)
GetCurrentWindowViewport returns window scroll
func (*BrowserSteps) GetElementRect ¶
func (b *BrowserSteps) GetElementRect(element selenium.WebElement) (image.Rectangle, error)
GetElementRect returns the element rectangle
func (*BrowserSteps) GetURL ¶
func (b *BrowserSteps) GetURL(URL string) (*url.URL, error)
GetURL returns a absolute url given a absolute or relative URL
func (*BrowserSteps) GetWebDriver ¶
func (b *BrowserSteps) GetWebDriver() selenium.WebDriver
GetWebDriver returns the webdriver
func (*BrowserSteps) SetBaseURL ¶
func (b *BrowserSteps) SetBaseURL(url *url.URL) error
SetBaseURL sets the absolute URL used to complete relative URLs