Skip to content

Commit 574c41e

Browse files
committed
assert stable ids on an element after the inserted row
1 parent d8fc195 commit 574c41e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • apps/desktop/native/computer-use/tests

‎apps/desktop/native/computer-use/tests/live.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ def coordinate(snapshot, node, fx=0.5, fy=0.5):
9191
else:
9292
assert 'screen_capture_permission_required' in snapshot.get('screenshotError', '')
9393
print('BLOCKED: screenshot verification skipped because Screen Recording grant is missing', flush=True)
94-
field_id = find(snapshot, role='AXTextField', label='Fixture editable text')['elementId']
94+
# Increment follows the inserted row and is never the focused editor, which traversal always lists first.
95+
increment_id = find(snapshot, role='AXButton', label='Increment')['elementId']
9596
mutate('click', snapshot, elementId=find(snapshot, role='AXButton', label='Add row')['elementId'])
9697
snapshot = state()
9798
assert any(node.get('value', node.get('label')) == 'Added row' for node in snapshot['nodes']), 'Add row did not insert its label'
98-
assert find(snapshot, role='AXTextField', label='Fixture editable text')['elementId'] == field_id, 'An element changed id when another was added above it'
99+
assert find(snapshot, role='AXButton', label='Increment')['elementId'] == increment_id, 'An element changed id when another was added above it'
99100
baseline = int(next(node.get('value', node.get('label', '')) for node in snapshot['nodes'] if node.get('value', node.get('label', '')).startswith('Count: ')).split(': ')[1])
100101
button = find(snapshot, role='AXButton', label='Increment')
101102
snapshot = mutate('click', snapshot, elementId=button['elementId'])

0 commit comments

Comments
 (0)