theappbusiness/TABTestKit

Update InteractionContext to be able to assert the label of an element

Closed this issue · 1 comments

extension InteractionContext {
  func label(of element: Element, is expectedLabel: String) {
    XCTAssertTrue(element.underlyingXCUIElement.wait(for: element.label == expectedLabel), "Element did not have the right label before timing out! Expected: \(expectedLabel), actual: \(element.label)")
  }
}

See Sam's comment on PR.