Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oppodelldog/chromedp-test
a small testrunner lib for chromedp
https://github.com/oppodelldog/chromedp-test
Last synced: 5 days ago
JSON representation
a small testrunner lib for chromedp
- Host: GitHub
- URL: https://github.com/oppodelldog/chromedp-test
- Owner: Oppodelldog
- License: mit
- Created: 2020-09-12T19:38:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-01T12:23:36.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T08:03:05.633Z (7 months ago)
- Language: Go
- Size: 67.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chromedp-test
a small testrunner lib for chromedpOrganize ChromeDP action as Functional Web-TestCases in TestSuites and run them.
## Sample
### Organize and run Tests in TestSuites
```go
func RunTests(url string) {
runner.Suites(url,
runner.TestSuites{
"1 Login Test": runner.TestSuite{
"01-Login": Case01Login,
},
},
runner.Options{
SortSuites: true,
SortTests: true,
},
)
}
```### Implement a test
```go
func Case01Login(ctx context.Context, url string) error {
return Run(ctx,
group.New("preparations",
NavigateToWebsite(url),
group.New("regular login",
Login(),
WaitVisible(idEntryList, ByTestId),
),
group.New("logout to get to back logout page",
Logout(),
),
),
group.New("login from logout page",
WaitVisible(idActionLogin, ByTestId),
Click(idActionLogin, ByTestId),
Login(),
),
group.New("expect to be logged in",
WaitVisible(idEntryList, ByTestId),
Logout(),
),
)
}
```### Scope
This library provides runner to organize and run the tests, grouping for better logging.
Writing ChromeDp Actions like *NavigateToWebsite* or *Login* is of course up to you.