Skip to content

Commit

Permalink
Allow to not assert the identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Oct 17, 2024
1 parent f09473d commit 535d476
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension XCUIApplication {
/// - nextTrigger: The next trigger label to assert.
/// - nextTriggerExistenceTimeout: The time to await for the trigger label to appear.
public func assertNotificationDetails( // swiftlint:disable:this function_default_parameter_at_end
identifier: String,
identifier: String? = nil,
title: String,
subtitle: String? = nil,
body: String,
Expand All @@ -39,7 +39,9 @@ extension XCUIApplication {
nextTriggerExistenceTimeout: TimeInterval = 60
) {
XCTAssert(navigationBars.staticTexts[title].waitForExistence(timeout: 2.0))
XCTAssert(staticTexts["Identifier, \(identifier)"].exists)
if let identifier {
XCTAssert(staticTexts["Identifier, \(identifier)"].exists)
}
XCTAssert(staticTexts["Title, \(title)"].exists)
if let subtitle {
XCTAssert(staticTexts["Subtitle, \(subtitle)"].exists)
Expand Down

0 comments on commit 535d476

Please sign in to comment.