summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/handlers/handlers_test.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go
index 3258cd8..eef9f85 100644
--- a/internal/handlers/handlers_test.go
+++ b/internal/handlers/handlers_test.go
@@ -29,8 +29,8 @@ func TestQuestionFlow(t *testing.T) {
// Test 1: Load page and verify question
_, err = page.Goto(serverURL, playwright.PageGotoOptions{
- WaitUntil: playwright.WaitUntilStateNetworkidle,
- Timeout: playwright.Float(3000),
+ WaitUntil: playwright.WaitUntilStateDomcontentloaded,
+ Timeout: playwright.Float(2000),
})
assert.NoError(err, "Failed to load page")
@@ -45,15 +45,17 @@ func TestQuestionFlow(t *testing.T) {
assert.NoError(err, "Failed to get question text")
assert.Contains(questionText, "Zweifel", "Question text mismatch")
- // Set longer timeout for CI environments
- page.SetDefaultTimeout(10000)
+ // Set reasonable timeout for light site
+ page.SetDefaultTimeout(2000)
// Verify options using test IDs
for i := 1; i <= 4; i++ {
testID := fmt.Sprintf("option%d", i)
locator := page.Locator(fmt.Sprintf("[data-testid='%s']", testID))
visible, err := locator.IsVisible()
- assert.NoError(err, "Failed to check visibility for option %d", i)
+ if err != nil {
+ assert.FailNowf("Option check failed", "Option %d: %v", i, err)
+ }
assert.True(visible, "Option %d not visible", i)
}