aprs.me/test/integration/map_integration_test.exs
Graham McIntire 79be23813e
Improve CI/CD stability for frontend integration tests
Address browser testing reliability in CI environments:

## CI/CD Improvements
- **ChromeDriver**: Use latest stable version instead of pinned version for better compatibility
- **Timeouts**: Add 10-minute timeout for integration tests to prevent CI hangs
- **Environment Variables**: Configure WALLABY_MAX_WAIT_TIME for CI-specific timeouts

## Wallaby Configuration Enhancements
- **Chrome Args**: Add CI-stable Chrome options (--no-sandbox, --disable-dev-shm-usage)
- **Window Size**: Set consistent 1280x720 window size for reproducible tests
- **Dynamic Timeouts**: Environment-configurable max wait time with sensible defaults
- **Pool Size**: Limit to single browser instance to prevent resource conflicts

## Benefits
-  More reliable test execution in CI environments
-  Better error handling and timeout management
-  Consistent browser behavior across environments
-  Reduced flakiness from resource constraints

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:26:35 -05:00

42 lines
991 B
Elixir

defmodule AprsmeWeb.MapIntegrationTest do
@moduledoc """
Integration tests for the main map interface using Wallaby
Tests the complete user experience including JavaScript interactions
"""
use ExUnit.Case, async: false
use Wallaby.Feature
import Wallaby.Browser
alias Aprsme.Repo
alias Ecto.Adapters.SQL.Sandbox
alias Wallaby.Query
@moduletag :integration
setup do
:ok = Sandbox.checkout(Repo)
Sandbox.mode(Repo, {:shared, self()})
{:ok, %{}}
end
feature "user can view the main map interface", %{session: session} do
session
|> visit("/")
|> assert_has(Query.text("APRS"))
|> assert_has(Query.css("main"))
end
feature "page loads successfully", %{session: session} do
session
|> visit("/")
|> assert_has(Query.css("body"))
|> assert_has(Query.css("main"))
end
feature "can access different routes", %{session: session} do
session
|> visit("/info")
|> assert_has(Query.css("body"))
end
end