Skip to content

test(gui): enable syncing tests#889

Draft
prashant-gurung899 wants to merge 2 commits intotest/port-to-appiumfrom
test/sync-tests
Draft

test(gui): enable syncing tests#889
prashant-gurung899 wants to merge 2 commits intotest/port-to-appiumfrom
test/sync-tests

Conversation

@prashant-gurung899
Copy link
Copy Markdown
Contributor

No description provided.

@prashant-gurung899 prashant-gurung899 self-assigned this Apr 28, 2026
@prashant-gurung899 prashant-gurung899 force-pushed the test/sync-tests branch 4 times, most recently from 00c6560 to 60cbb3e Compare April 29, 2026 05:04
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
@anon-pradip
Copy link
Copy Markdown
Contributor

anon-pradip commented Apr 29, 2026

My findings:

Issue

When testing the selective sync folder selection in the OpenCloud Desktop client, Appium could not toggle the checkboxes in the Qt tree widget. The test would fail with:

selenium.common.exceptions.WebDriverException: Message: element's actions list didn't contain SetFocus. The element may be malformed

Root Cause

The Qt QTreeWidget checkbox is implemented using QTreeWidgetItem::setCheckState(). While the checkbox is visually rendered, the AT-SPI accessibility bridge does not expose the toggle action to automation frameworks.

Investigation showed:

  • checkable: true - element is checkable
  • actions: None - no actions exposed via AT-SPI
  • role: None - role not exposed
  • Standard click() selects the row but doesn't toggle the checkbox
  • send_keys(" ") fails because the element lacks proper AT-SPI action interface

What We Tried

Method Result
element.click() Selects row, doesn't toggle checkbox
TouchAction / app().tap() Not supported in this environment
send_keys(" ") / send_keys(Keys.SPACE) Element doesn't support keyboard actions
execute_script() (JavaScript) Command not supported
XPath to find checkbox child No separate checkbox element exists
pyatspi, pyautogui, Xlib Not available in test environment

Solution

Use xdotool - a command-line X11 automation tool that interacts directly with the X window system, bypassing AT-SPI limitations.

# After Appium click fails, use xdotool:
subprocess.run(['xdotool', 'mousemove', str(x), str(y)], check=True)
subprocess.run(['xdotool', 'click', '1'], check=True)

Where (x, y) is the checkbox position (10-15px from left edge of the row).

Implementation

The fix was added to SyncConnectionWizard.select_or_unselect_folders_to_sync():

  1. Try Appium click (selects row)
  2. If checkbox not toggled, use xdotool to click at checkbox position

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.

2 participants