Skip to content

docs: XCUITest plan for ArgoTradingSwift document app#54

Merged
sirily11 merged 2 commits intomainfrom
copilot/create-test-plan-document-app
Feb 24, 2026
Merged

docs: XCUITest plan for ArgoTradingSwift document app#54
sirily11 merged 2 commits intomainfrom
copilot/create-test-plan-document-app

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

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)

  • Prerequisites — fixture .rxtrading bundle layout and a complete table of accessibility identifiers that must be added to SwiftUI views before tests can be implemented
  • Suite 1 — Dataset Download (TC-DS-01–07): sheet open, provider picker, config form, progress view, cancel, success → sidebar update, error alert
  • Suite 2 — Chart Scroll & Infinite Loading (TC-CH-01–06): initial load, leftward scroll triggers incremental load, boundary check (no infinite loop), scroll-position preservation after load, interval change, pinch-to-zoom
  • Suite 3 — Run Strategy / Backtest (TC-BT-01–08): schema/dataset picker, disabled run button guard, trigger run, progress counter, result file creation, result detail view, multiple runs
  • Suite 4 — Navigate to Signal & Trade Data Points (TC-NAV-01–07): trade/mark row selection → chart scroll-to-timestamp, "View Surrounding Price Data" context menu → sheet, pagination on both tables, strategy-name link → strategy detail
  • Suite 5 — Live Trading (TC-LT-01–10): mode switch, provider picker, start/stop session, live chart updates, interval selector, historical reload after stop, multi-session sidebar, empty state

Infrastructure notes

  • API keys must be supplied via launchEnvironment (not launch arguments) to avoid leaking credentials in process listings/CI logs.
  • Async waits use XCTNSPredicateExpectation; timeouts range from 30 s (UI transitions) to 120 s (download/backtest).
  • Suggested file layout for ArgoTradingSwiftUITests/ (helpers, fixtures, one file per suite).
Original prompt

create a detailed test plan on how to test the document app using xcuitest.

  1. need to download dataset
  2. verify the chart scrolling and infinite data loading
  3. implement run strategy
  4. implement click to navigate to the signal and trade data point
    5.test on live trading

just give me a plan, no code needed. place plan in docs folder


💬 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

@autopilot-project-manager autopilot-project-manager bot added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 23, 2026
Co-authored-by: sirily11 <32106111+sirily11@users.noreply.github.com>
Copilot AI changed the title [WIP] Create detailed test plan for document app using XCUITest docs: XCUITest plan for ArgoTradingSwift document app Feb 23, 2026
Copilot AI requested a review from sirily11 February 23, 2026 01:37
@sirily11 sirily11 marked this pull request as ready for review February 23, 2026 01:44
Copilot AI review requested due to automatic review settings February 23, 2026 01:44
@sirily11 sirily11 enabled auto-merge (squash) February 23, 2026 01:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
2. If `hasMore` is true, tap the `">"` (next page) button.
2. If the `">"` (next page) button is enabled, tap it.

Copilot uses AI. Check for mistakes.
### 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.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +426 to +427
app's `Scene` can open it during `application(_:didFinishLaunchingWithOptions:)`.

Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
#### 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"`).
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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).

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +79
- A valid Polygon.io API key is injected via a launch argument
(`-PolygonApiKey <key>`) so the keychain authentication dialog is bypassed.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- 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.

Copilot uses AI. Check for mistakes.
@sirily11 sirily11 merged commit 6021c49 into main Feb 24, 2026
11 of 12 checks passed
@sirily11 sirily11 deleted the copilot/create-test-plan-document-app branch February 24, 2026 08:30
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

3 participants