helper

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package helper allows to run playwright WebUI tests with Aquarium Fish

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckElementExists

func CheckElementExists(t *testing.T, page pw.Page, selector string) bool

CheckElementExists checks if an element exists without failing the test

func CloseAllNotifications

func CloseAllNotifications(t *testing.T, page pw.Page)

CloseAllNotifications checks here is no error notifications and closes to clear the view

func CreateApplication

func CreateApplication(t *testing.T, page pw.Page, labelUID string, metadata map[string]string)

CreateApplication creates a new application

func CreateLabel

func CreateLabel(t *testing.T, page pw.Page, labelName string) string

CreateLabel creates a label with the given name and UID Returns: LabelUID

func CreateUser

func CreateUser(t *testing.T, page pw.Page, username, password string, roles []string)

CreateUser creates a new user with the given parameters

func DeallocateApplication

func DeallocateApplication(t *testing.T, page pw.Page, labelName string)

DeallocateApplication deallocates an application by its label UID

func LoginUser

func LoginUser(t *testing.T, page pw.Page, username, password string)

LoginUser is a helper function to login with given credentials

func LogoutUser

func LogoutUser(t *testing.T, page pw.Page)

LogoutUser attempts to logout the current user

func NavigateToPage(t *testing.T, page pw.Page, pageName string)

NavigateToPage navigates to a specific page in the dashboard

func TakeScreenshot

func TakeScreenshot(t *testing.T, page pw.Page, afp *AFPlaywright, filename string)

TakeScreenshot takes a screenshot with the given filename

func VerifyApplicationInList

func VerifyApplicationInList(t *testing.T, page pw.Page, labelName, owner, status string)

VerifyApplicationInList verifies that an application appears in the list with correct details

func WaitForElement

func WaitForElement(t *testing.T, page pw.Page, selector string, timeout time.Duration)

WaitForElement waits for an element to be present on the page

Types

type AFPlaywright

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

AFPlaywright saves state of the running Aquarium Fish for particular test

func NewPlaywright

func NewPlaywright(tb testing.TB, workspace string, options playwright.BrowserNewContextOptions) (*AFPlaywright, playwright.Page)

NewPlaywright initializes Playwright context helper

func (*AFPlaywright) CaptureDir

func (afp *AFPlaywright) CaptureDir(subpath ...string) string

CaptureDir returns dir where to store all the test data

func (*AFPlaywright) Cleanup

func (afp *AFPlaywright) Cleanup(tb testing.TB)

Cleanup after the test execution

func (*AFPlaywright) Run

func (afp *AFPlaywright) Run(t *testing.T, name string, fn func(t *testing.T))

func (*AFPlaywright) Screenshot

func (afp *AFPlaywright) Screenshot(t *testing.T, phase string)

Screenshot takes a screenshot with automatic naming

Jump to

Keyboard shortcuts

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