I am having trouble finding a way to uniquely identify a series of buttons (custom checkboxes) that exist within a Cell. The Cell contains data in a series of key value pairs with the checkbox button tied to each key value pair. The problem is that the Cell contains the values for ALL the key value pairs, so I seem to be unable to find just one of the buttons, since they are all identical.
As the UITest code is parsing the data that is supposed to be displaying in the application, I am checking for a custom type associated with the key value pair. If it's a .CheckboxInput
, then it performs the below code:
else if case KeyValueType.CheckboxInput = currentType {
let currentCheckboxInput = currentKeyQuery.buttons["step unchecked"]
currentCheckboxInput.tap()
XCTAssert(currentKeyQuery.buttons["step checked"].exists)
}
For reference, currentKeyQuery
gets to the Cell and queries for text matching the Key of the key value pair. I'm unable to tap the checkbox button because it's finding all of them that exist in the cell, not just the one associated with the current key value pair it's testing against. Is there any way to associate the button with only the current key value pair since all the checkboxes exist within the same cell?