本文整理汇总了Golang中github.com/sclevine/agouti.Page.FirstByButton方法的典型用法代码示例。如果您正苦于以下问题:Golang Page.FirstByButton方法的具体用法?Golang Page.FirstByButton怎么用?Golang Page.FirstByButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/sclevine/agouti.Page
的用法示例。
在下文中一共展示了Page.FirstByButton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
})
AfterEach(func() {
Expect(page.Destroy()).To(Succeed())
})
It("should manage user authentication", func() {
By("redirecting the user to the login form from the webapp page", func() {
Expect(page.Navigate(AcceptanceSettings("webappUrl"))).To(Succeed())
})
By("allowing the user to fill out the login form and submit it", func() {
Eventually(page.FindByName("email")).Should(BeFound())
Expect(page.FindByName("email").Fill(AcceptanceSettings("email"))).To(Succeed())
Expect(page.FindByName("password").Fill(AcceptanceSettings("password"))).To(Succeed())
Expect(page.FirstByButton("Get Access").Submit()).To(Succeed())
})
By("allowing the user to view its data", func() {
Eventually(page.Find("#user-context")).Should(BeFound())
Expect(page.Find("#user-context").Click()).To(Succeed())
Expect(page.Find(".user-submenu")).To(BeVisible())
Expect(page.Find(".user-submenu .submenu-data p").Text()).To(Equal("Signed in as\nAcceptance Tests"))
})
By("allowing the user to logout", func() {
Eventually(page.Find("#user-context")).Should(BeFound())
Expect(page.Find("#user-context").Click()).To(Succeed())
Expect(page.Find(".user-submenu")).To(BeVisible())
Eventually(page.Find(".user-submenu ul.submenu a[href='/logout']")).Should(BeFound())
Expect(page.Find(".user-submenu ul.submenu a[href='/logout']").Click()).To(Succeed())