BaseUIXCTestCase.swift 1012 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // BaseUIXCTestCase.swift
  3. // NextcloudUITests
  4. //
  5. // Created by Milen on 20.06.23.
  6. // Copyright © 2023 Marino Faggiana. All rights reserved.
  7. //
  8. import XCTest
  9. class BaseUIXCTestCase: XCTestCase {
  10. let timeoutSeconds: Double = 100
  11. override final class var runsForEachTargetApplicationUIConfiguration: Bool {
  12. false
  13. }
  14. internal func waitForEnabled(object: Any?) {
  15. let predicate = NSPredicate(format: "enabled == true")
  16. expectation(for: predicate, evaluatedWith: object, handler: nil)
  17. waitForExpectations(timeout: timeoutSeconds, handler: nil)
  18. }
  19. internal func waitForHittable(object: Any?) {
  20. let predicate = NSPredicate(format: "hittable == true")
  21. expectation(for: predicate, evaluatedWith: object, handler: nil)
  22. waitForExpectations(timeout: timeoutSeconds, handler: nil)
  23. }
  24. internal func waitForEnabledAndHittable(object: Any?) {
  25. waitForEnabled(object: object)
  26. waitForHittable(object: object)
  27. }
  28. }