https://github.com/atotto/webtester
chrome web test support library
https://github.com/atotto/webtester
chrome chromedriver golang-library testing
Last synced: about 1 year ago
JSON representation
chrome web test support library
- Host: GitHub
- URL: https://github.com/atotto/webtester
- Owner: atotto
- License: mit
- Created: 2016-10-28T08:53:39.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-02-20T14:53:56.000Z (over 2 years ago)
- Last Synced: 2025-05-08T23:48:48.580Z (about 1 year ago)
- Topics: chrome, chromedriver, golang-library, testing
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/atotto/webtester)
# web test library for golang
example:
```example.go
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")
}
```