Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atotto/webtester
chrome web test support library
https://github.com/atotto/webtester
chrome chromedriver golang-library testing
Last synced: 24 days 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 (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-02-20T14:53:56.000Z (9 months ago)
- Last Synced: 2024-06-20T03:48:24.634Z (5 months ago)
- Topics: chrome, chromedriver, golang-library, testing
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CircleCI](https://circleci.com/gh/atotto/webtester.svg?style=svg)](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")
}
```