Documentation
¶
Index ¶
- type TestSession
- func (s *TestSession) AssertDisabled(q queries.Query)
- func (s *TestSession) AssertHidden(q queries.Query)
- func (s *TestSession) AssertText(text string)
- func (s *TestSession) AssertURLContains(part string)
- func (s *TestSession) AssertVisible(q queries.Query)
- func (s *TestSession) Click(q queries.Query)
- func (s *TestSession) ClickWithControlOrMeta(q queries.Query)
- func (s *TestSession) Close()
- func (s *TestSession) DragAndDrop(source queries.Query, target queries.Query, offsetX, offsetY int)
- func (s *TestSession) FillIn(q queries.Query, value string)
- func (s *TestSession) HoverOver(q queries.Query)
- func (s *TestSession) Login()
- func (s *TestSession) Page() pw.Page
- func (s *TestSession) PressKey(key string)
- func (s *TestSession) ScrollToTheBottomOfPage()
- func (s *TestSession) Sleep(ms int)
- func (s *TestSession) Start()
- func (s *TestSession) StartWithoutUser()
- func (s *TestSession) TakeScreenshot()
- func (s *TestSession) Visit(path string)
- func (s *TestSession) VisitHomePage()
- func (s *TestSession) WaitForBrowserPath(expectedPath string)
- func (s *TestSession) WaitUntilURLContains(part string)
- func (s *TestSession) WaitUntilURLDoesNotContain(part string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestSession ¶
type TestSession struct {
BaseURL string
OrgID uuid.UUID
OrgSlug string
Account *models.Account
// contains filtered or unexported fields
}
TestSession handles per-test actions: db, auth, and page ops.
func NewTestSession ¶
func NewTestSession(t *testing.T, context pw.BrowserContext, page pw.Page, timeoutMs float64, baseURL string) *TestSession
func (*TestSession) AssertDisabled ¶
func (s *TestSession) AssertDisabled(q queries.Query)
func (*TestSession) AssertHidden ¶ added in v0.1.4
func (s *TestSession) AssertHidden(q queries.Query)
func (*TestSession) AssertText ¶
func (s *TestSession) AssertText(text string)
func (*TestSession) AssertURLContains ¶
func (s *TestSession) AssertURLContains(part string)
func (*TestSession) AssertVisible ¶
func (s *TestSession) AssertVisible(q queries.Query)
func (*TestSession) Click ¶
func (s *TestSession) Click(q queries.Query)
func (*TestSession) ClickWithControlOrMeta ¶ added in v0.14.0
func (s *TestSession) ClickWithControlOrMeta(q queries.Query)
ClickWithControlOrMeta clicks with the multi-selection modifier (Control on Windows/Linux, Meta on macOS).
func (*TestSession) Close ¶
func (s *TestSession) Close()
func (*TestSession) DragAndDrop ¶
func (*TestSession) HoverOver ¶
func (s *TestSession) HoverOver(q queries.Query)
func (*TestSession) Login ¶
func (s *TestSession) Login()
func (*TestSession) Page ¶
func (s *TestSession) Page() pw.Page
Page exposes the underlying playwright Page to satisfy queries.Runner.
func (*TestSession) PressKey ¶ added in v0.14.0
func (s *TestSession) PressKey(key string)
func (*TestSession) ScrollToTheBottomOfPage ¶
func (s *TestSession) ScrollToTheBottomOfPage()
func (*TestSession) Sleep ¶
func (s *TestSession) Sleep(ms int)
func (*TestSession) Start ¶
func (s *TestSession) Start()
func (*TestSession) StartWithoutUser ¶
func (s *TestSession) StartWithoutUser()
StartWithoutUser resets the database but does not seed any user or organization records. This is useful for flows that expect an empty instance, such as the first-run owner setup.
func (*TestSession) TakeScreenshot ¶
func (s *TestSession) TakeScreenshot()
func (*TestSession) Visit ¶
func (s *TestSession) Visit(path string)
func (*TestSession) VisitHomePage ¶
func (s *TestSession) VisitHomePage()
func (*TestSession) WaitForBrowserPath ¶ added in v0.17.0
func (s *TestSession) WaitForBrowserPath(expectedPath string)
WaitForBrowserPath polls until the URL path (ignoring query and fragment) equals expectedPath after normalizing trailing slashes. expectedPath is typically an app pathname such as "/<orgID>/apps/<appID>" (not including the origin or query string).
func (*TestSession) WaitUntilURLContains ¶
func (s *TestSession) WaitUntilURLContains(part string)
WaitUntilURLContains polls until the current URL contains part. Use this for redirects that a single-page app resolves after several async requests (for example, the post-login redirect into an organization), where a fixed sleep is not enough.
func (*TestSession) WaitUntilURLDoesNotContain ¶
func (s *TestSession) WaitUntilURLDoesNotContain(part string)