Add test infrastructure with in-memory CRUD data store, OIDC bypass, skip remote calls switch, and merchant name editing#510
Conversation
Co-authored-by: StuartFerguson <[email protected]>
Co-authored-by: StuartFerguson <[email protected]>
Co-authored-by: StuartFerguson <[email protected]>
Co-authored-by: StuartFerguson <[email protected]>
Co-authored-by: StuartFerguson <[email protected]>
|
@copilot can you add some kind of switch into the actual tests to skip remote calls other than UI based calls ? |
Co-authored-by: StuartFerguson <[email protected]>
Added skip remote calls switch via Usage: export SKIP_REMOTE_CALLS=true
export APP_TEST_MODE=true
dotnet testImplementation in commit f79db5a:
This enables UI-only testing without any backend Docker containers - only the Blazor UI container is needed. |
|
@copilot can you add a flag to the appsettings of the integration tests rather than an environment variable |
Co-authored-by: StuartFerguson <[email protected]>
Configuration moved to Usage: {
"TestSettings": {
"SkipRemoteCalls": true,
"EnableTestMode": true
}
}Implementation in commit c797975:
appsettings.json values take precedence over environment variables when both are set. |
…com/TransactionProcessing/EstateManagementUI into copilot/enhance-test-infrastructure
|
@copilot looking pretty good, can you tweak the update merchant screen so the merchant name can be updated please |
Co-authored-by: StuartFerguson <[email protected]>
Merchant name can now be updated on the edit screen. Changes in commit b000af5:
Before: After: The merchant name field is now fully editable and will be saved along with other merchant details when clicking the Save button on the Details tab. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Integration tests currently require full Docker orchestration including OIDC containers, making tests slow (~30-60s startup) and complex. This adds a test mode that bypasses OIDC and provides an editable in-memory data store while maintaining the mediator pattern. Additionally, adds a skip remote calls switch to enable UI-only testing without backend service dependencies, and enables merchant name editing on the update merchant screen.
Changes
Test Mode Infrastructure
Program.csIn-Memory Data Store
Test Mediator Service
IMediatorusing TestDataStoreSkip Remote Calls Switch
appsettings.json(primary) or environment variables (fallback) to enable UI-only testingTestSettings:SkipRemoteCallsandTestSettings:EnableTestModesettingsTest Helpers
UI Enhancements
Usage
Enable Test Mode
Enable test mode via config or environment:
{ "AppSettings": { "TestMode": true } }Manipulate test data during execution:
Skip Remote Calls
Option 1: appsettings.json (Recommended)
{ "TestSettings": { "SkipRemoteCalls": true, "EnableTestMode": true } }Option 2: Environment Variables (Backward Compatible)
When skip remote calls is enabled, test steps skip all backend API calls and only interact with the UI via Playwright. Configuration values in appsettings.json take precedence over environment variables.
Default Test Data
Initializes with:
11111111-1111-1111-1111-111111111111)Impact
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.