Skip to content

Commit

Permalink
[Fabric] Add Support for ITextProvider, ITextProvider2, and ITextRang…
Browse files Browse the repository at this point in the history
…eProvider (#14332)

* Partial Implementation

* Add More Implementation

* More Implementation

* More Implementation

* Add Support for Bounding Rectangles

* Complete Initial Implementation

* Change files

* Code Cleanup

* Code Cleanup

* Update Snapshots + Code Cleanup

* Update Snapshots

* Address Feedback

* Address Feedback

* Update Snapshots

* Fix Tests

---------

Co-authored-by: Jon Thysell <[email protected]>
  • Loading branch information
chiaramooney and jonthysell authored Feb 6, 2025
1 parent aab4488 commit 78e2e47
Show file tree
Hide file tree
Showing 28 changed files with 1,190 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "ITextProvider Implementation",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions packages/e2e-test-app-fabric/test/PressableComponentTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
},
Expand Down Expand Up @@ -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",
},
],
},
Expand Down Expand Up @@ -129,6 +131,7 @@ exports[`Accessibility Tests Elements can set accessibilityState:selected to fal
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Unselected",
"TextRangePattern.GetText": "Unselected",
},
],
},
Expand Down Expand Up @@ -187,6 +190,7 @@ exports[`Accessibility Tests Elements can set accessibilityState:selected to tru
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Selected",
"TextRangePattern.GetText": "Selected",
},
],
},
Expand Down Expand Up @@ -252,6 +256,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Unselected",
"TextRangePattern.GetText": "Unselected",
},
],
},
Expand All @@ -267,6 +272,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Unselected",
"TextRangePattern.GetText": "Unselected",
},
],
},
Expand All @@ -282,6 +288,7 @@ exports[`Accessibility Tests Selectable items must have a Selection Container. E
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Unselected",
"TextRangePattern.GetText": "Unselected",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exports[`Button Tests Buttons can be disabled 1`] = `
"IsEnabled": false,
"LocalizedControlType": "text",
"Name": "Submit Application",
"TextRangePattern.GetText": "Submit Application",
},
],
},
Expand Down Expand Up @@ -162,6 +163,7 @@ exports[`Button Tests Buttons can have accessibility labels 1`] = `
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Submit Application",
"TextRangePattern.GetText": "Submit Application",
},
],
},
Expand Down Expand Up @@ -310,6 +312,7 @@ exports[`Button Tests Buttons can have accessibility props 1`] = `
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Submit Application",
"TextRangePattern.GetText": "Submit Application",
},
],
},
Expand Down Expand Up @@ -440,6 +443,7 @@ exports[`Button Tests Buttons can have accessibility states 1`] = `
"IsEnabled": false,
"LocalizedControlType": "text",
"Name": "Submit Application",
"TextRangePattern.GetText": "Submit Application",
},
],
},
Expand Down Expand Up @@ -587,6 +591,7 @@ exports[`Button Tests Buttons can have custom colors 1`] = `
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Cancel Application",
"TextRangePattern.GetText": "Cancel Application",
},
],
},
Expand Down Expand Up @@ -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",
},
],
},
Expand Down Expand Up @@ -1098,6 +1104,7 @@ exports[`Button Tests Buttons can have flexbox styling 1`] = `
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Cancel",
"TextRangePattern.GetText": "Cancel",
},
],
},
Expand All @@ -1113,6 +1120,7 @@ exports[`Button Tests Buttons can have flexbox styling 1`] = `
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Submit",
"TextRangePattern.GetText": "Submit",
},
],
},
Expand Down Expand Up @@ -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",
},
],
},
Expand All @@ -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",
},
],
},
Expand All @@ -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",
},
],
},
Expand Down Expand Up @@ -1894,6 +1905,7 @@ exports[`Button Tests Buttons have default styling 1`] = `
"ControlType": 50020,
"LocalizedControlType": "text",
"Name": "Submit Application",
"TextRangePattern.GetText": "Submit Application",
},
],
},
Expand Down
Loading

0 comments on commit 78e2e47

Please sign in to comment.