Skip to content

Commit

Permalink
ci: Use accessibility id for crashTheApp button (#3672)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipphofmann authored Feb 22, 2024
1 parent 9f0d9e0 commit 1c0e955
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NNd-Ec-zXw">
<rect key="frame" x="0.0" y="56" width="160" height="28"/>
<accessibility key="accessibilityConfiguration" identifier="crashTheApp"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="Crash the app"/>
<connections>
Expand Down
4 changes: 2 additions & 2 deletions Samples/iOS-Swift/iOS-SwiftUITests/LaunchUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class LaunchUITests: BaseUITest {
//If we introduce a bug in the crash report process we will catch it with tests for iOS 13 or above.
//For some reason is not possible to use @available(iOS 13, *) in the test function.
if #available(iOS 13, *) {
app.buttons["Crash the app"].tap()
if app.buttons["Crash the app"].exists {
app.buttons["crashTheApp"].tap()
if app.buttons["crashTheApp"].exists {

Check failure on line 11 in Samples/iOS-Swift/iOS-SwiftUITests/LaunchUITests.swift

View workflow job for this annotation

GitHub Actions / iOS SwiftUI Tests iPhone 14 (16.4)

testCrashRecovery, Failed to get matching snapshots: Timed out while evaluating UI query.
XCTFail("App did not crashed")
}

Expand Down

0 comments on commit 1c0e955

Please sign in to comment.