Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ScanOptions.NativeWindowHandle to scope Scans to rooted UIA sub-tree #1022

Merged
merged 23 commits into from
May 13, 2024

Conversation

blackcatsonly
Copy link
Contributor

Details

Adds:

  • ScanOptions property settable to IntPtr for HWND of root of subtree to be scanned
  • Teach PID descendants search to operate on HWND's subtree instead of GetRootElement
  • Add Integration test for test app leaf node scan
Motivation

Proposal to address issue #1021

Context

I exposed internals of A11yAutomation to the Integration Tests project so I could find a relevant IUIAutomationElement for testing the ScanOptions' HWND constraint

You could implement this as a "ForWindowHandle()" constraint on the Config, but my external tools use the same scanner repeatedly - it's the individual Scans whose scope needs to be constrained.

Pull request checklist

@blackcatsonly blackcatsonly requested a review from a team as a code owner May 1, 2024 21:09
@blackcatsonly
Copy link
Contributor Author

@JGibson2019 Proposed change to allow ScanOptions to limit the scope of the Scan

@codeofdusk
Copy link
Contributor

Please update the documentation (docs/AutomationReference.md and, for the CLI, the README.md under src/cli) with your new options.

@blackcatsonly
Copy link
Contributor Author

@DaveTryon @codeofdusk Thanks for reviewing. I believe I've addressed all the comments from the first iteration. Would you please take a second look?

@codeofdusk
Copy link
Contributor

@blackcatsonly Please update the AutomationReference docs.

@blackcatsonly
Copy link
Contributor Author

@codeofdusk Thanks, missed than one! Updated in latest iteration.

@codeofdusk
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -3,6 +3,8 @@

namespace Axe.Windows.Automation
{
using System;
Copy link
Contributor

Choose a reason for hiding this comment

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

Move using to outside namespace declaration

@codeofdusk
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codeofdusk
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov-commenter
Copy link

codecov-commenter commented May 13, 2024

Codecov Report

Attention: Patch coverage is 94.23077% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 72.21%. Comparing base (4fc19c3) to head (aefe4da).
Report is 383 commits behind head on main.

❗ Current head aefe4da differs from pull request most recent head 37b41b3. Consider uploading reports for the commit 37b41b3 to get more accurate results

Files Patch % Lines
src/CLI/ScanRunner.cs 0.00% 1 Missing ⚠️
src/Core/Bases/A11yElement.cs 0.00% 0 Missing and 1 partial ⚠️
src/Desktop/UIAutomation/A11yAutomation.cs 96.55% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1022      +/-   ##
==========================================
- Coverage   73.70%   72.21%   -1.49%     
==========================================
  Files         398      424      +26     
  Lines       12046    13158    +1112     
  Branches        0     1413    +1413     
==========================================
+ Hits         8878     9502     +624     
- Misses       3168     3243      +75     
- Partials        0      413     +413     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codeofdusk
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codeofdusk codeofdusk merged commit 6d72b85 into microsoft:main May 13, 2024
6 checks passed
@blackcatsonly blackcatsonly deleted the user/forrestd/ScanScopedUI branch May 14, 2024 03:32
@blackcatsonly
Copy link
Contributor Author

Thanks @codeofdusk!

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.

4 participants