XCElementSnapshotHitPointTests.m 934 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import "FBIntegrationTestCase.h"
  10. #import "FBTestMacros.h"
  11. #import "FBXCElementSnapshotWrapper+Helpers.h"
  12. #import "XCUIElement.h"
  13. #import "XCUIElement+FBUtilities.h"
  14. @interface XCElementSnapshotHitPoint : FBIntegrationTestCase
  15. @end
  16. @implementation XCElementSnapshotHitPoint
  17. - (void)testAccessibilityActivationPoint
  18. {
  19. [self launchApplication];
  20. [self goToAttributesPage];
  21. XCUIElement *dstBtn = self.testedApplication.buttons[@"not_accessible"];
  22. CGPoint hitPoint = [FBXCElementSnapshotWrapper ensureWrapped:dstBtn.fb_takeSnapshot].fb_hitPoint.CGPointValue;
  23. XCTAssertTrue(hitPoint.x > 0 && hitPoint.y > 0);
  24. }
  25. @end