Skip to content

[DRAFT] Introduce Qt test automation bridge and gui functional tests#933

Draft
johnny9 wants to merge 3 commits intobitcoin-core:masterfrom
johnny9:qt-test-bridge
Draft

[DRAFT] Introduce Qt test automation bridge and gui functional tests#933
johnny9 wants to merge 3 commits intobitcoin-core:masterfrom
johnny9:qt-test-bridge

Conversation

@johnny9
Copy link
Copy Markdown
Contributor

@johnny9 johnny9 commented Mar 12, 2026

This PR introduces an optional Qt test automation bridge and adds a first suite of GUI functional tests for bitcoin-qt.

The goal is to improve GUI testability and reduce reliance on manual regression testing for all of the gui flows.

Starting as a draft to get a conversation going.

• New CMake option: ENABLE_TEST_AUTOMATION (default OFF)
• New runtime arg: -test-automation=
• New files:
• src/qt/testbridge.h
• src/qt/testbridge.cpp

The test automation bride creates a unix socket server that has a simple json protocol defined in src/qt/testbridge.h.

The bridge adds the following commands to enable end to end gui validation
• list_windows
• get_active_window
• get_current_view (alias: get_current_page)
• get_property
• click
• set_text
• wait_for_window
• wait_for_view (alias: wait_for_page)
• wait_for_property
• get_text
• save_screenshot
• list_objects

Build:

• -DBUILD_GUI=ON
• -DENABLE_WALLET=ON
• -DENABLE_TEST_AUTOMATION=ON

Run:

• test/functional/test_runner.py gui_node_window.py
• test/functional/test_runner.py gui_settings_persistence.py
• test/functional/test_runner.py gui_wallet_lifecycle.py
• test/functional/test_runner.py gui_wallet_receive.py
• test/functional/test_runner.py gui_wallet_security.py
• test/functional/test_runner.py gui_wallet_send.py
• test/functional/test_runner.py gui_wallet_send_advanced.py

@DrahtBot
Copy link
Copy Markdown
Contributor

DrahtBot commented Mar 12, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK w0xlt

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #762 (Update about logo icon (colour) to denote the chain type of the QT instance in About/ Help Message Window/ Dialog by pablomartin4btc)
  • #bitcoin/bitcoin/34931 (validation: abort on DB unreadable coins instead of treating them as missing by furszy)
  • #bitcoin/bitcoin/34872 (wallet: fix mixed-input transaction accounting in history RPCs by w0xlt)
  • #bitcoin/bitcoin/33974 (cmake: Check dependencies after build option interaction by hebasto)
  • #bitcoin/bitcoin/31260 (scripted-diff: Type-safe settings retrieval by ryanofsky)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot
Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin-core/gui/actions/runs/23009276310/job/66814867840
LLM reason (✨ experimental): Python linting failed (ruff detected unused import and lint-files.py reported 7 failed tests).

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@w0xlt
Copy link
Copy Markdown
Contributor

w0xlt commented Mar 22, 2026

Very interesting and necessary. Concept ACK.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants