This commit implements browser-based integration testing for the Phoenix LiveView application using Wallaby and ChromeDriver to test the complete user experience including JavaScript interactions. ## Changes Made ### Testing Infrastructure - Add Wallaby dependency for browser automation testing - Configure Chrome driver with headless mode for CI/CD - Set up Phoenix server integration for test environment - Enable screenshot capture on test failures ### Integration Tests - `test/integration/simple_integration_test.exs` - Basic homepage functionality - `test/integration/map_integration_test.exs` - Map interface and routing tests - Tests validate page loading, content rendering, and navigation ### CI/CD Integration - Update GitHub Actions workflow to install ChromeDriver - Add separate integration test step in CI pipeline - Configure headless Chrome for automated testing ### Configuration Updates - Enable Phoenix server in test environment for Wallaby - Configure Wallaby with proper base URL and screenshot settings - Initialize Wallaby application in test helper ## Features Tested - ✅ Homepage loads with APRS content - ✅ Main page structure renders correctly - ✅ Route navigation functions properly - ✅ Basic Phoenix LiveView functionality ## Next Steps This provides a solid foundation for expanding to test: - Interactive map controls and JavaScript functionality - Real-time packet updates via LiveView PubSub - User authentication flows and form submissions - Mobile responsive behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
1.2 KiB
Elixir
25 lines
1.2 KiB
Elixir
ExUnit.start(max_cases: System.schedulers_online() * 2)
|
|
Ecto.Adapters.SQL.Sandbox.mode(Aprsme.Repo, :manual)
|
|
|
|
# Configure Mox
|
|
Mox.defmock(Aprsme.PacketsMock, for: Aprsme.PacketsBehaviour)
|
|
Mox.defmock(Aprsme.PacketReplayMock, for: Aprsme.PacketReplayBehaviour)
|
|
Mox.defmock(PacketsMock, for: Aprsme.PacketsBehaviour)
|
|
|
|
# Set up default stubs for commonly used functions
|
|
Mox.stub(Aprsme.PacketsMock, :get_recent_packets_optimized, fn _opts -> [] end)
|
|
Mox.stub(Aprsme.PacketsMock, :get_nearby_stations, fn _lat, _lon, _exclude, _opts -> [] end)
|
|
|
|
# Ensure no external APRS connections during tests
|
|
Application.put_env(:aprsme, :disable_aprs_connection, true)
|
|
Application.put_env(:aprsme, :aprs_is_server, "mock.aprs.test")
|
|
Application.put_env(:aprsme, :aprsme_is_port, 14_580)
|
|
Application.put_env(:aprsme, :aprsme_is_login_id, "TEST")
|
|
Application.put_env(:aprsme, :aprsme_is_password, "-1")
|
|
Application.put_env(:aprsme, :aprsme_is_default_filter, "r/0/0/1")
|
|
Application.put_env(:aprsme, :packets_module, Aprsme.PacketsMock)
|
|
|
|
# AprsIsMock is automatically loaded from test/support via elixirc_paths
|
|
|
|
# Configure Wallaby for integration tests
|
|
{:ok, _} = Application.ensure_all_started(:wallaby)
|