diff options
author | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 15:15:08 +0300 |
---|---|---|
committer | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 15:15:08 +0300 |
commit | c5d2f477dca56c74891f4f61c38237b6dd2130bf (patch) | |
tree | 7b12a5683ebdde9c61f5cf62eb77d3e669bbe3f6 /internal/handlers/handlers_test.go | |
parent | 67889ad474c30f52a83b17db5331e15addc628f9 (diff) |
fix: update test selectors and question text for reliability
Diffstat (limited to 'internal/handlers/handlers_test.go')
-rw-r--r-- | internal/handlers/handlers_test.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index a74be30..1ddaad3 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -42,12 +42,18 @@ func TestQuestionFlow(t *testing.T) { }) assert.NoError(err, "Page content did not load") - // Verify question text exists - questionText, err := page.Locator("[data-testid='question']").TextContent() + // Verify question text exists and contains expected content + questionLocator := page.Locator("[data-testid='question']") + visible, err := questionLocator.IsVisible() + if err != nil || !visible { + assert.FailNow("Question text not visible", err) + } + + questionText, err := questionLocator.TextContent() if err != nil { - assert.FailNow("Question text not found", err) + assert.FailNow("Failed to get question text", err) } - assert.Contains(questionText, "Zweifel", "Question text mismatch") + assert.Contains(questionText, "Zweifel", "Question text should contain 'Zweifel'") // Set reasonable timeout for light site page.SetDefaultTimeout(2000) |