Files
custom_wda/WebDriverAgentTests/UnitTests/FBElementUtilitiesTests.m

37 lines
943 B
Mathematica
Raw Normal View History

2026-02-03 16:52:44 +08:00
/**
* Copyright (c) 2015-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 "FBElement.h"
#import "XCUIElementDouble.h"
#import "FBElementUtils.h"
@interface FBElementUtilitiesTests : XCTestCase
@end
@implementation FBElementUtilitiesTests
- (void)testTypesFiltering {
NSMutableArray *elements = [NSMutableArray new];
XCUIElementDouble *el1 = [XCUIElementDouble new];
[elements addObject:el1];
XCUIElementDouble *el2 = [XCUIElementDouble new];
el2.elementType = XCUIElementTypeAlert;
el2.wdType = @"XCUIElementTypeAlert";
[elements addObject:el2];
XCUIElementDouble *el3 = [XCUIElementDouble new];
[elements addObject:el3];
NSSet *result = [FBElementUtils uniqueElementTypesWithElements:elements];
XCTAssertEqual([result count], 2);
}
@end