title: iOS UI Test to adjust picker value on SwiftUI app
body: <p>I am trying to implement a UI test that adjusts the selected value of the wheel of a sample picker like the following:</p>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
  
  var colors = [&quot;Red&quot;, &quot;Green&quot;, &quot;Blue&quot;, &quot;Yellow&quot;, &quot;White&quot;, &quot;Black&quot;, &quot;Purple&quot;, &quot;Cyan&quot;]
  @State private var selectedColor = &quot;Red&quot;
  
    var body: some View {
      VStack {
        Picker(&quot;Choose a color&quot;, selection: $selectedColor) {
          ForEach(colors, id: \.self) {
            Text($0)
          }
        }
        .accessibility(identifier: &quot;picker&quot;)
        Text(&quot;You selected: \(selectedColor)&quot;)
      }
    }
  }
  </code></pre>
  <p><strong>UI test</strong></p>
  <pre><code>let picker = app!.pickers[&quot;picker&quot;].pickerWheels.firstMatch
  picker.adjust(toPickerWheelValue: &quot;Purple&quot;)
  </code></pre>
  <p>However, when using the function adjust(toPickerWheelValue: ) the wheel only steps to the next item on the list in the direction of the desired value. In the above UI Test example, the result is the wheel moving to &quot;Green&quot;. If I call the function again, the wheel will move one step to select &quot;Blue&quot; and so on. Why is this happening?</p>
  <p><strong>Using</strong>: Xcode 12.4 and iOS 14.4</p>