mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
fix(ios): long names in element.takeScreenshot (#4843)
This commit is contained in:
committed by
GitHub
parent
049c9f81a7
commit
57fbf2e598
@@ -627,7 +627,12 @@ static void _DTXTypeText(NSString* text)
|
||||
{
|
||||
UIImage *image = [self.dtx_view dtx_imageFromView];
|
||||
NSURL *path = [NSURL elementsScreenshotPath];
|
||||
NSString *fileName = [NSString stringWithFormat:@"ImageScreenshot_%@.png", name != nil ? name : self];
|
||||
NSString *fileName;
|
||||
if (name != nil) {
|
||||
fileName = [NSString stringWithFormat:@"ImageScreenshot_%@.png", name];
|
||||
} else {
|
||||
fileName = [NSString stringWithFormat:@"ImageScreenshot_%p.png", self];
|
||||
}
|
||||
[image dtx_saveToPath:path fileName:fileName];
|
||||
|
||||
return [path URLByAppendingPathComponent:fileName isDirectory:false];;
|
||||
|
||||
Reference in New Issue
Block a user