初始化提交
This commit is contained in:
36
WebDriverAgentTests/UnitTests/FBElementUtilitiesTests.m
Normal file
36
WebDriverAgentTests/UnitTests/FBElementUtilitiesTests.m
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 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
|
||||
Reference in New Issue
Block a user