mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Introduce Qml Test Bridge #503
No reviewers
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!503
Loading…
Reference in a new issue
No description provided.
Delete branch "test-bridge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a build config to compile in a json rpc server that can be used to query the QML engine tree and send click events to it. Python driver and harness are added as well as two basic tests. qml_test_bridge_sanity.py does a basic test against the test-bridge and qml_test_onboard.py does a basic click through of the onboard views.
Related to #506
tested 0dc632a getting some build errors
Followed the instructions in doc/test-bridge.md
Built with
Build Errors
The llms say that:
Overall looks good, the only large issue is that the testbridge header and cpp file aren't in sync.
Missing includes: QCoreApplication, QEvent, QMouseEvent, QPointF, QSet and QJsonValue.
Unused.
Unused.
Unused, but may want to keep if used instead of msleep.
NamedObjectEntry struct is used here but not declared in testbridge.h
Says bread-first search when should say depth-first search.
Using msleep inside of QLocalSocket::readyRead can cause issues, better to use QEventLoop and QTimer.
Using msleep inside of QLocalSocket::readyRead can cause issues, better to use QEventLoop and QTimer.
This method is not declared in the header file.
This method is not declared in the header file.
Missing QByteArray include.
Mismatch with the definition in testbridge.cpp
The header file names this variable m_read_buffer but the cpp file refers to it as m_read_buffers. Also the cpp file uses it as if its type is QHash<QLocalSocket*, QByteArray> while the header declares it as type QByteArray.
gui variable is undefined if start() fails.
Temporary directory is never removed.
gui variable is undefined if start() fails.
This may not be enough time on slower machines, better to use gui.wait_for_page().
Thanks for the reviews. It looks like when I tried merging my updates from my dev branch i missed a chunk.
I have now updated the branch.
In addition, I simplified the page lookup functionality by adding a reference to the main page stack so that its easier for the testbridge to find the current leaf in the stack which should contain the page we are looking for.
Other improvements were to replace the sleep which ended up being in the main gui loop with a timer event loop which is a bit more complicated but doesnt block the main gui thread. A processing_gaurd was also added to make sure another client can't send a command while the wait for property/page is doing its event looping.
tested 001eb6a
Build now works, had to make sure to:
git submodule update --init
python3 test/functional/qml_test_bridge_sanity.py PASSED
python3 test/functional/qml_test_onboarding.py FAILED
The qml_test_onboarding.py also failed with python3 test/functional/qml_test_onboarding.py --socket-path /tmp/test_bridge.sock running the app in regtest mode with -resetguisettings
What platform are you testing with? Linux, Mac, windows?
I think I'll probably need to go ahead and create the github work flow for this now also so that we have some sanity with the platform
this is on WSL Ubuntu 22.04.5 LTS
Thanks, it was a regression. I changed around the click function a bit and now the tests should all pass.
tACK fb07db8 on WSL Ubuntu 24.04.3 LTS
It built successfully
Then both test PASSED including using the socket
python3 test/functional/qml_test_bridge_sanity.py
python3 test/functional/qml_test_onboarding.py
Fixed the dependencies in the ci workflow
Force pushed the remaining fixes from @epicleafies comments.
tACK once these three small issues are fixed.
If toggle() succeeds but invoking clicked() returns false the method still returns ok: true, these should be tracked separately and only return ok here if noClicked signal was found.
If SIGKILL isn't successful it will wait forever, probably want a timeout.
This works but may be better to add a wait_for_page_not() command to bridge instead of doing custom polling.
Going to merge this leaving the rest for follow-ups.