Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 108 additions & 56 deletions testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#import "GoldenTestManager.h"
#import <XCTest/XCTest.h>
#import <os/log.h>

@interface GoldenTestManager ()

Expand Down Expand Up @@ -51,6 +52,14 @@ - (instancetype)initWithLaunchArg:(NSString*)launchArg {
}

- (void)checkGoldenForTest:(XCTestCase*)test {
// NSData* newScreenshotData = [[NSData alloc] initWithBase64EncodedString:@"" options:0];
// UIImage* newScreenshot = [UIImage imageWithData:newScreenshotData];
//
// XCTAttachment* newAttachment = [XCTAttachment attachmentWithImage:newScreenshot];
// newAttachment.name = [_goldenImage.goldenName stringByAppendingString:@"_new"];
// newAttachment.lifetime = XCTAttachmentLifetimeKeepAlways;
// [newAttachment addAttachment:attachment];

XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot];
if (!_goldenImage.image) {
XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot];
Expand All @@ -71,6 +80,10 @@ - (void)checkGoldenForTest:(XCTestCase*)test {
screenshotAttachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[test addAttachment:screenshotAttachment];

NSData* rawData = UIImagePNGRepresentation(screenshot.image);
NSString* imageData = [rawData base64EncodedStringWithOptions:0];
os_log_error(OS_LOG_DEFAULT, "Updated golden data: @\"%@\"", imageData);

_XCTPrimitiveFail(test,
@"Goldens do not match. Follow the steps in the "
@"README to update golden named %@ if needed.",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion testing/scenario_app/run_ios_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ defaults write com.apple.iphonesimulator RotateWindowWhenSignaledByGuest -int 1
cd $SRC_DIR/out/$FLUTTER_ENGINE/scenario_app/Scenarios
set -o pipefail && xcodebuild -sdk iphonesimulator \
-scheme Scenarios \
-destination 'platform=iOS Simulator,OS=13.0,name=iPhone 8' \
-destination 'platform=iOS Simulator,name=iPhone 8' \
clean test \
FLUTTER_ENGINE="$FLUTTER_ENGINE"