helpers

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHelper

type AuthHelper struct {
	// contains filtered or unexported fields
}

AuthHelper provides authentication utilities for tests

func NewAuthHelper

func NewAuthHelper(browser *BrowserHelper) *AuthHelper

NewAuthHelper creates a new authentication helper

func (*AuthHelper) IsLoggedIn

func (a *AuthHelper) IsLoggedIn() bool

IsLoggedIn checks if the user is currently logged in

func (*AuthHelper) Login

func (a *AuthHelper) Login(email, password string) error

Login performs login with the given credentials

func (*AuthHelper) LoginAsAdmin

func (a *AuthHelper) LoginAsAdmin() error

LoginAsAdmin logs in with admin credentials from config

func (*AuthHelper) Logout

func (a *AuthHelper) Logout() error

Logout performs logout

type BrowserHelper

type BrowserHelper struct {
	Playwright *playwright.Playwright
	Browser    playwright.Browser
	Context    playwright.BrowserContext
	Page       playwright.Page
	Config     *config.TestConfig
	// contains filtered or unexported fields
}

BrowserHelper provides browser setup and teardown for tests

func NewBrowserHelper

func NewBrowserHelper(t *testing.T) *BrowserHelper

NewBrowserHelper creates a new browser helper instance

func (*BrowserHelper) NavigateTo

func (b *BrowserHelper) NavigateTo(path string) error

NavigateTo navigates to a path relative to the base URL

func (*BrowserHelper) Setup

func (b *BrowserHelper) Setup() error

Setup initializes the browser and creates a new page

func (*BrowserHelper) TearDown

func (b *BrowserHelper) TearDown()

TearDown closes the browser and cleans up resources

func (*BrowserHelper) WaitForHTMX

func (b *BrowserHelper) WaitForHTMX() error

WaitForHTMX waits for HTMX requests to complete

func (*BrowserHelper) WaitForLoad

func (b *BrowserHelper) WaitForLoad() error

WaitForLoad waits for the main page load event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL