docs: XCUITest plan for ArgoTradingSwift document app#54
Conversation
Co-authored-by: sirily11 <32106111+sirily11@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive XCUITest documentation for the ArgoTradingSwift macOS document-based trading application. The test plan provides detailed guidance for implementing end-to-end UI tests covering five critical user workflows: dataset downloads, chart interaction with infinite scrolling, backtest execution, navigation between trade/signal data points and charts, and live trading sessions.
Changes:
- Added detailed XCUITest plan document covering 5 test suites with 36 total test cases
- Documented required accessibility identifiers for all testable UI components
- Provided infrastructure guidance for test isolation, async waiting, and CI integration
- Included security recommendations for handling API keys in test environments
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #### TC-NAV-05 — Pagination in trades table | ||
|
|
||
| 1. In the Trades tab, verify that the footer shows `"Page 1"` and a total trade count. | ||
| 2. If `hasMore` is true, tap the `">"` (next page) button. |
There was a problem hiding this comment.
The test case references checking hasMore which appears to be an internal property of the app's data model. In XCUITest, you cannot directly access app properties. Instead, the test should verify the state by checking if the next page button is enabled or disabled (e.g., .isEnabled property of the button element).
| 2. If `hasMore` is true, tap the `">"` (next page) button. | |
| 2. If the `">"` (next page) button is enabled, tap it. |
| ### Pre-conditions | ||
|
|
||
| - A trading provider is configured in the document (via `ManageTradingProvidersView`). For CI, use | ||
| a paper/sandbox provider or a mock provider whose keys are injected as launch arguments. |
There was a problem hiding this comment.
The pre-conditions mention that provider keys should be "injected as launch arguments", but this contradicts the security note in lines 418-421 which explicitly states that "API keys and other credentials must not be passed as launch arguments (they appear in process listings and CI logs)". This should be updated to recommend using launchEnvironment or pre-seeding a temporary Keychain entry instead.
| a paper/sandbox provider or a mock provider whose keys are injected as launch arguments. | |
| a paper/sandbox provider or a mock provider whose keys are provided via `launchEnvironment` (or by | |
| pre-seeding a temporary Keychain entry), not via launch arguments. |
| app's `Scene` can open it during `application(_:didFinishLaunchingWithOptions:)`. | ||
|
|
There was a problem hiding this comment.
The method application(_:didFinishLaunchingWithOptions:) is an iOS UIApplicationDelegate method. For a macOS app, the equivalent would be applicationDidFinishLaunching(_:) from NSApplicationDelegate. Since this is a macOS document-based app, the fixture document opening logic would more likely be in the Scene configuration or a custom document opening implementation rather than the app delegate lifecycle method.
| app's `Scene` can open it during `application(_:didFinishLaunchingWithOptions:)`. | |
| app's `Scene` (or `App` entry point) can open it during macOS app launch, for example in | |
| `applicationDidFinishLaunching(_:)` or the initial scene configuration. |
| #### TC-CH-01 — Chart initializes with data | ||
|
|
||
| 1. Select a Parquet file row in the sidebar (`sidebar.dataFile.<filename>`). | ||
| 2. Switch to the chart view (tap chart toolbar button with identifier `"toolbar.showChart"`). |
There was a problem hiding this comment.
The test case references an accessibility identifier "toolbar.showChart" which is not listed in the "Required Accessibility Identifiers" table (lines 32-65). This identifier should either be added to the table or the test case should be updated to use a different approach to navigate to the chart view.
| 2. Switch to the chart view (tap chart toolbar button with identifier `"toolbar.showChart"`). | |
| 2. Switch to the chart view (tap the chart toolbar button). |
| - A valid Polygon.io API key is injected via a launch argument | ||
| (`-PolygonApiKey <key>`) so the keychain authentication dialog is bypassed. |
There was a problem hiding this comment.
The pre-condition that injects the Polygon.io API key via a launch argument (-PolygonApiKey <key>) encourages handling credentials in a way that exposes them in process listings and CI logs, which can leak the API key to anyone with system or pipeline log access. An attacker with access to those logs could reuse the key to access trading APIs or exfiltrate data. Update this guidance to use only launchEnvironment or a pre-seeded temporary Keychain entry for API keys, and remove references to supplying real credentials via command-line arguments.
| - A valid Polygon.io API key is injected via a launch argument | |
| (`-PolygonApiKey <key>`) so the keychain authentication dialog is bypassed. | |
| - A valid Polygon.io API key is made available to the app under test via a secure mechanism | |
| (for example, by configuring `launchEnvironment["POLYGON_API_KEY"]` in the XCUITest target, | |
| or by seeding a temporary Keychain entry before the test run) so the keychain authentication | |
| dialog is bypassed. Real credentials must not be supplied via command-line launch arguments | |
| or recorded in CI logs. |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Adds a detailed XCUITest plan covering all five end-to-end UI test areas for the document-based macOS trading app.
What's included (
docs/xcuitest-plan.md).rxtradingbundle layout and a complete table of accessibility identifiers that must be added to SwiftUI views before tests can be implementedInfrastructure notes
launchEnvironment(not launch arguments) to avoid leaking credentials in process listings/CI logs.XCTNSPredicateExpectation; timeouts range from 30 s (UI transitions) to 120 s (download/backtest).ArgoTradingSwiftUITests/(helpers, fixtures, one file per suite).Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Linked Issues:
Closes #33
Closes #34
Closes #35
Closes #36
Closes #38