XCElementSnapshotHitPointTests.m 962 B

12345678910111213141516171819202122232425262728293031
  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
  23. ensureWrapped:[dstBtn fb_standardSnapshot]].fb_hitPoint.CGPointValue;
  24. XCTAssertTrue(hitPoint.x > 0 && hitPoint.y > 0);
  25. }
  26. @end