From 5036ee8f41a8a105a9e30315614fc3490a2e1a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Kie=C3=9Fling?= Date: Mon, 16 Feb 2026 21:44:38 +0100 Subject: [PATCH 1/9] =?UTF-8?q?e2e:=20full=20flow=20with=20simulated=20ext?= =?UTF-8?q?ernals=20(sign=20in=20=E2=86=92=20create=20project=20=E2=86=92?= =?UTF-8?q?=20editor)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add test doubles for APP_ENV=test: SimulatedRemoteManifestValidator, SimulatedS3AssetUploader, SimulatedGitAdapter (clone from fixture, no-op push), SimulatedGitHubAdapter (fake PR URL), E2eNoOpProjectSetupStepsProvider - Wire doubles in config/services.yaml when@test; e2e fixture path parameter - E2E fixture: tests/fixtures/e2e-workspace-template (minimal package.json + index.html) - Set APP_ENV=test for messenger in docker-compose.e2e.yml so async setup uses doubles - Add data-test-id / data-test-class to project list, project form, editor, workspace setup - New e2e spec: full-flow.spec.ts (sign in, create project, open editor, send message) - No external calls in e2e: LLM, manifest URL, S3, git clone, GitHub API all simulated --- config/services.yaml | 25 ++++ docker-compose.e2e.yml | 6 +- .../templates/chat_based_content_editor.twig | 3 + .../Resources/templates/workspace_setup.twig | 2 +- .../Resources/templates/project_form.twig | 6 + .../Resources/templates/project_list.twig | 5 +- .../SimulatedRemoteManifestValidator.php | 26 ++++ .../TestHarness/SimulatedS3AssetUploader.php | 42 ++++++ .../E2eNoOpProjectSetupStepsProvider.php | 32 +++++ .../TestHarness/SimulatedGitAdapter.php | 126 ++++++++++++++++++ .../TestHarness/SimulatedGitHubAdapter.php | 35 +++++ tests/End2End/tests/full-flow.spec.ts | 69 ++++++++++ .../e2e-workspace-template/index.html | 10 ++ .../e2e-workspace-template/package.json | 8 ++ 14 files changed, 392 insertions(+), 3 deletions(-) create mode 100644 src/RemoteContentAssets/TestHarness/SimulatedRemoteManifestValidator.php create mode 100644 src/RemoteContentAssets/TestHarness/SimulatedS3AssetUploader.php create mode 100644 src/WorkspaceMgmt/TestHarness/E2eNoOpProjectSetupStepsProvider.php create mode 100644 src/WorkspaceMgmt/TestHarness/SimulatedGitAdapter.php create mode 100644 src/WorkspaceMgmt/TestHarness/SimulatedGitHubAdapter.php create mode 100644 tests/End2End/tests/full-flow.spec.ts create mode 100644 tests/fixtures/e2e-workspace-template/index.html create mode 100644 tests/fixtures/e2e-workspace-template/package.json diff --git a/config/services.yaml b/config/services.yaml index d060cc6f..7bbc374c 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -25,6 +25,9 @@ parameters: photo_builder.openai_timeout_seconds: 120 llm_content_editor.simulate: "%env(bool:LLM_CONTENT_EDITOR_SIMULATE)%" + # E2E workspace fixture (used by SimulatedGitAdapter when APP_ENV=test) + e2e.workspace_fixture_path: "%kernel.project_dir%/tests/fixtures/e2e-workspace-template" + services: # default configuration for services in *this* file _defaults: @@ -210,3 +213,25 @@ services: App\LlmContentEditor\Facade\LlmContentEditorFacadeInterface: alias: App\LlmContentEditor\Facade\SwitchableLlmContentEditorFacade + +when@test: + services: + # E2E/test doubles: no external HTTP or git/GitHub calls + App\RemoteContentAssets\Infrastructure\RemoteManifestValidatorInterface: + class: App\RemoteContentAssets\TestHarness\SimulatedRemoteManifestValidator + + App\RemoteContentAssets\Infrastructure\S3AssetUploaderInterface: + class: App\RemoteContentAssets\TestHarness\SimulatedS3AssetUploader + + App\WorkspaceMgmt\Infrastructure\Adapter\GitAdapterInterface: + class: App\WorkspaceMgmt\TestHarness\SimulatedGitAdapter + arguments: + $workspaceFixturePath: "%e2e.workspace_fixture_path%" + $realGitAdapter: "@App\\WorkspaceMgmt\\Infrastructure\\Adapter\\GitCliAdapter" + + App\WorkspaceMgmt\Infrastructure\Adapter\GitHubAdapterInterface: + class: App\WorkspaceMgmt\TestHarness\SimulatedGitHubAdapter + + # E2E: no-op setup steps (priority so it is used instead of DefaultProjectSetupStepsProvider) + App\WorkspaceMgmt\TestHarness\E2eNoOpProjectSetupStepsProvider: + tags: [{ name: workspace_mgmt.setup_steps_provider, priority: 100 }] diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index e7f3d2b0..293ffe45 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -1,10 +1,14 @@ -# E2E override: run app in test env, nginx with test env and fixed port for Playwright. +# E2E override: run app and messenger in test env, nginx with test env and fixed port for Playwright. # Use: docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d services: app: environment: APP_ENV: test + messenger: + environment: + APP_ENV: test + nginx: ports: - "127.0.0.1:8080:80" diff --git a/src/ChatBasedContentEditor/Presentation/Resources/templates/chat_based_content_editor.twig b/src/ChatBasedContentEditor/Presentation/Resources/templates/chat_based_content_editor.twig index daaba15b..dc4af916 100644 --- a/src/ChatBasedContentEditor/Presentation/Resources/templates/chat_based_content_editor.twig +++ b/src/ChatBasedContentEditor/Presentation/Resources/templates/chat_based_content_editor.twig @@ -12,6 +12,7 @@ {% endif %}
{{ 'editor.input_label'|trans }}