diff options
author | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 14:41:35 +0300 |
---|---|---|
committer | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 14:41:35 +0300 |
commit | ad4324a692f623314d6b1ff81983a8d9dc6f9fa2 (patch) | |
tree | 9043c6ea46e98a1c61e9d2da78fb5ee686737682 /internal/handlers/handlers_test.go | |
parent | be4b305e4ee83fba5638e4a24fdc6de9808eb4e9 (diff) |
fix: update test selectors and template error handling
Diffstat (limited to 'internal/handlers/handlers_test.go')
-rw-r--r-- | internal/handlers/handlers_test.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index d177239..a74be30 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -35,15 +35,18 @@ func TestQuestionFlow(t *testing.T) { }) assert.NoError(err, "Failed to load page") - // Wait for question to appear - err = page.Locator(".question-text").WaitFor(playwright.LocatorWaitForOptions{ + // Wait for main content to load + err = page.Locator("body").WaitFor(playwright.LocatorWaitForOptions{ State: playwright.WaitForSelectorStateVisible, - Timeout: playwright.Float(1000), + Timeout: playwright.Float(2000), }) - assert.NoError(err, "Question text did not appear") + assert.NoError(err, "Page content did not load") - questionText, err := page.Locator(".question-text").TextContent() - assert.NoError(err, "Failed to get question text") + // Verify question text exists + questionText, err := page.Locator("[data-testid='question']").TextContent() + if err != nil { + assert.FailNow("Question text not found", err) + } assert.Contains(questionText, "Zweifel", "Question text mismatch") // Set reasonable timeout for light site |