-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move breadcrumb tests to UITest (#3038)
* Move breadcrumb tests to UITest * Update InfoForBreadcrumbController.swift
- Loading branch information
Showing
7 changed files
with
116 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <UIKit/UIKit.h> | ||
|
||
@interface SentryBreadcrumbTracker : NSObject | ||
|
||
+ (NSDictionary *)extractDataFromView:(UIView *)view; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#import "SentryBenchmarking.h" | ||
#import "SentryExposure.h" | ||
#import <Sentry/PrivateSentrySDKOnly.h> |
29 changes: 29 additions & 0 deletions
29
Samples/iOS-Swift/iOS-Swift/ViewControllers/InfoForBreadcrumbController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Foundation | ||
import Sentry | ||
import UIKit | ||
|
||
class InfoForBreadcrumbController: UIViewController { | ||
|
||
@IBOutlet var button: UIButton! | ||
@IBOutlet var label: UILabel! | ||
|
||
@IBAction func buttonPressed(_ sender: Any) { | ||
guard let view = self.view, | ||
let viewInfo = SentryBreadcrumbTracker.extractData(from: view), | ||
let buttonInfo = SentryBreadcrumbTracker.extractData(from: button) | ||
else { | ||
label?.text = "ERROR" | ||
return | ||
} | ||
|
||
let hasCorrectData = String(describing: view) == viewInfo["view"] as? String && | ||
viewInfo["tag"] == nil && | ||
viewInfo["accessibilityIdentifier"] as? String == "SOME IDENTIFIER" && | ||
viewInfo["title"] == nil && | ||
buttonInfo["tag"] as? Int == 1 && | ||
buttonInfo["accessibilityIdentifier"] as? String == "extractInfoButton" && | ||
buttonInfo["title"] as? String == button.title(for: .normal) | ||
|
||
label?.text = hasCorrectData ? [viewInfo, buttonInfo].debugDescription : "ERROR" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters