Documentation ¶
Overview ¶
Package dsl uses Ginkgo to implement a Capybara-like DSL for writing acceptance tests. This package is provided entirely for convenience. This DSL is not required to write Ginkgo acceptance tests. Unlike the base agouti package, the dsl package only permits a single running WebDriver.
Index ¶
- func Back(page ActionPage)
- func Background(body interface{}, timeout ...float64) bool
- func CancelPopup(page ActionPage)
- func Check(selection ActionSelection)
- func ClearCookies(page ActionPage)
- func Click(selection ActionSelection)
- func CloseWindow(page ActionPage)
- func ConfirmPopup(page ActionPage)
- func CreatePage(browserName ...string) *agouti.Page
- func CustomPage(capabilities agouti.Capabilities) *agouti.Page
- func DeleteCookie(page ActionPage, name string)
- func Destroy(page ActionPage)
- func DoubleClick(selection ActionSelection)
- func EnterPopupText(page ActionPage, text string)
- func FFeature(text string, body func()) bool
- func FScenario(description string, body func(), timeout ...float64) bool
- func Feature(text string, body func()) bool
- func Fill(selection ActionSelection, text string)
- func Forward(page ActionPage)
- func Navigate(page ActionPage, url string)
- func NextWindow(page ActionPage)
- func PFeature(text string, body func()) bool
- func PScenario(description string, ignored ...interface{}) bool
- func Refresh(page ActionPage)
- func RegisterAgoutiFailHandler(handler func(message string, callerSkip ...int))
- func RunScript(page ActionPage, body string, arguments map[string]interface{}, ...)
- func Scenario(description string, body func(), timeout ...float64) bool
- func Screenshot(page ActionPage, filename string)
- func Select(selection ActionSelection, text string)
- func SetCookie(page ActionPage, cookie agouti.Cookie)
- func Size(page ActionPage, width, height int)
- func StartChrome()
- func StartChromeDriver()
- func StartPhantomJS()
- func StartSelenium()
- func Step(text string, callbacks ...func())
- func StopWebDriver()
- func StopWebdriver()
- func Submit(selection ActionSelection)
- func SwitchToFrame(selection ActionSelection)
- func SwitchToParentFrame(page ActionPage)
- func SwitchToRootFrame(page ActionPage)
- func SwitchToWindow(page ActionPage, name string)
- func Uncheck(selection ActionSelection)
- func XFeature(text string, body func()) bool
- func XScenario(description string, ignored ...interface{}) bool
- type ActionPage
- type ActionSelection
- type AgoutiFailHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Background ¶
Background is equivalent to Ginkgo BeforeEach.
func CancelPopup ¶
func CancelPopup(page ActionPage)
CancelPopup is comparable to Expect(page.CancelPopup()).To(Succeed())
func Check ¶
func Check(selection ActionSelection)
Check is comparable to Expect(selection.Check()).To(Succeed())
func ClearCookies ¶
func ClearCookies(page ActionPage)
ClearCookies is comparable to Expect(page.ClearCookies()).To(Succeed())
func Click ¶
func Click(selection ActionSelection)
Click is comparable to Expect(selection.Click()).To(Succeed())
func CloseWindow ¶
func CloseWindow(page ActionPage)
CloseWindow is comparable to Expect(page.CloseWindow()).To(Succeed())
func ConfirmPopup ¶
func ConfirmPopup(page ActionPage)
ConfirmPopup is comparable to Expect(page.ConfirmPopup()).To(Succeed())
func CreatePage ¶
CreatePage creates a new session using the current running WebDriver. For Selenium, the browserName determines which browser to use for the session.
func CustomPage ¶
func CustomPage(capabilities agouti.Capabilities) *agouti.Page
CustomPage creates a new session with a custom set of desired capabilities using the current running WebDriver. The agouti.Use() function may be used to generate this set of capabilities. For Selenium, the capabilities Browser(string) method sets which browser to use for the session.
func DeleteCookie ¶
func DeleteCookie(page ActionPage, name string)
DeleteCookie is comparable to Expect(page.DeleteCookie("cookie-name")).To(Succeed())
func Destroy ¶
func Destroy(page ActionPage)
Destroy is comparable to Expect(page.Destroy()).To(Succeed())
func DoubleClick ¶
func DoubleClick(selection ActionSelection)
DoubleClick is comparable to Expect(selection.DoubleClick()).To(Succeed())
func EnterPopupText ¶
func EnterPopupText(page ActionPage, text string)
EnterPopupText is comparable to Expect(page.EnterPopupText("some text")).To(Succeed())
func Fill ¶
func Fill(selection ActionSelection, text string)
Fill is comparable to Expect(selection.Fill(text)).To(Succeed())
func Forward ¶
func Forward(page ActionPage)
Forward is comparable to Expect(page.Forward()).To(Succeed())
func Navigate ¶
func Navigate(page ActionPage, url string)
Navigate is comparable to Expect(page.Navigate(url)).To(Succeed())
func NextWindow ¶
func NextWindow(page ActionPage)
NextWindow is comparable to Expect(page.NextWindow()).To(Succeed())
func Refresh ¶
func Refresh(page ActionPage)
Refresh is comparable to Expect(page.Refresh()).To(Succeed())
func RegisterAgoutiFailHandler ¶
RegisterAgoutiFailHandler connects the implied assertions is Agouti's dsl with Gingko. When set to ginkgo.Fail (the default), failures in Agouti's dsl-provided methods will cause test failures in Ginkgo.
func RunScript ¶
func RunScript(page ActionPage, body string, arguments map[string]interface{}, result interface{})
RunScript is comparable to Expect(page.RunScript(script, args, &result)).To(Succeed())
func Screenshot ¶
func Screenshot(page ActionPage, filename string)
Screenshot is comparable to Expect(page.Screenshot("screenshot-file.png")).To(Succeed())
func Select ¶
func Select(selection ActionSelection, text string)
Select is comparable to Expect(selection.Select(text)).To(Succeed())
func SetCookie ¶
func SetCookie(page ActionPage, cookie agouti.Cookie)
SetCookie is comparable to Expect(page.SetCookie(cookie)).To(Succeed())
func Size ¶
func Size(page ActionPage, width, height int)
Size is comparable to Expect(page.Size(windowWidth, windowHeight)).To(Succeed())
func StartChrome ¶
func StartChrome()
StartChrome starts a ChromeDriver WebDriver service for use with CreatePage.
DEPRECATED: Use StartChromeDriver instead.
func StartChromeDriver ¶
func StartChromeDriver()
StartChrome starts a ChromeDriver WebDriver service for use with CreatePage.
func StartPhantomJS ¶
func StartPhantomJS()
StartPhantomJS starts a PhantomJS WebDriver service for use with CreatePage.
func StartSelenium ¶
func StartSelenium()
StartSelenium starts a Selenium WebDriver service for use with CreatePage.
func StopWebdriver ¶
func StopWebdriver()
StopWebDriver stops the current running WebDriver.
DEPRECATED: Use StopWebDriver instead.
func Submit ¶
func Submit(selection ActionSelection)
Submit is comparable to Expect(selection.Submit()).To(Succeed())
func SwitchToFrame ¶
func SwitchToFrame(selection ActionSelection)
SwitchToFrame is comparable to Expect(selection.SwitchToFrame()).To(Succeed())
func SwitchToParentFrame ¶
func SwitchToParentFrame(page ActionPage)
SwitchToParentFrame is comparable to Expect(page.SwitchToParentFrame()).To(Succeed())
func SwitchToRootFrame ¶
func SwitchToRootFrame(page ActionPage)
SwitchToRootFrame is comparable to Expect(page.SwitchToRootFrame()).To(Succeed())
func SwitchToWindow ¶
func SwitchToWindow(page ActionPage, name string)
SwitchToWindow is comparable to Expect(page.SwitchToWindow("window name")).To(Succeed())
func Uncheck ¶
func Uncheck(selection ActionSelection)
Uncheck is comparable to Expect(selection.Uncheck()).To(Succeed())
Types ¶
type ActionPage ¶
type ActionPage interface { Destroy() error SetCookie(cookie agouti.Cookie) error DeleteCookie(name string) error ClearCookies() error Size(width, height int) error Screenshot(filename string) error RunScript(body string, arguments map[string]interface{}, result interface{}) error EnterPopupText(text string) error ConfirmPopup() error CancelPopup() error Forward() error Back() error Refresh() error SwitchToParentFrame() error SwitchToRootFrame() error SwitchToWindow(name string) error NextWindow() error CloseWindow() error }