@@ -125,14 +125,14 @@ extension FlowTests {
125125extension FlowTests {
126126 func testControls( ) {
127127 for test in [
128- _testDatePicker,
129- _testBarButtonItemTap,
130- _testButtonTap,
131- _testSegmentedControl,
132- _testUISwitch,
133- _testUITextField,
134- _testUITextView,
135- _testSlider
128+ _testDatePicker,
129+ _testBarButtonItemTap,
130+ _testButtonTap,
131+ _testSegmentedControl,
132+ _testUISwitch,
133+ _testUITextField,
134+ _testUITextView,
135+ _testSlider
136136 ] {
137137 goToControlsView ( )
138138 test ( )
@@ -148,9 +148,14 @@ extension FlowTests {
148148 tableView. cells. allElementsBoundByIndex [ 5 ] . tap ( )
149149 }
150150
151- func checkDebugLabelValue( _ expected: String ) {
151+ func checkDebugLabelValue( _ expected: String , hasPrefix : Bool = false ) {
152152 let textValue = app. staticTexts [ " debugLabel " ] . value as? String
153- XCTAssertEqual ( textValue, expected)
153+ if hasPrefix {
154+ XCTAssertTrue ( ( textValue ?? " " ) . hasPrefix ( expected) )
155+ }
156+ else {
157+ XCTAssertEqual ( textValue, expected)
158+ }
154159 }
155160
156161 func _testDatePicker( ) {
@@ -184,9 +189,9 @@ extension FlowTests {
184189
185190 func _testUISwitch( ) {
186191 let switchControl = app. switches. allElementsBoundByIndex [ 0 ]
187- switchControl. tap ( )
192+ switchControl. twoFingerTap ( )
188193 checkDebugLabelValue ( " UISwitch value false " )
189- switchControl. tap ( )
194+ switchControl. twoFingerTap ( )
190195 checkDebugLabelValue ( " UISwitch value true " )
191196 }
192197
@@ -195,19 +200,27 @@ extension FlowTests {
195200 textField. tap ( )
196201 textField. typeText ( " f " )
197202 checkDebugLabelValue ( " UITextField text f " )
203+ let textField2 = app. textFields. allElementsBoundByIndex [ 1 ]
204+ textField2. tap ( )
205+ textField2. typeText ( " f2 " )
206+ checkDebugLabelValue ( " UITextField attributedText f2{ " , hasPrefix: true )
198207 }
199208
200209 func _testUITextView( ) {
201210 let textView = app. textViews. allElementsBoundByIndex [ 0 ]
202211 textView. tap ( )
203212 textView. typeText ( " f " )
204213 checkDebugLabelValue ( " UITextView text f " )
214+ let textView2 = app. textViews. allElementsBoundByIndex [ 1 ]
215+ textView2. tap ( )
216+ textView2. typeText ( " f2 " )
217+ checkDebugLabelValue ( " UITextView attributedText f2{ " , hasPrefix: true )
205218 }
206219
207220 func _testSlider( ) {
208221 let slider = app. sliders. allElementsBoundByIndex [ 0 ]
209222 slider. adjust ( toNormalizedSliderPosition: 0 )
210- checkDebugLabelValue ( " UISlider value 0.0 " )
223+ checkDebugLabelValue ( " UISlider value 0.0 " , hasPrefix : true )
211224 }
212225}
213226
0 commit comments