I'm trying to edit the text of a TextInput React Native component in an ios UITest. I've added the testID
prop to the component.
Two questions:
- Where does the testID prop appear in the native ios code?
- How can I select the TextInput by this testID and add text to it?
App.js
import React from "react";import { StyleSheet, TextInput, View } from "react-native";export default function App() { return (<View><TextInput testID="username" placeholder="Enter your username" /></View> );}
TestappUITests.swift
import XCTestclass TestappUITests: XCTestCase { ... func testExample() { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Write test code here }}