Documentation
¶
Overview ¶
Package browsertest provides Playwright helpers for end-to-end browser tests against a gin-kit application. Tests skip cleanly when the Playwright driver or browsers are not installed, so `go test ./...` stays green on machines and CI runners without them.
One-time local setup:
go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps chromium
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
func Install() error
Install downloads the Playwright driver and Chromium. Intended for one-time local setup or provisioning scripts.
func StartServer ¶
func StartServer(t *testing.T, application *runtime.Application) string
StartServer serves the application's router on 127.0.0.1 with a random port and returns the base URL (e.g. http://127.0.0.1:41234). It uses a plain HTTP server — not Application.Run — so there is no signal handling or fixed address; shutdown and application cleanup happen via t.Cleanup.
Types ¶
type Browser ¶
type Browser struct {
// PW store data used by this type.
PW *playwright.Playwright
// Chromium store data used by this type.
Chromium playwright.Browser
}
Browser bundles a running Playwright driver and a Chromium instance.