-
Notifications
You must be signed in to change notification settings - Fork 9
feat: many StartDeviceKit() optimizations #162
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
edcc406
feat: optimizing start devicekit, starting at 13 seconds
gmegidish a942d4d
feat: check if devicekit-ios is already running and ready to stream v…
gmegidish 75a82a2
fixed potential bug
gmegidish 3d0c929
revert page source with attributes
gmegidish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
🌐 Web query:
WDA WebDriverAgent /source endpoint excluded_attributes specification💡 Result:
WebDriverAgent itself exposes the standard WebDriver endpoint:
GET /session/:sessionId/source→ returns the XML page source (there is no formal, W3C-definedexcluded_attributesquery parameter).In the Appium + WDA ecosystem, “exclude attributes from source” is specified via the Appium XCUITest driver (which then instructs WDA accordingly), using camelCase:
1)
mobile: source(recommended; per-call control)Execute Script:
script:mobile: sourceargs:format:xml(default),description, orjsonexcludedAttributes: comma-separated string of attribute names to omit (only applies toxml) [1]Example args:
{"format":"xml","excludedAttributes":"visible,accessible"}[1]
2) Persistent setting:
pageSourceExcludedAttributesSet the XCUITest driver setting:
pageSourceExcludedAttributes: comma-separated string (defaults to empty). Example:"visible,accessible"[2]Notes:
visible/accessibleas a way to speed up page source retrieval [3].frame, enabled, visible, accessible, focused[2].Sources: [1] [2] [3]
🌐 Web query:
WDA source attributes list accessible visible x y width height💡 Result:
In WebDriverAgent (WDA) page source as exposed by Appium’s XCUITest driver, the supported element attributes are:
name,label,type,visible,focused,accessible,enabled,selected,index,rect,value(andhittable, but it’s not included in the XML source for performance reasons). [1]For position/size, WDA exposes them via
rect, which containsx,y,width,height(derived from the element’s frame). [1]So if you’re looking for:
accessible,visible,x,y,width,height→ useaccessible,visible, andrect.{x,y,width,height}. [1]Sources: [1]
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 249
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 464
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 86
🏁 Script executed:
# Read the source.go file to understand the current implementation cat -n ./devices/wda/source.goRepository: mobile-next/mobilecli
Length of output: 6890
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 49
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 3309
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 584
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 252
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 1780
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 82
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 49
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 3394
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 871
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 47
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 1483
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 1898
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 384
Add validation for requested attribute names against the supported WDA attributes list.
The method silently accepts and silently ignores unknown or typo'd attribute names, potentially excluding required fields and returning partial/unexpected data. Implement validation to return an error for any attribute not in the
allAttributeslist. Additionally, refactor the nested loop to use sets for better performance.🧩 Suggested refactor
🤖 Prompt for AI Agents