Categorygithub.com/atotto/webtester
repositorypackage
0.2.3
Repository: https://github.com/atotto/webtester.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

CircleCI

web test library for golang

example:

func TestSimple(tt *testing.T) {
	t := webtester.Setup(tt, chrome.DriverPath)
	defer t.TearDown()

	d := t.OpenBrowser()
	d.SetPageLoadTimeout(4 * time.Second)

	d.VisitTo("https://tour.golang.org/welcome/1")

	d.WaitFor("id:run")
	d.MustFindElement("id:run").Click()

	d.WaitFor("class:stdout")
	d.MustFindElement("class:stdout").VerifyText(strings.Contains, "Hello")

	d.MustFindElement("class:next-page").Click()
	d.ExpectTransitTo("/welcome/2").TakeScreenshot("page2.png")
}