Skip to content

Commit 4a94045

Browse files
Fix E2E test interference: use separate press/release actions for onPressIn test
Co-authored-by: HariniMalothu17 <185761277+HariniMalothu17@users.noreply.github.com>
1 parent a72aa8a commit 4a94045

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/e2e-test-app-fabric/test/TextInputComponentTest.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,12 @@ describe('TextInput Tests', () => {
202202
const dump = await dumpVisualTree('textinput-press');
203203
expect(dump).toMatchSnapshot();
204204

205-
// Trigger onPressIn (click only)
206-
await component.click();
205+
// Get reference to state display element
207206
const stateText = await app.findElementByTestID('textinput-state-display');
208207

208+
// Trigger onPressIn only (press down but don't release yet)
209+
await component.touchAction([{action: 'press', x: 0, y: 0}]);
210+
209211
await app.waitUntil(
210212
async () => {
211213
const currentText = await stateText.getText();
@@ -218,6 +220,10 @@ describe('TextInput Tests', () => {
218220
);
219221
// Assertion
220222
expect(await stateText.getText()).toBe('Holding down the click/touch');
223+
224+
// Release the press to clean up
225+
await component.touchAction([{action: 'release'}]);
226+
221227
// This step helps avoid UI lock by unfocusing the input
222228
const search = await app.findElementByTestID('example_search');
223229
await search.setValue('');

0 commit comments

Comments
 (0)