/**
 * Copyright (c) 2018-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import <XCTest/XCTest.h>
#import "FBXCElementSnapshot.h"

NS_ASSUME_NONNULL_BEGIN

@interface XCUIElementQuery (FBHelpers)

/**
 Extracts the cached element snapshot from its query.
 No requests to the accessiblity framework is made.
 It is only safe to use this call right after element lookup query
 has been executed.

 @return Either the cached snapshot or nil
 */
- (nullable id<FBXCElementSnapshot>)fb_cachedSnapshot;

/**
 Enumerates matches using the requested binding strategy and retains their query
 snapshots for response serialization. Falls back to normal element resolution
 when the query cannot supply a complete set of cached snapshots.
 */
- (NSArray<XCUIElement *> *)fb_allMatchesWithSnapshotsBoundByIndex:(BOOL)boundByIndex;

@end

NS_ASSUME_NONNULL_END
