From 0928d8b3e446f76703c81f6d5509624f6eff952d Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sun, 27 Oct 2024 22:59:22 -0700 Subject: [PATCH] update testAccessbilityAudit --- .../XCUIApplicationHelperTests.m | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m b/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m index e86f62021..52e9add84 100644 --- a/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +++ b/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m @@ -111,7 +111,24 @@ - (void)testAccessbilityAudit [set addObject:@"XCUIAccessibilityAuditTypeAll"]; NSArray *auditIssues2 = [XCUIApplication.fb_activeApplication fb_performAccessibilityAuditWithAuditTypesSet:set.copy error:&error]; - XCTAssertEqualObjects(auditIssues1, auditIssues2); + // 'elementDescription' is not in this list because it could have + // different object id's debug description in XCTest. + NSArray *checkKeys = @[ + @"auditType", + @"compactDescription", + @"detailedDescription", + @"element", + @"elementAttributes" + ]; + + for (int i = 1; i < [auditIssues1 count]; i++) { + for (NSString *k in checkKeys) { + XCTAssertEqualObjects( + [auditIssues1[i] objectForKey:k], + [auditIssues2[i] objectForKey:k] + ); + } + } XCTAssertNil(error); }