diff --git a/change/react-native-windows-d334336e-c641-4b9e-bbd3-9c6dd4f5b228.json b/change/react-native-windows-d334336e-c641-4b9e-bbd3-9c6dd4f5b228.json new file mode 100644 index 00000000000..f68dfc5830b --- /dev/null +++ b/change/react-native-windows-d334336e-c641-4b9e-bbd3-9c6dd4f5b228.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "ITextProvider Implementation", + "packageName": "react-native-windows", + "email": "34109996+chiaramooney@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/e2e-test-app-fabric/test/ButtonComponentTest.test.ts b/packages/e2e-test-app-fabric/test/ButtonComponentTest.test.ts index 3b28682be94..f7b85df5c53 100644 --- a/packages/e2e-test-app-fabric/test/ButtonComponentTest.test.ts +++ b/packages/e2e-test-app-fabric/test/ButtonComponentTest.test.ts @@ -27,7 +27,11 @@ const searchBox = async (input: string) => { await app.waitUntil( async () => { await searchBox.setValue(input); - return (await searchBox.getText()) === input; + if (input === '') { + return (await searchBox.getText()) === 'Search...'; + } else { + return (await searchBox.getText()) === input; + } }, { interval: 1500, diff --git a/packages/e2e-test-app-fabric/test/PressableComponentTest.test.ts b/packages/e2e-test-app-fabric/test/PressableComponentTest.test.ts index a16f1879521..49313784258 100644 --- a/packages/e2e-test-app-fabric/test/PressableComponentTest.test.ts +++ b/packages/e2e-test-app-fabric/test/PressableComponentTest.test.ts @@ -45,7 +45,7 @@ describe('Pressable Tests', () => { await app.waitUntil( async () => { await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']); - return (await searchBox.getText()) === ''; + return (await searchBox.getText()) === 'Search...'; }, { interval: 1500, @@ -84,7 +84,7 @@ describe('Pressable Tests', () => { await app.waitUntil( async () => { await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']); - return (await searchBox.getText()) === ''; + return (await searchBox.getText()) === 'Search...'; }, { interval: 1500, @@ -118,7 +118,7 @@ describe('Pressable Tests', () => { await app.waitUntil( async () => { await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']); - return (await searchBox.getText()) === ''; + return (await searchBox.getText()) === 'Search...'; }, { interval: 1500, @@ -152,7 +152,7 @@ describe('Pressable Tests', () => { await app.waitUntil( async () => { await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']); - return (await searchBox.getText()) === ''; + return (await searchBox.getText()) === 'Search...'; }, { interval: 1500, @@ -181,7 +181,7 @@ describe('Pressable Tests', () => { await app.waitUntil( async () => { await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']); - return (await searchBox.getText()) === ''; + return (await searchBox.getText()) === 'Search...'; }, { interval: 1500, @@ -210,7 +210,7 @@ describe('Pressable Tests', () => { await app.waitUntil( async () => { await searchBox.setValue(['Backspace', 'Backspace', 'Backspace']); - return (await searchBox.getText()) === ''; + return (await searchBox.getText()) === 'Search...'; }, { interval: 1500, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/AccessibilityTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/AccessibilityTest.test.ts.snap index b70e1b1ac77..41968769ec3 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/AccessibilityTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/AccessibilityTest.test.ts.snap @@ -17,6 +17,7 @@ exports[`Accessibility Tests Components can store range data by setting the min, "ControlType": 50020, "LocalizedControlType": "text", "Name": "The View's (accessibilityRole == adjustable, ie. Slider) properties should be the following according to UIA: Min- 5Max- 125Now- 10", + "TextRangePattern.GetText": "The View's (accessibilityRole == adjustable, ie. Slider) properties should be the following according to UIA: Min- 5Max- 125Now- 10", }, ], }, @@ -73,6 +74,7 @@ exports[`Accessibility Tests Components can store value data by setting the text "ControlType": 50020, "LocalizedControlType": "text", "Name": "The View's properties should be the following according to UIA: Text- testText", + "TextRangePattern.GetText": "The View's properties should be the following according to UIA: Text- testText", }, ], }, @@ -129,6 +131,7 @@ exports[`Accessibility Tests Elements can set accessibilityState:selected to fal "ControlType": 50020, "LocalizedControlType": "text", "Name": "Unselected", + "TextRangePattern.GetText": "Unselected", }, ], }, @@ -187,6 +190,7 @@ exports[`Accessibility Tests Elements can set accessibilityState:selected to tru "ControlType": 50020, "LocalizedControlType": "text", "Name": "Selected", + "TextRangePattern.GetText": "Selected", }, ], }, @@ -252,6 +256,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E "ControlType": 50020, "LocalizedControlType": "text", "Name": "Unselected", + "TextRangePattern.GetText": "Unselected", }, ], }, @@ -267,6 +272,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E "ControlType": 50020, "LocalizedControlType": "text", "Name": "Unselected", + "TextRangePattern.GetText": "Unselected", }, ], }, @@ -282,6 +288,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E "ControlType": 50020, "LocalizedControlType": "text", "Name": "Unselected", + "TextRangePattern.GetText": "Unselected", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/ButtonComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/ButtonComponentTest.test.ts.snap index e97139f6aa0..5db45cd5269 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/ButtonComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/ButtonComponentTest.test.ts.snap @@ -15,6 +15,7 @@ exports[`Button Tests Buttons can be disabled 1`] = ` "IsEnabled": false, "LocalizedControlType": "text", "Name": "Submit Application", + "TextRangePattern.GetText": "Submit Application", }, ], }, @@ -162,6 +163,7 @@ exports[`Button Tests Buttons can have accessibility labels 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Submit Application", + "TextRangePattern.GetText": "Submit Application", }, ], }, @@ -310,6 +312,7 @@ exports[`Button Tests Buttons can have accessibility props 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Submit Application", + "TextRangePattern.GetText": "Submit Application", }, ], }, @@ -440,6 +443,7 @@ exports[`Button Tests Buttons can have accessibility states 1`] = ` "IsEnabled": false, "LocalizedControlType": "text", "Name": "Submit Application", + "TextRangePattern.GetText": "Submit Application", }, ], }, @@ -587,6 +591,7 @@ exports[`Button Tests Buttons can have custom colors 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cancel Application", + "TextRangePattern.GetText": "Cancel Application", }, ], }, @@ -849,6 +854,7 @@ exports[`Button Tests Buttons can have custom focusable and accessible props 2`] "ControlType": 50020, "LocalizedControlType": "text", "Name": "Button with focusable=false", + "TextRangePattern.GetText": "Button with focusable=false", }, ], }, @@ -1098,6 +1104,7 @@ exports[`Button Tests Buttons can have flexbox styling 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cancel", + "TextRangePattern.GetText": "Cancel", }, ], }, @@ -1113,6 +1120,7 @@ exports[`Button Tests Buttons can have flexbox styling 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Submit", + "TextRangePattern.GetText": "Submit", }, ], }, @@ -1424,6 +1432,7 @@ exports[`Button Tests Buttons can have flexbox styling with three buttons 1`] = "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cancel", + "TextRangePattern.GetText": "Cancel", }, ], }, @@ -1439,6 +1448,7 @@ exports[`Button Tests Buttons can have flexbox styling with three buttons 1`] = "ControlType": 50020, "LocalizedControlType": "text", "Name": "Save For Later", + "TextRangePattern.GetText": "Save For Later", }, ], }, @@ -1454,6 +1464,7 @@ exports[`Button Tests Buttons can have flexbox styling with three buttons 1`] = "ControlType": 50020, "LocalizedControlType": "text", "Name": "Submit", + "TextRangePattern.GetText": "Submit", }, ], }, @@ -1894,6 +1905,7 @@ exports[`Button Tests Buttons have default styling 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Submit Application", + "TextRangePattern.GetText": "Submit Application", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/FlatListComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/FlatListComponentTest.test.ts.snap index e2362b8a79e..63a9e12c59b 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/FlatListComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/FlatListComponentTest.test.ts.snap @@ -18,6 +18,7 @@ exports[`FlatList Tests A FlatList can be filtered by a key word 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Item 555 - Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, a", + "TextRangePattern.GetText": "Item 555 - Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, a", }, ], }, @@ -492,6 +493,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pizza", + "TextRangePattern.GetText": "Pizza", }, ], }, @@ -506,6 +508,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Burger", + "TextRangePattern.GetText": "Burger", }, ], }, @@ -520,6 +523,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Risotto", + "TextRangePattern.GetText": "Risotto", }, ], }, @@ -534,6 +538,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "French Fries", + "TextRangePattern.GetText": "French Fries", }, ], }, @@ -548,6 +553,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Onion Rings", + "TextRangePattern.GetText": "Onion Rings", }, ], }, @@ -562,6 +568,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fried Shrimps", + "TextRangePattern.GetText": "Fried Shrimps", }, ], }, @@ -576,6 +583,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Water", + "TextRangePattern.GetText": "Water", }, ], }, @@ -590,6 +598,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Coke", + "TextRangePattern.GetText": "Coke", }, ], }, @@ -604,6 +613,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Beer", + "TextRangePattern.GetText": "Beer", }, ], }, @@ -618,6 +628,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cheesecake", + "TextRangePattern.GetText": "Cheesecake", }, ], }, @@ -632,6 +643,7 @@ exports[`FlatList Tests A FlatList can be inverted 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Brownie", + "TextRangePattern.GetText": "Brownie", }, ], }, @@ -1249,6 +1261,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pizza", + "TextRangePattern.GetText": "Pizza", }, ], }, @@ -1263,6 +1276,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Burger", + "TextRangePattern.GetText": "Burger", }, ], }, @@ -1277,6 +1291,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Risotto", + "TextRangePattern.GetText": "Risotto", }, ], }, @@ -1291,6 +1306,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "French Fries", + "TextRangePattern.GetText": "French Fries", }, ], }, @@ -1305,6 +1321,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Onion Rings", + "TextRangePattern.GetText": "Onion Rings", }, ], }, @@ -1319,6 +1336,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fried Shrimps", + "TextRangePattern.GetText": "Fried Shrimps", }, ], }, @@ -1333,6 +1351,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Water", + "TextRangePattern.GetText": "Water", }, ], }, @@ -1347,6 +1366,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Coke", + "TextRangePattern.GetText": "Coke", }, ], }, @@ -1361,6 +1381,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Beer", + "TextRangePattern.GetText": "Beer", }, ], }, @@ -1375,6 +1396,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cheesecake", + "TextRangePattern.GetText": "Cheesecake", }, ], }, @@ -1389,6 +1411,7 @@ exports[`FlatList Tests A FlatList can have a content inset 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Brownie", + "TextRangePattern.GetText": "Brownie", }, ], }, @@ -2006,6 +2029,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pizza", + "TextRangePattern.GetText": "Pizza", }, ], }, @@ -2014,6 +2038,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Pizza and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Pizza and trailing undefined has not been pressed", }, { "AutomationId": "Burger", @@ -2026,6 +2051,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Burger", + "TextRangePattern.GetText": "Burger", }, ], }, @@ -2034,6 +2060,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Burger and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Burger and trailing undefined has not been pressed", }, { "AutomationId": "Risotto", @@ -2046,6 +2073,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Risotto", + "TextRangePattern.GetText": "Risotto", }, ], }, @@ -2054,6 +2082,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Risotto and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Risotto and trailing undefined has not been pressed", }, { "AutomationId": "French Fries", @@ -2066,6 +2095,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "French Fries", + "TextRangePattern.GetText": "French Fries", }, ], }, @@ -2074,6 +2104,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading French Fries and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading French Fries and trailing undefined has not been pressed", }, { "AutomationId": "Onion Rings", @@ -2086,6 +2117,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Onion Rings", + "TextRangePattern.GetText": "Onion Rings", }, ], }, @@ -2094,6 +2126,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Onion Rings and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Onion Rings and trailing undefined has not been pressed", }, { "AutomationId": "Fried Shrimps", @@ -2106,6 +2139,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fried Shrimps", + "TextRangePattern.GetText": "Fried Shrimps", }, ], }, @@ -2114,6 +2148,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Fried Shrimps and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Fried Shrimps and trailing undefined has not been pressed", }, { "AutomationId": "Water", @@ -2126,6 +2161,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Water", + "TextRangePattern.GetText": "Water", }, ], }, @@ -2134,6 +2170,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Water and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Water and trailing undefined has not been pressed", }, { "AutomationId": "Coke", @@ -2146,6 +2183,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Coke", + "TextRangePattern.GetText": "Coke", }, ], }, @@ -2154,6 +2192,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Coke and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Coke and trailing undefined has not been pressed", }, { "AutomationId": "Beer", @@ -2166,6 +2205,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Beer", + "TextRangePattern.GetText": "Beer", }, ], }, @@ -2174,6 +2214,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Beer and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Beer and trailing undefined has not been pressed", }, { "AutomationId": "Cheesecake", @@ -2186,6 +2227,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cheesecake", + "TextRangePattern.GetText": "Cheesecake", }, ], }, @@ -2194,6 +2236,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Separator for leading Cheesecake and trailing undefined has not been pressed", + "TextRangePattern.GetText": "Separator for leading Cheesecake and trailing undefined has not been pressed", }, { "AutomationId": "Brownie", @@ -2206,6 +2249,7 @@ exports[`FlatList Tests A FlatList can have separators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Brownie", + "TextRangePattern.GetText": "Brownie", }, ], }, @@ -3207,66 +3251,77 @@ exports[`FlatList Tests A FlatList can have sticky headers 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Burger", + "TextRangePattern.GetText": "Burger", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "French Fries", + "TextRangePattern.GetText": "French Fries", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fried Shrimps", + "TextRangePattern.GetText": "Fried Shrimps", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Water", + "TextRangePattern.GetText": "Water", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Coke", + "TextRangePattern.GetText": "Coke", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Beer", + "TextRangePattern.GetText": "Beer", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cheesecake", + "TextRangePattern.GetText": "Cheesecake", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Ice Cream", + "TextRangePattern.GetText": "Ice Cream", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sticky Pizza", + "TextRangePattern.GetText": "Sticky Pizza", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sticky Risotto", + "TextRangePattern.GetText": "Sticky Risotto", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sticky Onion Rings", + "TextRangePattern.GetText": "Sticky Onion Rings", }, ], }, @@ -3859,54 +3914,63 @@ exports[`FlatList Tests A FlatList can nest other Flatlists 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Header", + "TextRangePattern.GetText": "Header", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "16", + "TextRangePattern.GetText": "16", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "17", + "TextRangePattern.GetText": "17", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "18", + "TextRangePattern.GetText": "18", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "19", + "TextRangePattern.GetText": "19", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "21", + "TextRangePattern.GetText": "21", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "22", + "TextRangePattern.GetText": "22", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "23", + "TextRangePattern.GetText": "23", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "24", + "TextRangePattern.GetText": "24", }, ], }, @@ -4789,6 +4853,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pizza", + "TextRangePattern.GetText": "Pizza", }, ], }, @@ -4803,6 +4868,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Burger", + "TextRangePattern.GetText": "Burger", }, ], }, @@ -4817,6 +4883,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Risotto", + "TextRangePattern.GetText": "Risotto", }, ], }, @@ -4831,6 +4898,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "French Fries", + "TextRangePattern.GetText": "French Fries", }, ], }, @@ -4845,6 +4913,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Onion Rings", + "TextRangePattern.GetText": "Onion Rings", }, ], }, @@ -4859,6 +4928,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fried Shrimps", + "TextRangePattern.GetText": "Fried Shrimps", }, ], }, @@ -4873,6 +4943,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Water", + "TextRangePattern.GetText": "Water", }, ], }, @@ -4887,6 +4958,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Coke", + "TextRangePattern.GetText": "Coke", }, ], }, @@ -4901,6 +4973,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Beer", + "TextRangePattern.GetText": "Beer", }, ], }, @@ -4915,6 +4988,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cheesecake", + "TextRangePattern.GetText": "Cheesecake", }, ], }, @@ -4929,6 +5003,7 @@ exports[`FlatList Tests A FlatList has an onEndReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Brownie", + "TextRangePattern.GetText": "Brownie", }, ], }, @@ -5546,6 +5621,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pizza", + "TextRangePattern.GetText": "Pizza", }, ], }, @@ -5560,6 +5636,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Burger", + "TextRangePattern.GetText": "Burger", }, ], }, @@ -5574,6 +5651,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Risotto", + "TextRangePattern.GetText": "Risotto", }, ], }, @@ -5588,6 +5666,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "French Fries", + "TextRangePattern.GetText": "French Fries", }, ], }, @@ -5602,6 +5681,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Onion Rings", + "TextRangePattern.GetText": "Onion Rings", }, ], }, @@ -5616,6 +5696,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fried Shrimps", + "TextRangePattern.GetText": "Fried Shrimps", }, ], }, @@ -5630,6 +5711,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Water", + "TextRangePattern.GetText": "Water", }, ], }, @@ -5644,6 +5726,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Coke", + "TextRangePattern.GetText": "Coke", }, ], }, @@ -5658,6 +5741,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Beer", + "TextRangePattern.GetText": "Beer", }, ], }, @@ -5672,6 +5756,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cheesecake", + "TextRangePattern.GetText": "Cheesecake", }, ], }, @@ -5686,6 +5771,7 @@ exports[`FlatList Tests A FlatList has an onStartReached event 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Brownie", + "TextRangePattern.GetText": "Brownie", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap index d0057572694..9861f83e39e 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap @@ -13,6 +13,7 @@ exports[`Home UIA Tree Dump APIs Tab 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "APIs", + "TextRangePattern.GetText": "APIs", }, ], }, @@ -113,12 +114,14 @@ exports[`Home UIA Tree Dump Accessibility 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Accessibility", + "TextRangePattern.GetText": "Accessibility", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples of using Accessibility APIs.", + "TextRangePattern.GetText": "Examples of using Accessibility APIs.", }, ], }, @@ -192,12 +195,14 @@ exports[`Home UIA Tree Dump Accessibility Windows 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Accessibility Windows", + "TextRangePattern.GetText": "Accessibility Windows", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Usage of accessibility properties.", + "TextRangePattern.GetText": "Usage of accessibility properties.", }, ], }, @@ -271,12 +276,14 @@ exports[`Home UIA Tree Dump AccessibilityInfo 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "AccessibilityInfo", + "TextRangePattern.GetText": "AccessibilityInfo", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples of using AccessibilityInfo APIs.", + "TextRangePattern.GetText": "Examples of using AccessibilityInfo APIs.", }, ], }, @@ -350,12 +357,14 @@ exports[`Home UIA Tree Dump ActivityIndicator 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "ActivityIndicator", + "TextRangePattern.GetText": "ActivityIndicator", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Animated loading indicators.", + "TextRangePattern.GetText": "Animated loading indicators.", }, ], }, @@ -429,12 +438,14 @@ exports[`Home UIA Tree Dump Alerts 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Alerts", + "TextRangePattern.GetText": "Alerts", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Alerts display a concise and informative message and prompt the user to make a decision.", + "TextRangePattern.GetText": "Alerts display a concise and informative message and prompt the user to make a decision.", }, ], }, @@ -508,12 +519,14 @@ exports[`Home UIA Tree Dump Animated - Gratuitous App 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Animated - Gratuitous App", + "TextRangePattern.GetText": "Animated - Gratuitous App", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Bunch of Animations - tap a circle to open a view with more animations, or longPress and drag to reorder circles.", + "TextRangePattern.GetText": "Bunch of Animations - tap a circle to open a view with more animations, or longPress and drag to reorder circles.", }, ], }, @@ -587,12 +600,14 @@ exports[`Home UIA Tree Dump Animated 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Animated", + "TextRangePattern.GetText": "Animated", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Library designed to make animations fluid, powerful, and painless to build and maintain.", + "TextRangePattern.GetText": "Library designed to make animations fluid, powerful, and painless to build and maintain.", }, ], }, @@ -666,12 +681,14 @@ exports[`Home UIA Tree Dump AppState 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "AppState", + "TextRangePattern.GetText": "AppState", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "app background status", + "TextRangePattern.GetText": "app background status", }, ], }, @@ -745,12 +762,14 @@ exports[`Home UIA Tree Dump Appearance 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Appearance", + "TextRangePattern.GetText": "Appearance", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Light and dark user interface examples.", + "TextRangePattern.GetText": "Light and dark user interface examples.", }, ], }, @@ -824,12 +843,14 @@ exports[`Home UIA Tree Dump Border 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Border", + "TextRangePattern.GetText": "Border", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demonstrates some of the border styles available to Views.", + "TextRangePattern.GetText": "Demonstrates some of the border styles available to Views.", }, ], }, @@ -903,12 +924,14 @@ exports[`Home UIA Tree Dump Button 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Button", + "TextRangePattern.GetText": "Button", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Simple React Native button component.", + "TextRangePattern.GetText": "Simple React Native button component.", }, ], }, @@ -981,6 +1004,7 @@ exports[`Home UIA Tree Dump Components Tab 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Components", + "TextRangePattern.GetText": "Components", }, ], }, @@ -1121,12 +1145,14 @@ exports[`Home UIA Tree Dump Composition Bugs Example 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Composition Bugs Example", + "TextRangePattern.GetText": "Composition Bugs Example", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "See bugs in UI.Composition driven native animations", + "TextRangePattern.GetText": "See bugs in UI.Composition driven native animations", }, ], }, @@ -1200,12 +1226,14 @@ exports[`Home UIA Tree Dump Crash 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Crash", + "TextRangePattern.GetText": "Crash", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Crash examples.", + "TextRangePattern.GetText": "Crash examples.", }, ], }, @@ -1279,12 +1307,14 @@ exports[`Home UIA Tree Dump Cxx TurboModule 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cxx TurboModule", + "TextRangePattern.GetText": "Cxx TurboModule", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Usage of Cxx TurboModule", + "TextRangePattern.GetText": "Usage of Cxx TurboModule", }, ], }, @@ -1358,12 +1388,14 @@ exports[`Home UIA Tree Dump DevSettings 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "DevSettings", + "TextRangePattern.GetText": "DevSettings", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Customize the development settings", + "TextRangePattern.GetText": "Customize the development settings", }, ], }, @@ -1437,12 +1469,14 @@ exports[`Home UIA Tree Dump Dimensions 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Dimensions", + "TextRangePattern.GetText": "Dimensions", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Dimensions of the viewport", + "TextRangePattern.GetText": "Dimensions of the viewport", }, ], }, @@ -1516,12 +1550,14 @@ exports[`Home UIA Tree Dump Display: contents 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Display: contents", + "TextRangePattern.GetText": "Display: contents", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demonstrates various ways display: contents may be used in the tree", + "TextRangePattern.GetText": "Demonstrates various ways display: contents may be used in the tree", }, ], }, @@ -1595,12 +1631,14 @@ exports[`Home UIA Tree Dump Display:none Style 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Display:none Style", + "TextRangePattern.GetText": "Display:none Style", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Style prop which will collapse the element in XAML tree.", + "TextRangePattern.GetText": "Style prop which will collapse the element in XAML tree.", }, ], }, @@ -1674,12 +1712,14 @@ exports[`Home UIA Tree Dump Drawing Island Example 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Drawing Island Example", + "TextRangePattern.GetText": "Drawing Island Example", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sample Fabric Native Component that contains a custom ContentIsland", + "TextRangePattern.GetText": "Sample Fabric Native Component that contains a custom ContentIsland", }, ], }, @@ -1753,12 +1793,14 @@ exports[`Home UIA Tree Dump Fabric Native Component 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fabric Native Component", + "TextRangePattern.GetText": "Fabric Native Component", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sample Fabric Native Component that sizes based on max desired size of native XAML contained within", + "TextRangePattern.GetText": "Sample Fabric Native Component that sizes based on max desired size of native XAML contained within", }, ], }, @@ -1832,12 +1874,14 @@ exports[`Home UIA Tree Dump Fabric Native Component Yoga 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fabric Native Component Yoga", + "TextRangePattern.GetText": "Fabric Native Component Yoga", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sample Fabric Native Component that places native XAML inside a container sized by yoga", + "TextRangePattern.GetText": "Sample Fabric Native Component that places native XAML inside a container sized by yoga", }, ], }, @@ -1911,12 +1955,14 @@ exports[`Home UIA Tree Dump Fast Path Texts 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fast Path Texts", + "TextRangePattern.GetText": "Fast Path Texts", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples of performant fast path texts, turn on IsTextPerformanceVisualizationEnabled to visualize examples", + "TextRangePattern.GetText": "Examples of performant fast path texts, turn on IsTextPerformanceVisualizationEnabled to visualize examples", }, ], }, @@ -1990,12 +2036,14 @@ exports[`Home UIA Tree Dump Filter 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Filter", + "TextRangePattern.GetText": "Filter", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "A set of graphical effects that can be applied to a view.", + "TextRangePattern.GetText": "A set of graphical effects that can be applied to a view.", }, ], }, @@ -2069,12 +2117,14 @@ exports[`Home UIA Tree Dump FlatList 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "FlatList", + "TextRangePattern.GetText": "FlatList", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Performant, scrollable list of data.", + "TextRangePattern.GetText": "Performant, scrollable list of data.", }, ], }, @@ -2148,12 +2198,14 @@ exports[`Home UIA Tree Dump Flyout 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Flyout", + "TextRangePattern.GetText": "Flyout", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Displays content on top of existing content, within the bounds of the application window.", + "TextRangePattern.GetText": "Displays content on top of existing content, within the bounds of the application window.", }, ], }, @@ -2227,12 +2279,14 @@ exports[`Home UIA Tree Dump Glyph UWP 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Glyph UWP", + "TextRangePattern.GetText": "Glyph UWP", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Usage of Glyph control.", + "TextRangePattern.GetText": "Usage of Glyph control.", }, ], }, @@ -2306,12 +2360,14 @@ exports[`Home UIA Tree Dump Image 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Image", + "TextRangePattern.GetText": "Image", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Base component for displaying different types of images.", + "TextRangePattern.GetText": "Base component for displaying different types of images.", }, ], }, @@ -2385,12 +2441,14 @@ exports[`Home UIA Tree Dump Keyboard 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Keyboard", + "TextRangePattern.GetText": "Keyboard", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demonstrates usage of the "Keyboard" static API", + "TextRangePattern.GetText": "Demonstrates usage of the "Keyboard" static API", }, ], }, @@ -2464,12 +2522,14 @@ exports[`Home UIA Tree Dump Keyboard 2`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Keyboard", + "TextRangePattern.GetText": "Keyboard", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demonstrates usage of the "Keyboard" static API", + "TextRangePattern.GetText": "Demonstrates usage of the "Keyboard" static API", }, ], }, @@ -2543,12 +2603,14 @@ exports[`Home UIA Tree Dump Keyboard Focus Example 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Keyboard Focus Example", + "TextRangePattern.GetText": "Keyboard Focus Example", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demo of keyboard focus.", + "TextRangePattern.GetText": "Demo of keyboard focus.", }, ], }, @@ -2622,12 +2684,14 @@ exports[`Home UIA Tree Dump Keyboard extension Example 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Keyboard extension Example", + "TextRangePattern.GetText": "Keyboard extension Example", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demo of keyboard properties.", + "TextRangePattern.GetText": "Demo of keyboard properties.", }, ], }, @@ -2701,12 +2765,14 @@ exports[`Home UIA Tree Dump Layout - Flexbox 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Layout - Flexbox", + "TextRangePattern.GetText": "Layout - Flexbox", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples of using the flexbox API to layout views.", + "TextRangePattern.GetText": "Examples of using the flexbox API to layout views.", }, ], }, @@ -2780,12 +2846,14 @@ exports[`Home UIA Tree Dump Layout Events 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Layout Events", + "TextRangePattern.GetText": "Layout Events", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples that show how Layout events can be used to measure view size and position.", + "TextRangePattern.GetText": "Examples that show how Layout events can be used to measure view size and position.", }, ], }, @@ -2859,12 +2927,14 @@ exports[`Home UIA Tree Dump Legacy Native Module 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy Native Module", + "TextRangePattern.GetText": "Legacy Native Module", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Usage of legacy Native Module", + "TextRangePattern.GetText": "Usage of legacy Native Module", }, ], }, @@ -2938,12 +3008,14 @@ exports[`Home UIA Tree Dump LegacyControlStyleTest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "LegacyControlStyleTest", + "TextRangePattern.GetText": "LegacyControlStyleTest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy e2e test for Control Styles", + "TextRangePattern.GetText": "Legacy e2e test for Control Styles", }, ], }, @@ -3017,12 +3089,14 @@ exports[`Home UIA Tree Dump LegacyImageTest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "LegacyImageTest", + "TextRangePattern.GetText": "LegacyImageTest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy e2e test for Image", + "TextRangePattern.GetText": "Legacy e2e test for Image", }, ], }, @@ -3096,12 +3170,14 @@ exports[`Home UIA Tree Dump LegacyLoginTest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "LegacyLoginTest", + "TextRangePattern.GetText": "LegacyLoginTest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy e2e test for TextInput with password", + "TextRangePattern.GetText": "Legacy e2e test for TextInput with password", }, ], }, @@ -3175,12 +3251,14 @@ exports[`Home UIA Tree Dump LegacySelectableTextTest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "LegacySelectableTextTest", + "TextRangePattern.GetText": "LegacySelectableTextTest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy e2e test for selectable Text hit testing", + "TextRangePattern.GetText": "Legacy e2e test for selectable Text hit testing", }, ], }, @@ -3254,12 +3332,14 @@ exports[`Home UIA Tree Dump LegacyTextHitTestTest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "LegacyTextHitTestTest", + "TextRangePattern.GetText": "LegacyTextHitTestTest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy e2e test for Text hit testing", + "TextRangePattern.GetText": "Legacy e2e test for Text hit testing", }, ], }, @@ -3333,12 +3413,14 @@ exports[`Home UIA Tree Dump LegacyTextInputTest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "LegacyTextInputTest", + "TextRangePattern.GetText": "LegacyTextInputTest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Legacy e2e test for TextInput", + "TextRangePattern.GetText": "Legacy e2e test for TextInput", }, ], }, @@ -3412,12 +3494,14 @@ exports[`Home UIA Tree Dump Linking 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Linking", + "TextRangePattern.GetText": "Linking", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Shows how to use Linking to open URLs.", + "TextRangePattern.GetText": "Shows how to use Linking to open URLs.", }, ], }, @@ -3491,12 +3575,14 @@ exports[`Home UIA Tree Dump Modal 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Modal", + "TextRangePattern.GetText": "Modal", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Component for presenting modal views.", + "TextRangePattern.GetText": "Component for presenting modal views.", }, ], }, @@ -3570,12 +3656,14 @@ exports[`Home UIA Tree Dump Mouse Click Events 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Mouse Click Events", + "TextRangePattern.GetText": "Mouse Click Events", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Tests that mouse click events work on intended components", + "TextRangePattern.GetText": "Tests that mouse click events work on intended components", }, ], }, @@ -3649,12 +3737,14 @@ exports[`Home UIA Tree Dump Mouse Events 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Mouse Events", + "TextRangePattern.GetText": "Mouse Events", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Tests that mouse events can be observed", + "TextRangePattern.GetText": "Tests that mouse events can be observed", }, ], }, @@ -3728,12 +3818,14 @@ exports[`Home UIA Tree Dump Moving Light Example 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Moving Light Example", + "TextRangePattern.GetText": "Moving Light Example", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sample Custom Fabric Native Component", + "TextRangePattern.GetText": "Sample Custom Fabric Native Component", }, ], }, @@ -3807,12 +3899,14 @@ exports[`Home UIA Tree Dump Native Animated Example 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Native Animated Example", + "TextRangePattern.GetText": "Native Animated Example", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Test out Native Animations", + "TextRangePattern.GetText": "Test out Native Animations", }, ], }, @@ -3886,12 +3980,14 @@ exports[`Home UIA Tree Dump New App Screen 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "New App Screen", + "TextRangePattern.GetText": "New App Screen", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Displays the content of the new app screen", + "TextRangePattern.GetText": "Displays the content of the new app screen", }, ], }, @@ -3965,12 +4061,14 @@ exports[`Home UIA Tree Dump PanResponder Sample 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "PanResponder Sample", + "TextRangePattern.GetText": "PanResponder Sample", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Shows the Use of PanResponder to provide basic gesture handling", + "TextRangePattern.GetText": "Shows the Use of PanResponder to provide basic gesture handling", }, ], }, @@ -4044,12 +4142,14 @@ exports[`Home UIA Tree Dump Performance API Examples 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Performance API Examples", + "TextRangePattern.GetText": "Performance API Examples", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Shows the performance API provided in React Native", + "TextRangePattern.GetText": "Shows the performance API provided in React Native", }, ], }, @@ -4123,12 +4223,14 @@ exports[`Home UIA Tree Dump Performance Comparison Examples 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Performance Comparison Examples", + "TextRangePattern.GetText": "Performance Comparison Examples", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Compare performance with bad and good examples. Use React DevTools to highlight re-renders is recommended.", + "TextRangePattern.GetText": "Compare performance with bad and good examples. Use React DevTools to highlight re-renders is recommended.", }, ], }, @@ -4202,12 +4304,14 @@ exports[`Home UIA Tree Dump PixelRatio 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "PixelRatio", + "TextRangePattern.GetText": "PixelRatio", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Gives access to device's pixel density and font scale", + "TextRangePattern.GetText": "Gives access to device's pixel density and font scale", }, ], }, @@ -4281,12 +4385,14 @@ exports[`Home UIA Tree Dump PlatformColor 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "PlatformColor", + "TextRangePattern.GetText": "PlatformColor", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples that show how PlatformColors may be used in an app.", + "TextRangePattern.GetText": "Examples that show how PlatformColors may be used in an app.", }, ], }, @@ -4360,12 +4466,14 @@ exports[`Home UIA Tree Dump Pointer Events 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pointer Events", + "TextRangePattern.GetText": "Pointer Events", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demonstrates the use of the pointerEvents prop of a View to control how touches should be handled.", + "TextRangePattern.GetText": "Demonstrates the use of the pointerEvents prop of a View to control how touches should be handled.", }, ], }, @@ -4439,12 +4547,14 @@ exports[`Home UIA Tree Dump Popup 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Popup", + "TextRangePattern.GetText": "Popup", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Displays content on top of existing content, within the bounds of the application window.", + "TextRangePattern.GetText": "Displays content on top of existing content, within the bounds of the application window.", }, ], }, @@ -4518,12 +4628,14 @@ exports[`Home UIA Tree Dump Pressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable", + "TextRangePattern.GetText": "Pressable", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Component for making views pressable.", + "TextRangePattern.GetText": "Component for making views pressable.", }, ], }, @@ -4597,12 +4709,14 @@ exports[`Home UIA Tree Dump RTLExample 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "RTLExample", + "TextRangePattern.GetText": "RTLExample", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Examples to show how to apply components to RTL layout.", + "TextRangePattern.GetText": "Examples to show how to apply components to RTL layout.", }, ], }, @@ -4676,12 +4790,14 @@ exports[`Home UIA Tree Dump ScrollView 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "ScrollView", + "TextRangePattern.GetText": "ScrollView", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Component that enables scrolling through child components", + "TextRangePattern.GetText": "Component that enables scrolling through child components", }, ], }, @@ -4755,12 +4871,14 @@ exports[`Home UIA Tree Dump ScrollViewAnimated 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "ScrollViewAnimated", + "TextRangePattern.GetText": "ScrollViewAnimated", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Component that is animated when ScrollView is offset.", + "TextRangePattern.GetText": "Component that is animated when ScrollView is offset.", }, ], }, @@ -4834,12 +4952,14 @@ exports[`Home UIA Tree Dump ScrollViewSimpleExample 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "ScrollViewSimpleExample", + "TextRangePattern.GetText": "ScrollViewSimpleExample", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Component that enables scrolling through child components.", + "TextRangePattern.GetText": "Component that enables scrolling through child components.", }, ], }, @@ -4908,6 +5028,7 @@ exports[`Home UIA Tree Dump Search Bar 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Search...", + "TextRangePattern.GetText": "Search...", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5022,12 +5143,14 @@ exports[`Home UIA Tree Dump SectionList 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "SectionList", + "TextRangePattern.GetText": "SectionList", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Performant, scrollable list of data.", + "TextRangePattern.GetText": "Performant, scrollable list of data.", }, ], }, @@ -5101,12 +5224,14 @@ exports[`Home UIA Tree Dump Share 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Share", + "TextRangePattern.GetText": "Share", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Share data with other Apps.", + "TextRangePattern.GetText": "Share data with other Apps.", }, ], }, @@ -5180,12 +5305,14 @@ exports[`Home UIA Tree Dump SwipeableCard 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "SwipeableCard", + "TextRangePattern.GetText": "SwipeableCard", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Example of a swipeable card with scrollable content to test PanResponder and JSResponderHandler interaction.", + "TextRangePattern.GetText": "Example of a swipeable card with scrollable content to test PanResponder and JSResponderHandler interaction.", }, ], }, @@ -5259,12 +5386,14 @@ exports[`Home UIA Tree Dump Switch 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Switch", + "TextRangePattern.GetText": "Switch", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Native boolean input", + "TextRangePattern.GetText": "Native boolean input", }, ], }, @@ -5338,12 +5467,14 @@ exports[`Home UIA Tree Dump Text 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Text", + "TextRangePattern.GetText": "Text", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Base component for rendering styled text.", + "TextRangePattern.GetText": "Base component for rendering styled text.", }, ], }, @@ -5417,12 +5548,14 @@ exports[`Home UIA Tree Dump TextInput 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "TextInput", + "TextRangePattern.GetText": "TextInput", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Single and multi-line text inputs.", + "TextRangePattern.GetText": "Single and multi-line text inputs.", }, ], }, @@ -5496,12 +5629,14 @@ exports[`Home UIA Tree Dump TextInputs with key prop 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "TextInputs with key prop", + "TextRangePattern.GetText": "TextInputs with key prop", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Periodically render large number of TextInputs with key prop without a Runtime Error", + "TextRangePattern.GetText": "Periodically render large number of TextInputs with key prop without a Runtime Error", }, ], }, @@ -5575,12 +5710,14 @@ exports[`Home UIA Tree Dump Timers 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Timers", + "TextRangePattern.GetText": "Timers", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "A demonstration of Timers in React Native.", + "TextRangePattern.GetText": "A demonstration of Timers in React Native.", }, ], }, @@ -5654,12 +5791,14 @@ exports[`Home UIA Tree Dump Touchable* and onPress 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Touchable* and onPress", + "TextRangePattern.GetText": "Touchable* and onPress", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Touchable and onPress examples.", + "TextRangePattern.GetText": "Touchable and onPress examples.", }, ], }, @@ -5733,12 +5872,14 @@ exports[`Home UIA Tree Dump TransferProperties 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "TransferProperties", + "TextRangePattern.GetText": "TransferProperties", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Some tests that change the backing XAML element to see if transfer properties is working.", + "TextRangePattern.GetText": "Some tests that change the backing XAML element to see if transfer properties is working.", }, ], }, @@ -5812,12 +5953,14 @@ exports[`Home UIA Tree Dump Transforms 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Transforms", + "TextRangePattern.GetText": "Transforms", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "View transforms", + "TextRangePattern.GetText": "View transforms", }, ], }, @@ -5891,12 +6034,14 @@ exports[`Home UIA Tree Dump TransparentHitTestExample 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "TransparentHitTestExample", + "TextRangePattern.GetText": "TransparentHitTestExample", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Transparent view receiving touch events", + "TextRangePattern.GetText": "Transparent view receiving touch events", }, ], }, @@ -5970,12 +6115,14 @@ exports[`Home UIA Tree Dump TurboModule 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "TurboModule", + "TextRangePattern.GetText": "TurboModule", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Usage of TurboModule", + "TextRangePattern.GetText": "Usage of TurboModule", }, ], }, @@ -6049,12 +6196,14 @@ exports[`Home UIA Tree Dump View 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "View", + "TextRangePattern.GetText": "View", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Basic building block of all UI, examples that demonstrate some of the many styles available.", + "TextRangePattern.GetText": "Basic building block of all UI, examples that demonstrate some of the many styles available.", }, ], }, @@ -6128,12 +6277,14 @@ exports[`Home UIA Tree Dump WebSocket 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "WebSocket", + "TextRangePattern.GetText": "WebSocket", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "WebSocket API", + "TextRangePattern.GetText": "WebSocket API", }, ], }, @@ -6207,12 +6358,14 @@ exports[`Home UIA Tree Dump XAML 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "XAML", + "TextRangePattern.GetText": "XAML", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Usage of react-native-xaml controls", + "TextRangePattern.GetText": "Usage of react-native-xaml controls", }, ], }, @@ -6286,12 +6439,14 @@ exports[`Home UIA Tree Dump XMLHttpRequest 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "XMLHttpRequest", + "TextRangePattern.GetText": "XMLHttpRequest", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Example that demonstrates upload and download requests using XMLHttpRequest.", + "TextRangePattern.GetText": "Example that demonstrates upload and download requests using XMLHttpRequest.", }, ], }, @@ -6365,12 +6520,14 @@ exports[`Home UIA Tree Dump Xaml WinUI3 (Experimental, for Fabric) 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Xaml WinUI3 (Experimental, for Fabric)", + "TextRangePattern.GetText": "Xaml WinUI3 (Experimental, for Fabric)", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Requires UseExperimentalWinUI3 - Xaml content that works in Fabric", + "TextRangePattern.GetText": "Requires UseExperimentalWinUI3 - Xaml content that works in Fabric", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/ImageComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/ImageComponentTest.test.ts.snap index a073f452ec8..b57ec8bc64f 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/ImageComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/ImageComponentTest.test.ts.snap @@ -552,6 +552,7 @@ exports[`Image Tests An Image can be nested inside of a component 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "React", + "TextRangePattern.GetText": "React", }, ], }, @@ -1137,18 +1138,21 @@ exports[`Image Tests An Image can have a tint color 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "It also works using the \`tintColor\` style prop", + "TextRangePattern.GetText": "It also works using the \`tintColor\` style prop", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "The \`tintColor\` prop has precedence over the \`tintColor\` style prop", + "TextRangePattern.GetText": "The \`tintColor\` prop has precedence over the \`tintColor\` style prop", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "It also works with downloaded images:", + "TextRangePattern.GetText": "It also works with downloaded images:", }, ], }, @@ -2174,60 +2178,70 @@ exports[`Image Tests An Image customized how it is rendered within the frame usi "ControlType": 50020, "LocalizedControlType": "text", "Name": "Contain", + "TextRangePattern.GetText": "Contain", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cover", + "TextRangePattern.GetText": "Cover", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fill", + "TextRangePattern.GetText": "Fill", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Scale Down", + "TextRangePattern.GetText": "Scale Down", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "None", + "TextRangePattern.GetText": "None", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Contain", + "TextRangePattern.GetText": "Contain", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cover", + "TextRangePattern.GetText": "Cover", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Fill", + "TextRangePattern.GetText": "Fill", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Scale Down", + "TextRangePattern.GetText": "Scale Down", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "None", + "TextRangePattern.GetText": "None", }, ], }, @@ -3162,72 +3176,84 @@ exports[`Image Tests Images have multiple resize modes 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Contain", + "TextRangePattern.GetText": "Contain", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cover", + "TextRangePattern.GetText": "Cover", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Stretch", + "TextRangePattern.GetText": "Stretch", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Repeat", + "TextRangePattern.GetText": "Repeat", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Center", + "TextRangePattern.GetText": "Center", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "None", + "TextRangePattern.GetText": "None", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Contain", + "TextRangePattern.GetText": "Contain", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Cover", + "TextRangePattern.GetText": "Cover", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Stretch", + "TextRangePattern.GetText": "Stretch", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Repeat", + "TextRangePattern.GetText": "Repeat", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Center", + "TextRangePattern.GetText": "Center", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "None", + "TextRangePattern.GetText": "None", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/LegacySelectableTextTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/LegacySelectableTextTest.test.ts.snap index bdc18fec82e..9c68ae84d69 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/LegacySelectableTextTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/LegacySelectableTextTest.test.ts.snap @@ -7,6 +7,7 @@ exports[`LegacySelectableTextTest DoubleClickWhenNotSelectable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 2 times.", + "TextRangePattern.GetText": "Pressed: 2 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -30,6 +31,7 @@ exports[`LegacySelectableTextTest DoubleClickWhenSelectable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 2 times.", + "TextRangePattern.GetText": "Pressed: 2 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -53,6 +55,7 @@ exports[`LegacySelectableTextTest PressableWhenNotSelectable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -76,6 +79,7 @@ exports[`LegacySelectableTextTest PressableWhenSelectable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextHitTestTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextHitTestTest.test.ts.snap index b0b7f3a23f4..a31407e3fde 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextHitTestTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextHitTestTest.test.ts.snap @@ -7,6 +7,7 @@ exports[`LegacyTextHitTestTest BidirectionalTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 2 times.", + "TextRangePattern.GetText": "Pressed: 2 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -30,6 +31,7 @@ exports[`LegacyTextHitTestTest BidirectionalTextPressableEdgeCaseNotPressable 1` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -53,6 +55,7 @@ exports[`LegacyTextHitTestTest BidirectionalTextSeparateRunsEdgeCasePressable 1` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -76,6 +79,7 @@ exports[`LegacyTextHitTestTest BidirectionalTextSeparateRunsPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 2 times.", + "TextRangePattern.GetText": "Pressed: 2 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -99,6 +103,7 @@ exports[`LegacyTextHitTestTest InsertedVirtualTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -122,6 +127,7 @@ exports[`LegacyTextHitTestTest LTRTextInRTLFlowPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -145,6 +151,7 @@ exports[`LegacyTextHitTestTest MultilineRTLTextEdgeCaseNotPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -168,6 +175,7 @@ exports[`LegacyTextHitTestTest MultilineRTLTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 2 times.", + "TextRangePattern.GetText": "Pressed: 2 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -191,6 +199,7 @@ exports[`LegacyTextHitTestTest MultilineTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -214,6 +223,7 @@ exports[`LegacyTextHitTestTest RTLTextInRTLFlowPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -237,6 +247,7 @@ exports[`LegacyTextHitTestTest RTLTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -260,6 +271,7 @@ exports[`LegacyTextHitTestTest TextPressableWithVirtualText 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -283,6 +295,7 @@ exports[`LegacyTextHitTestTest ToggleVirtualTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -306,6 +319,7 @@ exports[`LegacyTextHitTestTest VirtualTextPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -329,6 +343,7 @@ exports[`LegacyTextHitTestTest WrappedLTRInRTLFlowEdgeCaseNotPressable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressed: 1 times.", + "TextRangePattern.GetText": "Pressed: 1 times.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextInputTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextInputTest.test.ts.snap index 1aab4be6ea6..ebcf3a1ce6a 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextInputTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/LegacyTextInputTest.test.ts.snap @@ -7,6 +7,8 @@ exports[`LegacyTextInputTest Click on TextInput to focus 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "onFocus +", + "TextRangePattern.GetText": "onFocus ", }, "Component Tree": { @@ -32,6 +34,9 @@ exports[`LegacyTextInputTest Click on multiline TextInput to move focus away fro "LocalizedControlType": "text", "Name": "onBlur onFocus +", + "TextRangePattern.GetText": "onBlur +onFocus ", }, "Component Tree": { @@ -98,6 +103,50 @@ onKeyPress key: a onFocus onBlur onFocus +", + "TextRangePattern.GetText": "onChange text: a +onSelectionChange range: 1,1 +onKeyPress key: a +onChange text: +onSelectionChange range: 0,0 +onFocus +onBlur +onSubmitEditing text: abc +onChange text: abc +onSelectionChange range: 3,3 +onKeyPress key: c +onChange text: ab +onSelectionChange range: 2,2 +onKeyPress key: b +onChange text: a +onSelectionChange range: 1,1 +onKeyPress key: a +onChange text: +onSelectionChange range: 0,0 +onChange text: def +onSelectionChange range: 3,3 +onKeyPress key: f +onChange text: de +onSelectionChange range: 2,2 +onKeyPress key: e +onChange text: d +onSelectionChange range: 1,1 +onKeyPress key: d +onChange text: +onSelectionChange range: 0,0 +onChange text: abc +onSelectionChange range: 3,3 +onKeyPress key: c +onChange text: ab +onSelectionChange range: 2,2 +onKeyPress key: b +onChange text: a +onChange text: a +onSelectionChange range: 1,1 +onKeyPress key: a +onFocus +onBlur +onFocus ", }, "Component Tree": { @@ -134,6 +183,20 @@ onKeyPress key: a onFocus onBlur onFocus +", + "TextRangePattern.GetText": "onChange text: abc +onSelectionChange range: 3,3 +onKeyPress key: c +onChange text: ab +onSelectionChange range: 2,2 +onKeyPress key: b +onChange text: a +onChange text: a +onSelectionChange range: 1,1 +onKeyPress key: a +onFocus +onBlur +onFocus ", }, "Component Tree": { @@ -193,6 +256,43 @@ onKeyPress key: a onFocus onBlur onFocus +", + "TextRangePattern.GetText": "onSubmitEditing text: abc +onChange text: abc +onSelectionChange range: 3,3 +onKeyPress key: c +onChange text: ab +onSelectionChange range: 2,2 +onKeyPress key: b +onChange text: a +onSelectionChange range: 1,1 +onKeyPress key: a +onChange text: +onSelectionChange range: 0,0 +onChange text: def +onSelectionChange range: 3,3 +onKeyPress key: f +onChange text: de +onSelectionChange range: 2,2 +onKeyPress key: e +onChange text: d +onSelectionChange range: 1,1 +onKeyPress key: d +onChange text: +onSelectionChange range: 0,0 +onChange text: abc +onSelectionChange range: 3,3 +onKeyPress key: c +onChange text: ab +onSelectionChange range: 2,2 +onKeyPress key: b +onChange text: a +onChange text: a +onSelectionChange range: 1,1 +onKeyPress key: a +onFocus +onBlur +onFocus ", }, "Component Tree": { diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/PressableComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/PressableComponentTest.test.ts.snap index 453352c323f..70213d9d735 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/PressableComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/PressableComponentTest.test.ts.snap @@ -20,6 +20,7 @@ exports[`Pressable Tests Pressables can be defined as a set using accessibilityP "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable 1 of 3", + "TextRangePattern.GetText": "Pressable 1 of 3", }, ], }, @@ -37,6 +38,7 @@ exports[`Pressable Tests Pressables can be defined as a set using accessibilityP "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable 2 of 3", + "TextRangePattern.GetText": "Pressable 2 of 3", }, ], }, @@ -54,6 +56,7 @@ exports[`Pressable Tests Pressables can be defined as a set using accessibilityP "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable 3 of 3", + "TextRangePattern.GetText": "Pressable 3 of 3", }, ], }, @@ -199,6 +202,7 @@ exports[`Pressable Tests Pressables can be disabled, disabled = {false} 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Enabled Pressable", + "TextRangePattern.GetText": "Enabled Pressable", }, ], }, @@ -251,6 +255,7 @@ exports[`Pressable Tests Pressables can be disabled, disabled = {true} 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Disabled Pressable", + "TextRangePattern.GetText": "Disabled Pressable", }, ], }, @@ -305,6 +310,7 @@ exports[`Pressable Tests Pressables can change style when pressed 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Me", + "TextRangePattern.GetText": "Press Me", }, ], }, @@ -354,6 +360,7 @@ exports[`Pressable Tests Pressables can change text on press/rest, state rest 1` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Me", + "TextRangePattern.GetText": "Press Me", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -377,6 +384,7 @@ exports[`Pressable Tests Pressables can change text on press/rest, state rest 2` "ControlType": 50020, "LocalizedControlType": "text", "Name": "onPress", + "TextRangePattern.GetText": "onPress", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -406,6 +414,7 @@ exports[`Pressable Tests Pressables can have advanced borders 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Outside This View", + "TextRangePattern.GetText": "Press Outside This View", }, ], }, @@ -461,6 +470,7 @@ exports[`Pressable Tests Pressables can have delayed event handlers 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Me", + "TextRangePattern.GetText": "Press Me", }, ], }, @@ -511,12 +521,14 @@ exports[`Pressable Tests Pressables can have delayed event handlers 2`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "pressOut", + "TextRangePattern.GetText": "pressOut", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "pressIn", + "TextRangePattern.GetText": "pressIn", }, ], }, @@ -630,6 +642,7 @@ exports[`Pressable Tests Pressables can have event handlers 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Me", + "TextRangePattern.GetText": "Press Me", }, ], }, @@ -681,24 +694,28 @@ exports[`Pressable Tests Pressables can have event handlers 2`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "pressOut", + "TextRangePattern.GetText": "pressOut", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "press", + "TextRangePattern.GetText": "press", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "pressIn", + "TextRangePattern.GetText": "pressIn", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "hover in", + "TextRangePattern.GetText": "hover in", }, ], }, @@ -842,6 +859,7 @@ exports[`Pressable Tests Pressables can have hit slop functionality 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Outside This View", + "TextRangePattern.GetText": "Press Outside This View", }, ], }, @@ -1246,6 +1264,7 @@ exports[`Pressable Tests Pressables can have their accessibility and keyboard fo "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable with accessible=true and focusable=true", + "TextRangePattern.GetText": "Pressable with accessible=true and focusable=true", }, ], }, @@ -1254,6 +1273,7 @@ exports[`Pressable Tests Pressables can have their accessibility and keyboard fo "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable with accessible=false", + "TextRangePattern.GetText": "Pressable with accessible=false", }, { "AutomationId": "", @@ -1265,6 +1285,7 @@ exports[`Pressable Tests Pressables can have their accessibility and keyboard fo "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable with focusable=false", + "TextRangePattern.GetText": "Pressable with focusable=false", }, ], }, @@ -1273,6 +1294,7 @@ exports[`Pressable Tests Pressables can have their accessibility and keyboard fo "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable with accessible=false and focusable=false", + "TextRangePattern.GetText": "Pressable with accessible=false and focusable=false", }, ], }, @@ -1452,6 +1474,7 @@ exports[`Pressable Tests Pressables can have tooltips 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Pressable with ToolTip "Pressable"", + "TextRangePattern.GetText": "Pressable with ToolTip "Pressable"", }, ], }, @@ -1502,6 +1525,7 @@ exports[`Pressable Tests Pressables can hide their backface 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "View #1, front is visible, back is hidden.", + "TextRangePattern.GetText": "View #1, front is visible, back is hidden.", }, { "AutomationId": "", @@ -1514,6 +1538,7 @@ exports[`Pressable Tests Pressables can hide their backface 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Front", + "TextRangePattern.GetText": "Front", }, ], }, @@ -1528,6 +1553,7 @@ exports[`Pressable Tests Pressables can hide their backface 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Back (You should not see this)", + "TextRangePattern.GetText": "Back (You should not see this)", }, ], }, @@ -1536,6 +1562,7 @@ exports[`Pressable Tests Pressables can hide their backface 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "View #2, front is hidden, back is visible.", + "TextRangePattern.GetText": "View #2, front is hidden, back is visible.", }, { "AutomationId": "", @@ -1548,6 +1575,7 @@ exports[`Pressable Tests Pressables can hide their backface 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Front (You should not see this)", + "TextRangePattern.GetText": "Front (You should not see this)", }, ], }, @@ -1562,6 +1590,7 @@ exports[`Pressable Tests Pressables can hide their backface 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Back", + "TextRangePattern.GetText": "Back", }, ], }, @@ -1785,6 +1814,7 @@ exports[`Pressable Tests Text can have pressable behavior 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Text has built-in onPress handling", + "TextRangePattern.GetText": "Text has built-in onPress handling", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -1808,6 +1838,7 @@ exports[`Pressable Tests Text can have pressable behavior 2`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "2x text onPress", + "TextRangePattern.GetText": "2x text onPress", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/ScrollViewComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/ScrollViewComponentTest.test.ts.snap index a7ba4d2a645..f3bb0cfe118 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/ScrollViewComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/ScrollViewComponentTest.test.ts.snap @@ -13,6 +13,7 @@ exports[`ScrollView Tests ScrollView has scrollTo method, scroll to bottom butto "ControlType": 50020, "LocalizedControlType": "text", "Name": "Scroll to bottom", + "TextRangePattern.GetText": "Scroll to bottom", }, ], }, @@ -68,6 +69,7 @@ exports[`ScrollView Tests ScrollView has scrollTo method, scroll to end button 1 "ControlType": 50020, "LocalizedControlType": "text", "Name": "Scroll to end", + "TextRangePattern.GetText": "Scroll to end", }, ], }, @@ -123,6 +125,7 @@ exports[`ScrollView Tests ScrollView has scrollTo method, scroll to start button "ControlType": 50020, "LocalizedControlType": "text", "Name": "Scroll to start", + "TextRangePattern.GetText": "Scroll to start", }, ], }, @@ -178,6 +181,7 @@ exports[`ScrollView Tests ScrollView has scrollTo method, scroll to top button 1 "ControlType": 50020, "LocalizedControlType": "text", "Name": "Scroll to top", + "TextRangePattern.GetText": "Scroll to top", }, ], }, @@ -233,6 +237,7 @@ exports[`ScrollView Tests ScrollViews has flash scroll indicators 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Flash scroll indicators", + "TextRangePattern.GetText": "Flash scroll indicators", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/TextComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/TextComponentTest.test.ts.snap index 7be9511d76c..d136260c112 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/TextComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/TextComponentTest.test.ts.snap @@ -7,6 +7,7 @@ exports[`Text Tests Padding can be added to Text 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text is indented by 10px padding on all sides.", + "TextRangePattern.GetText": "This text is indented by 10px padding on all sides.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -30,6 +31,7 @@ exports[`Text Tests Text can be restricted to one line 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Maximum of one line no matter now much I write here. If I keep writing it'll just truncate after one line", + "TextRangePattern.GetText": "Maximum of one line no matter now much I write here. If I keep writing it'll just truncate after one line", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -53,6 +55,7 @@ exports[`Text Tests Text can be selectable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text is selectable if you click-and-hold, and will offer the native Android selection menus.", + "TextRangePattern.GetText": "This text is selectable if you click-and-hold, and will offer the native Android selection menus.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -76,6 +79,7 @@ exports[`Text Tests Text can have a color 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Red color", + "TextRangePattern.GetText": "Red color", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -99,6 +103,7 @@ exports[`Text Tests Text can have a customized selection color 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text will have a orange highlight on selection.", + "TextRangePattern.GetText": "This text will have a orange highlight on selection.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -122,6 +127,7 @@ exports[`Text Tests Text can have a size 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Size 23", + "TextRangePattern.GetText": "Size 23", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -151,18 +157,21 @@ exports[`Text Tests Text can have advanced borders 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text has customized borders.", + "TextRangePattern.GetText": "This text has customized borders.", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text has customized borders.", + "TextRangePattern.GetText": "This text has customized borders.", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text has customized borders.", + "TextRangePattern.GetText": "This text has customized borders.", }, ], }, @@ -463,6 +472,7 @@ exports[`Text Tests Text can have an outer color 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "(Normal text,(R)red(G)green(B)blue(C)cyan(M)magenta(Y)yellow(K)black(and bold(and tiny bold italic blue(and tiny normal blue))))", + "TextRangePattern.GetText": "(Normal text,(R)red(G)green(B)blue(C)cyan(M)magenta(Y)yellow(K)black(and bold(and tiny bold italic blue(and tiny normal blue))))", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -492,6 +502,7 @@ exports[`Text Tests Text can have borders 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Sample bordered text with default styling.", + "TextRangePattern.GetText": "Sample bordered text with default styling.", }, { "AutomationId": "", @@ -499,6 +510,9 @@ exports[`Text Tests Text can have borders 1`] = ` "LocalizedControlType": "text", "Name": "Some more bordered text + a tad of CSS. 1st nested - border specifcied but ignored. +2nd Inside text!", + "TextRangePattern.GetText": "Some more bordered text + a tad of CSS. +1st nested - border specifcied but ignored. 2nd Inside text!", }, { @@ -506,6 +520,7 @@ exports[`Text Tests Text can have borders 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This text is outlined and laid out within the normal text run, so will wrap etc as normal text.", + "TextRangePattern.GetText": "This text is outlined and laid out within the normal text run, so will wrap etc as normal text.", }, ], }, @@ -668,6 +683,7 @@ exports[`Text Tests Text can have decoration lines: Solid Line Through 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Solid line-through", + "TextRangePattern.GetText": "Solid line-through", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -691,6 +707,7 @@ exports[`Text Tests Text can have decoration lines: Underline 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Solid underline", + "TextRangePattern.GetText": "Solid underline", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -714,6 +731,7 @@ exports[`Text Tests Text can have shadows 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Demo text shadow", + "TextRangePattern.GetText": "Demo text shadow", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -737,6 +755,7 @@ exports[`Text Tests Text can wrap 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "The text should wrap if it goes on multiple lines. See, this is going to the next line.", + "TextRangePattern.GetText": "The text should wrap if it goes on multiple lines. See, this is going to the next line.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/TextInputComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/TextInputComponentTest.test.ts.snap index 69bc98d03c0..aaa4e2766d9 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/TextInputComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/TextInputComponentTest.test.ts.snap @@ -7,6 +7,8 @@ exports[`TextInput Tests Multi-line TextInputs can enable text selection (Impera "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "multiline text selection +can also be changed imperatively", "ValuePattern.Value": "multiline text selection can also be changed imperatively", }, @@ -84,6 +86,8 @@ exports[`TextInput Tests Multi-line TextInputs can enable text selection 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "multiline text selection +can also be changed", "ValuePattern.Value": "multiline text selection can also be changed", }, @@ -161,6 +165,7 @@ exports[`TextInput Tests Single-line TextInputs can enable text selection (Imper "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "text selection can be changed imperatively", "ValuePattern.Value": "text selection can be changed imperatively", }, "Component Tree": { @@ -237,6 +242,7 @@ exports[`TextInput Tests Single-line TextInputs can enable text selection 1`] = "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "text selection can be changed", "ValuePattern.Value": "text selection can be changed", }, "Component Tree": { @@ -315,6 +321,7 @@ exports[`TextInput Tests Text have cursorColor 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "cursorColor={"green"}", + "TextRangePattern.GetText": "Hello World", "ValuePattern.Value": "Hello World", }, "Component Tree": { @@ -543,6 +550,7 @@ exports[`TextInput Tests TextInputs can autocomplete, address country 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "postal-address-country", + "TextRangePattern.GetText": "postal-address-country", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -620,6 +628,7 @@ exports[`TextInput Tests TextInputs can autocomplete, country 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "country", + "TextRangePattern.GetText": "country", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -697,6 +706,7 @@ exports[`TextInput Tests TextInputs can autocomplete, one-time-code 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "one-time-code", + "TextRangePattern.GetText": "one-time-code", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -774,6 +784,7 @@ exports[`TextInput Tests TextInputs can autocomplete, sms-otp 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "sms-otp", + "TextRangePattern.GetText": "sms-otp", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -849,6 +860,7 @@ exports[`TextInput Tests TextInputs can autogrow 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "small small small small small small", "ValuePattern.Value": "small small small small small small", }, "Component Tree": { @@ -934,6 +946,7 @@ exports[`TextInput Tests TextInputs can be defined as a set using accessibilityP "Name": "TextInput 1 in Set of 3", "PositionInSet": 1, "SizeofSet": 3, + "TextRangePattern.GetText": "TextInput 1 in Set of 3", }, { "AutomationId": "", @@ -945,6 +958,7 @@ exports[`TextInput Tests TextInputs can be defined as a set using accessibilityP "Name": "TextInput 2 in Set of 3", "PositionInSet": 2, "SizeofSet": 3, + "TextRangePattern.GetText": "TextInput 2 in Set of 3", }, { "AutomationId": "", @@ -956,6 +970,7 @@ exports[`TextInput Tests TextInputs can be defined as a set using accessibilityP "Name": "TextInput 3 in Set of 3", "PositionInSet": 3, "SizeofSet": 3, + "TextRangePattern.GetText": "TextInput 3 in Set of 3", }, ], }, @@ -1191,6 +1206,7 @@ exports[`TextInput Tests TextInputs can be editable 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "editable text input using editable prop", + "TextRangePattern.GetText": "editable text input using editable prop", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -1266,6 +1282,7 @@ exports[`TextInput Tests TextInputs can be multiline, bottomright alignment 1`] "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "multiline with children, aligned bottom-right", "ValuePattern.Value": "multiline with children, aligned bottom-right", }, "Component Tree": { @@ -1344,6 +1361,7 @@ exports[`TextInput Tests TextInputs can be multiline, center alignment 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "multiline, aligned center", + "TextRangePattern.GetText": "multiline, aligned center", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -1421,6 +1439,7 @@ exports[`TextInput Tests TextInputs can be multiline, topleft alignment 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "multiline, aligned top-left", + "TextRangePattern.GetText": "multiline, aligned top-left", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -1496,6 +1515,7 @@ exports[`TextInput Tests TextInputs can be set to not editable 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Can't touch this! (>'-')> ^(' - ')^ <('-'<) (>'-')> ^(' - ')^", "ValuePattern.Value": "Can't touch this! (>'-')> ^(' - ')^ <('-'<) (>'-')> ^(' - ')^", }, "Component Tree": { @@ -1574,6 +1594,7 @@ exports[`TextInput Tests TextInputs can be set to not editable 2 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "uneditable text input using editable prop", + "TextRangePattern.GetText": "uneditable text input using editable prop", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -1951,6 +1972,7 @@ exports[`TextInput Tests TextInputs can enable spellcheck 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Type text to test spell check functionality.", + "TextRangePattern.GetText": "Type text to test spell check functionality.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -2026,6 +2048,7 @@ exports[`TextInput Tests TextInputs can have a background color 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -2102,6 +2125,7 @@ exports[`TextInput Tests TextInputs can have a color 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -2178,6 +2202,7 @@ exports[`TextInput Tests TextInputs can have a font family 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -2254,6 +2279,7 @@ exports[`TextInput Tests TextInputs can have a font size 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -2330,6 +2356,7 @@ exports[`TextInput Tests TextInputs can have a font style 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -2406,6 +2433,7 @@ exports[`TextInput Tests TextInputs can have a font weight 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -2482,6 +2510,7 @@ exports[`TextInput Tests TextInputs can have attributed text 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Hello ", "ValuePattern.Value": "Hello ", }, "Component Tree": { @@ -2560,6 +2589,7 @@ exports[`TextInput Tests TextInputs can have caretHidden 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "caretHidden={true}", + "TextRangePattern.GetText": "Hello World", "ValuePattern.Value": "Hello World", }, "Component Tree": { @@ -2638,6 +2668,7 @@ exports[`TextInput Tests TextInputs can have custom return key label, Compile 1` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyLabel: Compile", + "TextRangePattern.GetText": "returnKeyLabel: Compile", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -2715,6 +2746,7 @@ exports[`TextInput Tests TextInputs can have custom return key label, React Nati "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyLabel: React Native", + "TextRangePattern.GetText": "returnKeyLabel: React Native", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -2792,6 +2824,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, done 1`] = "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: done", + "TextRangePattern.GetText": "returnKeyType: done", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -2869,6 +2902,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, go 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: go", + "TextRangePattern.GetText": "returnKeyType: go", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -2946,6 +2980,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, next 1`] = "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: next", + "TextRangePattern.GetText": "returnKeyType: next", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3023,6 +3058,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, none 1`] = "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: none", + "TextRangePattern.GetText": "returnKeyType: none", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3100,6 +3136,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, previous 1` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: previous", + "TextRangePattern.GetText": "returnKeyType: previous", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3177,6 +3214,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, search 1`] "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: search", + "TextRangePattern.GetText": "returnKeyType: search", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3254,6 +3292,7 @@ exports[`TextInput Tests TextInputs can have custom return key type, send 1`] = "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "returnKeyType: send", + "TextRangePattern.GetText": "returnKeyType: send", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3331,6 +3370,7 @@ exports[`TextInput Tests TextInputs can have customer letter spacing, spacing=-1 "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "letterSpacing = -1", + "TextRangePattern.GetText": "letterSpacing = -1", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3408,6 +3448,7 @@ exports[`TextInput Tests TextInputs can have customer letter spacing, spacing=0 "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "letterSpacing = 0", + "TextRangePattern.GetText": "letterSpacing = 0", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3485,6 +3526,7 @@ exports[`TextInput Tests TextInputs can have customer letter spacing, spacing=2 "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "letterSpacing = 2", + "TextRangePattern.GetText": "letterSpacing = 2", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3562,6 +3604,7 @@ exports[`TextInput Tests TextInputs can have customer letter spacing, spacing=9 "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "letterSpacing = 9", + "TextRangePattern.GetText": "letterSpacing = 9", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3733,6 +3776,7 @@ exports[`TextInput Tests TextInputs can have customized letter spacing 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -3809,6 +3853,8 @@ exports[`TextInput Tests TextInputs can have customized line height 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Hel +", "ValuePattern.Value": "Hel ", }, @@ -3888,6 +3934,7 @@ exports[`TextInput Tests TextInputs can have inline images 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "This has drawableLeft set", + "TextRangePattern.GetText": "This has drawableLeft set", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -3965,6 +4012,7 @@ exports[`TextInput Tests TextInputs can have inline images, drawable props not s "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "This does not have drawable props set", + "TextRangePattern.GetText": "This does not have drawable props set", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4042,6 +4090,7 @@ exports[`TextInput Tests TextInputs can have inline images, drawableLeft and dra "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "This has drawableLeft and drawablePadding set", + "TextRangePattern.GetText": "This has drawableLeft and drawablePadding set", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4119,6 +4168,7 @@ exports[`TextInput Tests TextInputs can have shadows 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "shadowColor: purple", + "TextRangePattern.GetText": "shadowColor: purple", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4194,6 +4244,7 @@ exports[`TextInput Tests TextInputs can have text decoration lines 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -4270,6 +4321,7 @@ exports[`TextInput Tests TextInputs can have text shadows 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "He", "ValuePattern.Value": "He", }, "Component Tree": { @@ -4348,6 +4400,7 @@ exports[`TextInput Tests TextInputs can propagate events 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Click inside the box to observe events being fired.", + "TextRangePattern.GetText": "Click inside the box to observe events being fired.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4425,6 +4478,7 @@ exports[`TextInput Tests TextInputs can register press events 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Click inside the box to observe events being fired.", + "TextRangePattern.GetText": "Click inside the box to observe events being fired.", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4727,6 +4781,7 @@ exports[`TextInput Tests TextInputs can set their readOnly prop to false 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "editable text input using readOnly prop", + "TextRangePattern.GetText": "editable text input using readOnly prop", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4804,6 +4859,7 @@ exports[`TextInput Tests TextInputs can set their readOnly prop to true 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "uneditable text input using readOnly prop", + "TextRangePattern.GetText": "uneditable text input using readOnly prop", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -4954,6 +5010,7 @@ exports[`TextInput Tests TextInputs have a custom background color 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Same BackgroundColor as View ", "ValuePattern.Value": "Same BackgroundColor as View ", }, "Component Tree": { @@ -5030,6 +5087,7 @@ exports[`TextInput Tests TextInputs have a custom highlight color 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Selection Color is red", "ValuePattern.Value": "Selection Color is red", }, "Component Tree": { @@ -5108,6 +5166,7 @@ exports[`TextInput Tests TextInputs have a custom placeholder text color 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Red placeholder text color", + "TextRangePattern.GetText": "Red placeholder text color", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5183,6 +5242,7 @@ exports[`TextInput Tests TextInputs have a custom text color 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Green Text", "ValuePattern.Value": "Green Text", }, "Component Tree": { @@ -5261,6 +5321,7 @@ exports[`TextInput Tests TextInputs have a custom underline color 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Blue underline color", + "TextRangePattern.GetText": "Blue underline color", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5338,6 +5399,7 @@ exports[`TextInput Tests TextInputs have a default placeholder text color 1`] = "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Default placeholder text color", + "TextRangePattern.GetText": "Default placeholder text color", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5413,6 +5475,7 @@ exports[`TextInput Tests TextInputs have a default text color 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Default color text", "ValuePattern.Value": "Default color text", }, "Component Tree": { @@ -5491,6 +5554,7 @@ exports[`TextInput Tests TextInputs have a default underline color 1`] = ` "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "Default underline color", + "TextRangePattern.GetText": "Default underline color", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5566,6 +5630,7 @@ exports[`TextInput Tests TextInputs support secure entry 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "iloveturtles", "ValuePattern.Value": "iloveturtles", }, "Component Tree": { @@ -5644,6 +5709,7 @@ exports[`TextInput Tests TextInputs support secure entry, with placeholder text "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "color is supported too", + "TextRangePattern.GetText": "color is supported too", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5724,6 +5790,7 @@ exports[`TextInput Tests TextInputs which have a searchbox role should also supp "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Search", "ValuePattern.Value": "Search", }, ], @@ -5824,6 +5891,7 @@ exports[`TextInput Tests TextInputs with set height and padding from theme 1`] = "IsKeyboardFocusable": true, "LocalizedControlType": "edit", "Name": "If you set height, beware of padding set from themes", + "TextRangePattern.GetText": "If you set height, beware of padding set from themes", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView", @@ -5899,6 +5967,7 @@ exports[`TextInput Tests Uncontrolled TextInput 1`] = ` "ControlType": 50004, "IsKeyboardFocusable": true, "LocalizedControlType": "edit", + "TextRangePattern.GetText": "Hello World!", "ValuePattern.Value": "Hello World!", }, "Component Tree": { diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/TouchableComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/TouchableComponentTest.test.ts.snap index 3773900dcbf..2ba5443b459 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/TouchableComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/TouchableComponentTest.test.ts.snap @@ -7,6 +7,7 @@ exports[`Touchable Tests Text components can be tappable 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Text has built-in onPress handling", + "TextRangePattern.GetText": "Text has built-in onPress handling", }, "Component Tree": { "Type": "Microsoft.ReactNative.Composition.ParagraphComponentView", @@ -36,6 +37,7 @@ exports[`Touchable Tests TouchableWithoutFeedback components should not give vis "ControlType": 50020, "LocalizedControlType": "text", "Name": "Tap Here For No Feedback!", + "TextRangePattern.GetText": "Tap Here For No Feedback!", }, ], }, @@ -94,6 +96,7 @@ exports[`Touchable Tests Touchables can be defined in a set using accessibilityP "ControlType": 50020, "LocalizedControlType": "text", "Name": "Touchable Highlight (Control 1 in Set of 3)", + "TextRangePattern.GetText": "Touchable Highlight (Control 1 in Set of 3)", }, ], }, @@ -111,6 +114,7 @@ exports[`Touchable Tests Touchables can be defined in a set using accessibilityP "ControlType": 50020, "LocalizedControlType": "text", "Name": "Touchable Opacity (Control 2 in Set of 3)", + "TextRangePattern.GetText": "Touchable Opacity (Control 2 in Set of 3)", }, ], }, @@ -123,6 +127,7 @@ exports[`Touchable Tests Touchables can be defined in a set using accessibilityP "Name": "TouchableWithoutFeedback (Control 3 in Set of 3)", "PositionInSet": 3, "SizeofSet": 3, + "TextRangePattern.GetText": "TouchableWithoutFeedback (Control 3 in Set of 3)", }, ], }, @@ -246,6 +251,7 @@ exports[`Touchable Tests Touchables can contain a Text component 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Tap Here For Custom Highlight!", + "TextRangePattern.GetText": "Tap Here For Custom Highlight!", }, ], }, @@ -347,6 +353,7 @@ exports[`Touchable Tests Touchables can delay events 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Me", + "TextRangePattern.GetText": "Press Me", }, ], }, @@ -398,6 +405,7 @@ exports[`Touchable Tests Touchables can enable a hit slop region 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Outside This View", + "TextRangePattern.GetText": "Press Outside This View", }, ], }, @@ -455,6 +463,7 @@ exports[`Touchable Tests Touchables can register feedback events 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press Me", + "TextRangePattern.GetText": "Press Me", }, ], }, diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/ViewComponentTest.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/ViewComponentTest.test.ts.snap index 5582dcde123..3d3eb0fd2c7 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/ViewComponentTest.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/ViewComponentTest.test.ts.snap @@ -41,6 +41,7 @@ exports[`View Tests Views can have a nativeid 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "A View with a nativeID "native-id-view"", + "TextRangePattern.GetText": "A View with a nativeID "native-id-view"", }, ], }, @@ -93,30 +94,35 @@ exports[`View Tests Views can have a z-index 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "ZIndex -1", + "TextRangePattern.GetText": "ZIndex -1", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Tap to flip sorting order", + "TextRangePattern.GetText": "Tap to flip sorting order", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "ZIndex 0", + "TextRangePattern.GetText": "ZIndex 0", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "ZIndex 1", + "TextRangePattern.GetText": "ZIndex 1", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "ZIndex 2", + "TextRangePattern.GetText": "ZIndex 2", }, ], }, @@ -328,6 +334,7 @@ exports[`View Tests Views can have aria-labels 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Blue background", + "TextRangePattern.GetText": "Blue background", }, ], }, @@ -384,36 +391,42 @@ exports[`View Tests Views can have backface visibility 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "View #1, front is visible, back is hidden.", + "TextRangePattern.GetText": "View #1, front is visible, back is hidden.", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Front", + "TextRangePattern.GetText": "Front", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Back (You should not see this)", + "TextRangePattern.GetText": "Back (You should not see this)", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "View #2, front is hidden, back is visible.", + "TextRangePattern.GetText": "View #2, front is hidden, back is visible.", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Front (You should not see this)", + "TextRangePattern.GetText": "Front (You should not see this)", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Back", + "TextRangePattern.GetText": "Back", }, ], }, @@ -630,6 +643,7 @@ exports[`View Tests Views can have background color 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Blue background", + "TextRangePattern.GetText": "Blue background", }, ], }, @@ -686,12 +700,14 @@ exports[`View Tests Views can have border styles 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Dashed border style", + "TextRangePattern.GetText": "Dashed border style", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Dotted border style", + "TextRangePattern.GetText": "Dotted border style", }, ], }, @@ -875,6 +891,7 @@ exports[`View Tests Views can have borders 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "5px blue border", + "TextRangePattern.GetText": "5px blue border", }, ], }, @@ -975,12 +992,14 @@ exports[`View Tests Views can have customized accessibility 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "A View with accessibility values.", + "TextRangePattern.GetText": "A View with accessibility values.", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Current Number of Accessibility Taps: 0", + "TextRangePattern.GetText": "Current Number of Accessibility Taps: 0", }, { "AutomationId": "", @@ -992,6 +1011,7 @@ exports[`View Tests Views can have customized accessibility 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This sub-view should not have an accessibility value. It's control type does not support the value pattern.", + "TextRangePattern.GetText": "This sub-view should not have an accessibility value. It's control type does not support the value pattern.", }, ], }, @@ -1114,42 +1134,49 @@ exports[`View Tests Views can have customized opacity 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 0", + "TextRangePattern.GetText": "Opacity 0", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 0.1", + "TextRangePattern.GetText": "Opacity 0.1", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 0.3", + "TextRangePattern.GetText": "Opacity 0.3", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 0.5", + "TextRangePattern.GetText": "Opacity 0.5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 0.7", + "TextRangePattern.GetText": "Opacity 0.7", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 0.9", + "TextRangePattern.GetText": "Opacity 0.9", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Opacity 1", + "TextRangePattern.GetText": "Opacity 1", }, ], }, @@ -1436,24 +1463,28 @@ exports[`View Tests Views can have customized pasdding and margins 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "5px padding", + "TextRangePattern.GetText": "5px padding", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "5px margin", + "TextRangePattern.GetText": "5px margin", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "5px margin and padding,", + "TextRangePattern.GetText": "5px margin and padding,", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "widthAutonomous=true", + "TextRangePattern.GetText": "widthAutonomous=true", }, ], }, @@ -1780,6 +1811,7 @@ exports[`View Tests Views can have display: none 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Press to toggle \`display: none\`", + "TextRangePattern.GetText": "Press to toggle \`display: none\`", }, ], }, @@ -2118,42 +2150,49 @@ exports[`View Tests Views can have insets 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "inset 5", + "TextRangePattern.GetText": "inset 5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "insetBlock 5", + "TextRangePattern.GetText": "insetBlock 5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "insetBlockEnd 5", + "TextRangePattern.GetText": "insetBlockEnd 5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "insetBlockStart 5", + "TextRangePattern.GetText": "insetBlockStart 5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "insetInline 5", + "TextRangePattern.GetText": "insetInline 5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "insetInlineEnd 5", + "TextRangePattern.GetText": "insetInlineEnd 5", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "insetInlineStart 5", + "TextRangePattern.GetText": "insetInlineStart 5", }, ], }, @@ -2847,18 +2886,21 @@ exports[`View Tests Views can have logical border colors 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "borderBlockColor orange", + "TextRangePattern.GetText": "borderBlockColor orange", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "borderBlockStartColor purple", + "TextRangePattern.GetText": "borderBlockStartColor purple", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "borderBlockEndColor green", + "TextRangePattern.GetText": "borderBlockEndColor green", }, ], }, @@ -3175,18 +3217,21 @@ exports[`View Tests Views can have offscreen alpha compositing 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "Blobs", + "TextRangePattern.GetText": "Blobs", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Same blobs, but their shared container have 0.5 opacity", + "TextRangePattern.GetText": "Same blobs, but their shared container have 0.5 opacity", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "Tap to deactivate needsOffscreenAlphaCompositing", + "TextRangePattern.GetText": "Tap to deactivate needsOffscreenAlphaCompositing", }, ], }, @@ -3373,18 +3418,21 @@ exports[`View Tests Views can have overflow 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "undefined", + "TextRangePattern.GetText": "undefined", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "hidden", + "TextRangePattern.GetText": "hidden", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "visible", + "TextRangePattern.GetText": "visible", }, ], }, @@ -5183,18 +5231,21 @@ exports[`View Tests Views can have tooltips 1`] = ` "ControlType": 50020, "LocalizedControlType": "text", "Name": "This Parent View has tooltip "Parent View"", + "TextRangePattern.GetText": "This Parent View has tooltip "Parent View"", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "This view has tooltip "Child View 1"", + "TextRangePattern.GetText": "This view has tooltip "Child View 1"", }, { "AutomationId": "", "ControlType": 50020, "LocalizedControlType": "text", "Name": "This view has tooltip "Child View 2"", + "TextRangePattern.GetText": "This view has tooltip "Child View 2"", }, ], }, diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp index 9cb662862c0..033558a7715 100644 --- a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp @@ -363,6 +363,7 @@ void DumpUIAPatternInfo(IUIAutomationElement *pTarget, const winrt::Windows::Dat BOOL isSelected; BOOL multipleSelection; BOOL selectionRequired; + BSTR text = nullptr; // Dump IValueProvider Information IValueProvider *valuePattern; @@ -451,6 +452,21 @@ void DumpUIAPatternInfo(IUIAutomationElement *pTarget, const winrt::Windows::Dat selectionPattern->Release(); } + // Dump ITextRangeProvider Information + winrt::com_ptr textPattern; + hr = pTarget->GetCurrentPattern(UIA_TextPatternId, reinterpret_cast(textPattern.put())); + if (SUCCEEDED(hr) && textPattern) { + winrt::com_ptr textRangePattern; + hr = textPattern->get_DocumentRange(textRangePattern.put()); + if (SUCCEEDED(hr) && textRangePattern) { + textRangePattern->GetText(20, &text); + if (SUCCEEDED(hr)) { + InsertStringValueIfNotEmpty(result, L"TextRangePattern.GetText", text); + } + } + } + + ::SysFreeString(text); ::SysFreeString(value); } diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp index cd1fcf2c6e7..cc23955cedd 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "CompositionDynamicAutomationProvider.h" #include +#include +#include #include #include #include @@ -26,6 +28,13 @@ CompositionDynamicAutomationProvider::CompositionDynamicAutomationProvider( if (props->accessibilityState.has_value() && props->accessibilityState->selected.has_value()) { AddSelectionItemsToContainer(this); } + + if (strongView.try_as() || + strongView.try_as()) { + m_textProvider = winrt::make( + strongView.as(), this) + .try_as(); + } } #ifdef USE_EXPERIMENTAL_WINUI3 @@ -260,6 +269,17 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE AddRef(); } + if (patternId == UIA_TextPatternId && + (strongView.try_as() || + strongView.try_as())) { + m_textProvider.as().copy_to(pRetVal); + } + + if (patternId == UIA_TextPattern2Id && + strongView.try_as()) { + m_textProvider.as().copy_to(pRetVal); + } + return S_OK; } diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h index 564766cd3c3..d97550b9b72 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h @@ -91,6 +91,7 @@ class CompositionDynamicAutomationProvider : public winrt::implements< private: ::Microsoft::ReactNative::ReactTaggedView m_view; + winrt::com_ptr m_textProvider; std::vector> m_selectionItems; #ifdef USE_EXPERIMENTAL_WINUI3 // Non-null when this UIA node is the peer of a ContentIslandComponentView. diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp new file mode 100644 index 00000000000..ef997fe0ae4 --- /dev/null +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp @@ -0,0 +1,115 @@ +#include "pch.h" +#include +#include +#include +#include +#include "CompositionTextRangeProvider.h" +#include "RootComponentView.h" +#include "UiaHelpers.h" + +namespace winrt::Microsoft::ReactNative::implementation { + +CompositionTextProvider::CompositionTextProvider( + const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView, + CompositionDynamicAutomationProvider *parentProvider) noexcept + : m_view{componentView} { + m_parentProvider.copy_from(parentProvider); + EnsureTextRangeProvider(); +} + +void CompositionTextProvider::EnsureTextRangeProvider() { + auto strongView = m_view.view(); + + if (!strongView) + return; + + if (!m_textRangeProvider) { + m_textRangeProvider = + winrt::make( + strongView.as(), m_parentProvider.get()) + .try_as(); + } +} + +HRESULT __stdcall CompositionTextProvider::get_DocumentRange(ITextRangeProvider **pRetVal) { + if (pRetVal == nullptr) + return E_POINTER; + auto strongView = m_view.view(); + + if (!strongView) + return UIA_E_ELEMENTNOTAVAILABLE; + + if (m_textRangeProvider == nullptr) + return UIA_E_ELEMENTNOTAVAILABLE; + + m_textRangeProvider.copy_to(pRetVal); + return S_OK; +} + +HRESULT __stdcall CompositionTextProvider::get_SupportedTextSelection(SupportedTextSelection *pRetVal) { + if (pRetVal == nullptr) + return E_POINTER; + auto strongView = m_view.view(); + + if (!strongView) + return UIA_E_ELEMENTNOTAVAILABLE; + + if (strongView.try_as()) { + *pRetVal = SupportedTextSelection_Single; + } else if ( + auto textView = + strongView.try_as()) { + auto props = std::static_pointer_cast(textView->props()); + if (props == nullptr) + return UIA_E_ELEMENTNOTAVAILABLE; + *pRetVal = props->isSelectable ? SupportedTextSelection_Single : SupportedTextSelection_None; + } else { + *pRetVal = SupportedTextSelection_None; + } + + return S_OK; +} + +HRESULT __stdcall CompositionTextProvider::GetSelection(SAFEARRAY **pRetVal) { + // no-op + *pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 0); + return S_OK; +} + +HRESULT __stdcall CompositionTextProvider::GetVisibleRanges(SAFEARRAY **pRetVal) { + *pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 1); + if (m_textRangeProvider == nullptr) + return UIA_E_ELEMENTNOTAVAILABLE; + LONG pos = 0; + return SafeArrayPutElement(*pRetVal, &pos, m_textRangeProvider.get()); +} + +HRESULT __stdcall CompositionTextProvider::RangeFromChild( + IRawElementProviderSimple *childElement, + ITextRangeProvider **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} + +HRESULT __stdcall CompositionTextProvider::RangeFromPoint(UiaPoint point, ITextRangeProvider **pRetVal) { + // no-op + if (m_textRangeProvider == nullptr) + return UIA_E_ELEMENTNOTAVAILABLE; + m_textRangeProvider.copy_to(pRetVal); + return S_OK; +} +HRESULT __stdcall CompositionTextProvider::GetCaretRange(BOOL *isActive, ITextRangeProvider **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} + +HRESULT __stdcall CompositionTextProvider::RangeFromAnnotation( + IRawElementProviderSimple *annotationElement, + ITextRangeProvider **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} +} // namespace winrt::Microsoft::ReactNative::implementation diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h new file mode 100644 index 00000000000..cb68ad7bfe9 --- /dev/null +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace winrt::Microsoft::ReactNative::implementation { + +class CompositionTextProvider : public winrt::implements { + public: + CompositionTextProvider( + const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView, + CompositionDynamicAutomationProvider *parentProvider) noexcept; + + // inherited via ITextProvider + virtual HRESULT __stdcall get_DocumentRange(ITextRangeProvider **pRetVal) override; + virtual HRESULT __stdcall get_SupportedTextSelection(SupportedTextSelection *pRetVal) override; + virtual HRESULT __stdcall GetSelection(SAFEARRAY **pRetVal) override; + virtual HRESULT __stdcall GetVisibleRanges(SAFEARRAY **pRetVal) override; + virtual HRESULT __stdcall RangeFromChild(IRawElementProviderSimple *childElement, ITextRangeProvider **pRetVal) + override; + virtual HRESULT __stdcall RangeFromPoint(UiaPoint point, ITextRangeProvider **pRetVal) override; + + // inherited via ITextProvider2 + virtual HRESULT __stdcall GetCaretRange(BOOL *isActive, ITextRangeProvider **pRetVal) override; + virtual HRESULT __stdcall RangeFromAnnotation( + IRawElementProviderSimple *annotationElement, + ITextRangeProvider **pRetVal) override; + + void EnsureTextRangeProvider(); + + private: + ::Microsoft::ReactNative::ReactTaggedView m_view; + winrt::com_ptr m_textRangeProvider; + winrt::com_ptr m_parentProvider; +}; + +} // namespace winrt::Microsoft::ReactNative::implementation diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp new file mode 100644 index 00000000000..1f69c84b3df --- /dev/null +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp @@ -0,0 +1,298 @@ +#include "pch.h" +#include "CompositionTextRangeProvider.h" +#include +#include +#include +#include +#include +#include "RootComponentView.h" +#include "UiaHelpers.h" + +namespace winrt::Microsoft::ReactNative::implementation { + +CompositionTextRangeProvider::CompositionTextRangeProvider( + const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView, + CompositionDynamicAutomationProvider *parentProvider) noexcept + : m_view{componentView} { + m_parentProvider.copy_from(parentProvider); +} + +HRESULT __stdcall CompositionTextRangeProvider::Clone(ITextRangeProvider **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::Compare(ITextRangeProvider *range, BOOL *pRetVal) { + // no-op + *pRetVal = false; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::CompareEndpoints( + TextPatternRangeEndpoint endpoint, + ITextRangeProvider *targetRange, + TextPatternRangeEndpoint targetEndpoint, + int *pRetVal) { + // no-op + *pRetVal = 0; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::ExpandToEnclosingUnit(TextUnit unit) { + // no-op + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::FindAttribute( + TEXTATTRIBUTEID attributeId, + VARIANT val, + BOOL backward, + ITextRangeProvider **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::FindText( + BSTR text, + BOOL backward, + BOOL ignoreCase, + ITextRangeProvider **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::GetAttributeValue(TEXTATTRIBUTEID attributeId, VARIANT *pRetVal) { + if (pRetVal == nullptr) + return E_POINTER; + auto strongView = m_view.view(); + + if (!strongView) + return UIA_E_ELEMENTNOTAVAILABLE; + + auto props = std::static_pointer_cast( + winrt::get_self(strongView)->props()); + + auto textinputProps = std::static_pointer_cast( + winrt::get_self(strongView)->props()); + + auto isTextInput = + strongView.try_as(); + + if (props == nullptr) + return UIA_E_ELEMENTNOTAVAILABLE; + + if (attributeId == UIA_BackgroundColorAttributeId) { + pRetVal->vt = VT_I4; + pRetVal->lVal = (*props->backgroundColor).AsColorRefWithAlpha(); + } else if (attributeId == UIA_CapStyleAttributeId) { + pRetVal->vt = VT_I4; + auto fontVariant = facebook::react::FontVariant::Default; + auto textTransform = facebook::react::TextTransform::None; + if (props->textAttributes.fontVariant.has_value()) { + fontVariant = props->textAttributes.fontVariant.value(); + } + if (props->textAttributes.textTransform.has_value()) { + textTransform = props->textAttributes.textTransform.value(); + } + if (fontVariant == facebook::react::FontVariant::SmallCaps) { + return CapStyle_SmallCap; + } else if (textTransform == facebook::react::TextTransform::Capitalize) { + return CapStyle_Titling; + } else if (textTransform == facebook::react::TextTransform::Lowercase) { + return CapStyle_None; + } else if (textTransform == facebook::react::TextTransform::Uppercase) { + return CapStyle_AllCap; + } + } else if (attributeId == UIA_FontNameAttributeId) { + pRetVal->vt = VT_BSTR; + auto fontName = props->textAttributes.fontFamily; + if (fontName.empty()) { + fontName = "Segoe UI"; + } + std::wstring wfontName(fontName.begin(), fontName.end()); + pRetVal->bstrVal = SysAllocString(wfontName.c_str()); + } else if (attributeId == UIA_FontSizeAttributeId) { + pRetVal->vt = VT_R8; + pRetVal->dblVal = props->textAttributes.fontSize; + } else if (attributeId == UIA_FontWeightAttributeId) { + if (props->textAttributes.fontWeight.has_value()) { + pRetVal->vt = VT_I4; + pRetVal->lVal = static_cast(props->textAttributes.fontWeight.value()); + } + } else if (attributeId == UIA_ForegroundColorAttributeId) { + pRetVal->vt = VT_I4; + pRetVal->lVal = (*props->textAttributes.foregroundColor).AsColorRefWithAlpha(); + } else if (attributeId == UIA_IsItalicAttributeId) { + pRetVal->vt = VT_BOOL; + pRetVal->boolVal = (props->textAttributes.fontStyle.has_value() && + props->textAttributes.fontStyle.value() == facebook::react::FontStyle::Italic) + ? VARIANT_TRUE + : VARIANT_FALSE; + } else if (attributeId == UIA_IsReadOnlyAttributeId) { + pRetVal->vt = VT_BOOL; + pRetVal->boolVal = isTextInput ? textinputProps->editable ? VARIANT_FALSE : VARIANT_TRUE : VARIANT_TRUE; + } else if (attributeId == UIA_HorizontalTextAlignmentAttributeId) { + pRetVal->vt = VT_I4; + auto textAlign = facebook::react::TextAlignment::Center; + if (props->textAttributes.alignment.has_value()) { + textAlign = props->textAttributes.alignment.value(); + } + if (textAlign == facebook::react::TextAlignment::Left) { + pRetVal->lVal = HorizontalTextAlignment_Left; + } else if (textAlign == facebook::react::TextAlignment::Right) { + pRetVal->lVal = HorizontalTextAlignment_Right; + } else if (textAlign == facebook::react::TextAlignment::Center) { + pRetVal->lVal = HorizontalTextAlignment_Centered; + } else if (textAlign == facebook::react::TextAlignment::Justified) { + pRetVal->lVal = HorizontalTextAlignment_Justified; + } else if (textAlign == facebook::react::TextAlignment::Natural) { + pRetVal->lVal = HorizontalTextAlignment_Left; + } + } else if (attributeId == UIA_StrikethroughColorAttributeId) { + if (props->textAttributes.textDecorationLineType.has_value() && + (props->textAttributes.textDecorationLineType.value() == + facebook::react::TextDecorationLineType::Strikethrough || + props->textAttributes.textDecorationLineType.value() == + facebook::react::TextDecorationLineType::UnderlineStrikethrough)) { + pRetVal->vt = VT_I4; + pRetVal->lVal = (*props->textAttributes.textDecorationColor).AsColorRefWithAlpha(); + } + } else if (attributeId == UIA_StrikethroughStyleAttributeId) { + if (props->textAttributes.textDecorationLineType.has_value() && + (props->textAttributes.textDecorationLineType.value() == + facebook::react::TextDecorationLineType::Strikethrough || + props->textAttributes.textDecorationLineType.value() == + facebook::react::TextDecorationLineType::UnderlineStrikethrough)) { + pRetVal->vt = VT_I4; + auto style = props->textAttributes.textDecorationStyle.value(); + pRetVal->lVal = GetTextDecorationLineStyle(style); + } + } else if (attributeId == UIA_UnderlineColorAttributeId) { + if (props->textAttributes.textDecorationLineType.has_value() && + (props->textAttributes.textDecorationLineType.value() == facebook::react::TextDecorationLineType::Underline || + props->textAttributes.textDecorationLineType.value() == + facebook::react::TextDecorationLineType::UnderlineStrikethrough)) { + pRetVal->vt = VT_I4; + pRetVal->lVal = (*props->textAttributes.textDecorationColor).AsColorRefWithAlpha(); + } + } else if (attributeId == UIA_UnderlineStyleAttributeId) { + if (props->textAttributes.textDecorationLineType.has_value() && + (props->textAttributes.textDecorationLineType.value() == facebook::react::TextDecorationLineType::Underline || + props->textAttributes.textDecorationLineType.value() == + facebook::react::TextDecorationLineType::UnderlineStrikethrough)) { + pRetVal->vt = VT_I4; + auto style = props->textAttributes.textDecorationStyle.value(); + pRetVal->lVal = GetTextDecorationLineStyle(style); + } + } + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::GetBoundingRectangles(SAFEARRAY **pRetVal) { + if (pRetVal == nullptr) + return E_POINTER; + UiaRect rect; + auto hr = m_parentProvider->get_BoundingRectangle(&rect); + if (FAILED(hr)) + return hr; + *pRetVal = SafeArrayCreateVector(VT_R8, 0, 4); + double *pData = nullptr; + hr = SafeArrayAccessData(*pRetVal, reinterpret_cast(&pData)); + if (FAILED(hr)) + return hr; + pData[0] = rect.left; + pData[1] = rect.top; + pData[2] = rect.width; + pData[3] = rect.height; + hr = SafeArrayUnaccessData(*pRetVal); + if (FAILED(hr)) + return hr; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::GetChildren(SAFEARRAY **pRetVal) { + // no-op + *pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 0); + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::GetEnclosingElement(IRawElementProviderSimple **pRetVal) { + // no-op + *pRetVal = nullptr; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::GetText(int maxLength, BSTR *pRetVal) { + if (pRetVal == nullptr) + return E_POINTER; + auto strongView = m_view.view(); + + if (!strongView) + return UIA_E_ELEMENTNOTAVAILABLE; + auto paragraphView = + strongView.try_as(); + std::string text = ""; + if (paragraphView) { + text = paragraphView->DefaultAccessibleName(); + } else { + auto textInputView = + strongView.try_as(); + if (textInputView) { + text = textInputView->getAccessiblityValue().value().empty() ? textInputView->DefaultAccessibleName() + : textInputView->getAccessiblityValue().value(); + } else { + return UIA_E_NOTSUPPORTED; + } + } + + std::wstring wtext(text.begin(), text.end()); + *pRetVal = SysAllocString(wtext.c_str()); + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::Move(TextUnit unit, int count, int *pRetVal) { + // no-op + *pRetVal = 0; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::MoveEndpointByRange( + TextPatternRangeEndpoint endpoint, + ITextRangeProvider *targetRange, + TextPatternRangeEndpoint targetEndpoint) { + // no-op + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::MoveEndpointByUnit( + TextPatternRangeEndpoint endpoint, + TextUnit unit, + int count, + int *pRetVal) { + // no-op + *pRetVal = 0; + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::ScrollIntoView(BOOL alignToTop) { + // no-op + return S_OK; +} + +HRESULT __stdcall CompositionTextRangeProvider::AddToSelection() { + // no-op + return S_OK; +} +HRESULT __stdcall CompositionTextRangeProvider::RemoveFromSelection() { + // no-op + return S_OK; +} +HRESULT __stdcall CompositionTextRangeProvider::Select() { + // no-op + return S_OK; +} + +} // namespace winrt::Microsoft::ReactNative::implementation diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h new file mode 100644 index 00000000000..18ec13688bf --- /dev/null +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h @@ -0,0 +1,59 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace winrt::Microsoft::ReactNative::implementation { + +class CompositionTextRangeProvider : public winrt::implements { + public: + CompositionTextRangeProvider( + const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView, + CompositionDynamicAutomationProvider *parentProvider) noexcept; + + // inherited via ITextRangeProvider + virtual HRESULT __stdcall Clone(ITextRangeProvider **pRetVal) override; + virtual HRESULT __stdcall Compare(ITextRangeProvider *range, BOOL *pRetVal) override; + virtual HRESULT __stdcall CompareEndpoints( + TextPatternRangeEndpoint endpoint, + ITextRangeProvider *targetRange, + TextPatternRangeEndpoint targetEndpoint, + int *pRetVal) override; + virtual HRESULT __stdcall ExpandToEnclosingUnit(TextUnit unit) override; + virtual HRESULT __stdcall FindAttribute( + TEXTATTRIBUTEID attributeId, + VARIANT val, + BOOL backward, + ITextRangeProvider **pRetVal) override; + virtual HRESULT __stdcall FindText(BSTR text, BOOL backward, BOOL ignoreCase, ITextRangeProvider **pRetVal) override; + virtual HRESULT __stdcall GetAttributeValue(TEXTATTRIBUTEID attributeId, VARIANT *pRetVal) override; + virtual HRESULT __stdcall GetBoundingRectangles(SAFEARRAY **pRetVal) override; + virtual HRESULT __stdcall GetChildren(SAFEARRAY **pRetVal) override; + virtual HRESULT __stdcall GetEnclosingElement(IRawElementProviderSimple **pRetVal) override; + virtual HRESULT __stdcall GetText(int maxLength, BSTR *pRetVal) override; + virtual HRESULT __stdcall Move(TextUnit unit, int count, int *pRetVal) override; + virtual HRESULT __stdcall MoveEndpointByRange( + TextPatternRangeEndpoint endpoint, + ITextRangeProvider *targetRange, + TextPatternRangeEndpoint targetEndpoint) override; + virtual HRESULT __stdcall MoveEndpointByUnit( + TextPatternRangeEndpoint endpoint, + TextUnit unit, + int count, + int *pRetVal) override; + virtual HRESULT __stdcall ScrollIntoView(BOOL alignToTop) override; + virtual HRESULT __stdcall AddToSelection() override; + virtual HRESULT __stdcall RemoveFromSelection() override; + virtual HRESULT __stdcall Select() override; + + private: + ::Microsoft::ReactNative::ReactTaggedView m_view; + winrt::com_ptr m_parentProvider; +}; + +} // namespace winrt::Microsoft::ReactNative::implementation diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp index 4739ca7ff5a..cb04dfe8d28 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp @@ -254,4 +254,18 @@ ToggleState GetToggleState(const std::optional #include +#include #include #include @@ -41,4 +42,6 @@ void AddSelectionItemsToContainer(CompositionDynamicAutomationProvider *provider void RemoveSelectionItemsFromContainer(CompositionDynamicAutomationProvider *provider) noexcept; ToggleState GetToggleState(const std::optional &state) noexcept; + +TextDecorationLineStyle GetTextDecorationLineStyle(facebook::react::TextDecorationStyle style) noexcept; } // namespace winrt::Microsoft::ReactNative::implementation diff --git a/vnext/Shared/Shared.vcxitems b/vnext/Shared/Shared.vcxitems index d14ce92e107..ea93c3668c8 100644 --- a/vnext/Shared/Shared.vcxitems +++ b/vnext/Shared/Shared.vcxitems @@ -67,6 +67,12 @@ true + + true + + + true + true $(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeIsland.idl diff --git a/vnext/Shared/Shared.vcxitems.filters b/vnext/Shared/Shared.vcxitems.filters index b80ed46b417..cbe01f6c5bf 100644 --- a/vnext/Shared/Shared.vcxitems.filters +++ b/vnext/Shared/Shared.vcxitems.filters @@ -209,6 +209,12 @@ Source Files\Fabric\Composition + + Source Files\Fabric\Composition + + + Source Files\Fabric\Composition + Source Files\Fabric\Composition @@ -330,6 +336,8 @@ + +