这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Apr 18, 2025

This PR changes the "Text Field long text" to much longer one to demonstrate eca2ed1 (Before #970 regression.

Before the change:

Screenshot 2025-04-18 at 10 29 51 PM

while after the change failed:

Screenshot 2025-04-18 at 10 33 37 PM

Vanilla XCTest had the entire text appium/appium-xcuitest-driver#2552 (comment) .

@KazuCocoa KazuCocoa changed the title replace long text test test: replace long text test Apr 18, 2025
@KazuCocoa KazuCocoa changed the title test: replace long text test test: replace long text test with much longer text Apr 18, 2025
@mykola-mokhnach
Copy link

Is it expected that the test should fail?

@mykola-mokhnach
Copy link

this fix helps to workaround the text length issue:

fix

@KazuCocoa
Copy link
Member Author

KazuCocoa commented Apr 19, 2025

Thanks. do you think we could do the same thing in the page source as well...? If not, I think adding documentation would be sufficient

<XCUIElementTypeTextView type="XCUIElementTypeTextView" value="12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012" enabled="true" visible="true" accessible="true" x="20" y="508" width="390" height="354" index="13">
<XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="Vertical scroll bar, 1 page" label="Vertical scroll bar, 1 page" enabled="true" visible="true" accessible="false" x="377" y="508" width="30" height="354" index="0">
	<XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="false" accessible="false" x="404" y="588" width="3" height="245" index="0"/>

	
=> #<Appium::Core::Element:0x..fba76fa2a4534a244 id="1A000000-0000-0000-B0A3-000000000000">
[202] pry(main)> e.text                                                                                                                                           
=> "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012"
[203] pry(main)> e.value                                                                                                                                          
=> "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901"

I have added for the getText endpoint to call fb_takeSnapshot:YES, then it returned:

[215] pry(main)> e.text                                                                                                                                           
=> "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901"

as well.

@KazuCocoa KazuCocoa changed the title test: replace long text test with much longer text fix: Long text Apr 19, 2025
@KazuCocoa KazuCocoa changed the title fix: Long text fix: Missing text in long text for get text/value Apr 19, 2025
@mykola-mokhnach
Copy link

Thanks. do you think we could do the same thing in the page source as well...? If not, I think adding documentation would be sufficient

I assume Apple designed it this way due to two reasons:

  • better preformance
  • optimized memory usage

that it why I would keep built-in snapshots for the page source retrieval.

Maybe we could put the possibility to always deep snapshot for the page source retrieval under a setting though, but I really don't see a point of having huge attribute values in xmls

@KazuCocoa KazuCocoa merged commit 6603a0b into master Apr 19, 2025
8 of 17 checks passed
@KazuCocoa KazuCocoa deleted the long-test-test branch April 19, 2025 07:52
github-actions bot pushed a commit that referenced this pull request Apr 19, 2025
## [9.5.2](v9.5.1...v9.5.2) (2025-04-19)

### Bug Fixes

* Missing text in long text for get text/value ([#1007](#1007)) ([6603a0b](6603a0b))
@github-actions
Copy link

🎉 This PR is included in version 9.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants