Skip to content

test(amm-ui): add swap UI test - #237

Open
gravityblast wants to merge 1 commit into
mainfrom
amm-ui-swap-test
Open

test(amm-ui): add swap UI test#237
gravityblast wants to merge 1 commit into
mainfrom
amm-ui-swap-test

Conversation

@gravityblast

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 an end-to-end UI-driven swap test for the AMM QML app (apps/amm) and introduces stable QML objectName hooks plus documentation/config scaffolding to make the UI test runnable and debuggable.

Changes:

  • Add apps/amm/tests/swap.mjs to drive the live AMM UI via the QML inspector and assert on-chain pool reserve changes after a swap.
  • Add stable objectName hooks across Swap UI QML components to enable deterministic inspector targeting.
  • Update docs and configuration templates for token list setup, and gitignore local token config + test screenshot artifacts.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Updates TOKENS_CONFIG example path to apps/amm/amm-tokens.json.
apps/amm/README.md Documents token list template workflow and adds a “Running the UI tests” section.
apps/amm/tests/swap.mjs New inspector-driven swap test with screenshots and on-chain reserve assertions.
apps/amm/qml/pages/SwapPage.qml Adds objectName to the SwapCard instance for test targeting.
apps/amm/qml/components/swap/TokenSelectorModal.qml Adds objectName hooks for the modal and token list delegates.
apps/amm/qml/components/swap/TokenInput.qml Exposes objectName forwarding aliases for deterministic input/button selection in tests.
apps/amm/qml/components/swap/SwapConfirmationDialog.qml Adds objectName hooks for the dialog and confirm button.
apps/amm/qml/components/swap/SwapCard.qml Wires objectName hooks into sell/buy inputs/buttons and the submit CTA container.
apps/amm/amm-tokens.json.example Adds a checked-in template token list for local configuration.
apps/amm/.gitignore Ignores personal amm-tokens.json and test screenshot PNG artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/amm/tests/swap.mjs Outdated
@gravityblast
gravityblast force-pushed the amm-ui-swap-test branch 3 times, most recently from b88323b to 8f6e39f Compare July 29, 2026 12:41

@0x-r4bbit 0x-r4bbit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tried running this one headlessly via:

nix build .#integration-test -L

But it fails.

Anything else missing for the headless run?

"holding": "REPLACE_WITH_YOUR_TOKEN_B_HOLDING_ACCOUNT",
"decimals": 18
}
]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We probably want to make this an app-config.json or something like that, I could imagine adding other things here that the app wants to show by default (like a list of pools etc)

"name": "Token B",
"definitionId": "REPLACE_WITH_TOKEN_B_DEFINITION_ID",
"holding": "REPLACE_WITH_YOUR_TOKEN_B_HOLDING_ACCOUNT",
"decimals": 18

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The decimals don't exist in the program. Is this used anywhere? Otherwise we can get rid off it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants