@@ -114,7 +114,7 @@ + (nullable NSString *)xmlStringWithRootElement:(XCUIElement *)root
114
114
return nil ;
115
115
}
116
116
117
- return [self xmlRepresentationWithRootElement : snapshot]. XMLString ;
117
+ return [[ self xmlRepresentationWithSnapshot : snapshot] XMLStringWithOptions: NSXMLNodePrettyPrint] ;
118
118
}
119
119
120
120
+ (NSArray <XCUIElement *> *)matchesWithRootElement : (XCUIElement *)root
@@ -130,8 +130,8 @@ + (nullable NSString *)xmlStringWithRootElement:(XCUIElement *)root
130
130
userInfo: @{}];
131
131
}
132
132
133
- NSXMLElement *rootElement = [self writeXmlWithRootSnapshot : snapshot
134
- indexPath: [AMSnapshotUtils hashWithSnapshot: snapshot]];
133
+ NSXMLElement *rootElement = [self makeXmlWithRootSnapshot : snapshot
134
+ indexPath: [AMSnapshotUtils hashWithSnapshot: snapshot]];
135
135
NSArray <__kindof NSXMLNode *> *matches = [rootElement nodesForXPath: xpathQuery error: &error];
136
136
if (nil == matches) {
137
137
@throw [NSException exceptionWithName: FBInvalidXPathException
@@ -186,9 +186,9 @@ + (NSArray *)collectMatchingElementsWithNodes:(NSArray<__kindof NSXMLNode *> *)n
186
186
: matchingElements.copy ;
187
187
}
188
188
189
- + (NSXMLDocument *)xmlRepresentationWithRootElement : (id <XCUIElementSnapshot>)root
189
+ + (NSXMLDocument *)xmlRepresentationWithSnapshot : (id <XCUIElementSnapshot>)root
190
190
{
191
- NSXMLElement *rootElement = [self writeXmlWithRootSnapshot : root indexPath: nil ];
191
+ NSXMLElement *rootElement = [self makeXmlWithRootSnapshot : root indexPath: nil ];
192
192
NSXMLDocument *xmlDoc = [[NSXMLDocument alloc ] initWithRootElement: rootElement];
193
193
[xmlDoc setVersion: @" 1.0" ];
194
194
[xmlDoc setCharacterEncoding: @" UTF-8" ];
@@ -214,8 +214,8 @@ + (void)recordElementAttributes:(NSXMLElement *)node
214
214
}
215
215
}
216
216
217
- + (NSXMLElement *)writeXmlWithRootSnapshot : (id <XCUIElementSnapshot>)root
218
- indexPath : (nullable NSString *)indexPath
217
+ + (NSXMLElement *)makeXmlWithRootSnapshot : (id <XCUIElementSnapshot>)root
218
+ indexPath : (nullable NSString *)indexPath
219
219
{
220
220
NSString *type = [FBElementTypeTransformer stringWithElementType: root.elementType];
221
221
NSXMLElement *rootElement = [NSXMLElement elementWithName: type];
@@ -228,8 +228,8 @@ + (NSXMLElement *)writeXmlWithRootSnapshot:(id<XCUIElementSnapshot>)root
228
228
NSString *newIndexPath = (indexPath != nil )
229
229
? [AMSnapshotUtils hashWithSnapshot: childSnapshot]
230
230
: nil ;
231
- NSXMLElement *childElement = [self writeXmlWithRootSnapshot : childSnapshot
232
- indexPath: newIndexPath];
231
+ NSXMLElement *childElement = [self makeXmlWithRootSnapshot : childSnapshot
232
+ indexPath: newIndexPath];
233
233
[rootElement addChild: childElement];
234
234
}
235
235
return rootElement;
0 commit comments