Skip to content

Commit

Permalink
Fix tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschlegel committed Apr 22, 2024
1 parent 27036bf commit bdb41b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ public class OnboardingNavigationPath {

guard self.onboardingSteps[onboardingStepIdentifier] == nil else {
preconditionFailure("""
SpeziOnboarding: Duplicate Onboarding step of type `\(onboardingStepIdentifier.onboardingStepType)` identified.
Ensure unique Onboarding view instances within the `OnboardingStack`!
SpeziOnboarding: Duplicate Onboarding step identifier hash `\(onboardingStepIdentifier.identifierHash)` identified.
Ensure unique Onboarding view identifiers within the `OnboardingStack`!
""")
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/UITests/TestApp/OnboardingTestsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ struct OnboardingTestsView: View {
OnboardingSequentialTestView()
OnboardingConsentMarkdownTestView()
OnboardingConsentMarkdownRenderingView()
OnboardingCustomToggleTestView(showConditionalView: $showConditionalView)
OnboardingTestViewNotIdentifiable(text: "Leland").onboardingIdentifier("a")
OnboardingTestViewNotIdentifiable(text: "Stanford").onboardingIdentifier("b")
OnboardingCustomToggleTestView(showConditionalView: $showConditionalView)

if showConditionalView {
OnboardingConditionalTestView()
Expand Down
12 changes: 12 additions & 0 deletions Tests/UITests/TestAppUITests/SpeziOnboardingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ final class OnboardingTests: XCTestCase { // swiftlint:disable:this type_body_le
XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

// Check if on final page
XCTAssert(app.staticTexts["Onboarding complete"].waitForExistence(timeout: 2))
}
Expand Down Expand Up @@ -408,6 +411,12 @@ final class OnboardingTests: XCTestCase { // swiftlint:disable:this type_body_le
XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

XCTAssert(app.buttons["Show Conditional View"].waitForExistence(timeout: 2))
app.buttons["Show Conditional View"].tap()

Expand Down Expand Up @@ -456,6 +465,9 @@ final class OnboardingTests: XCTestCase { // swiftlint:disable:this type_body_le
XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2))
app.buttons["Next"].tap()

if showConditionalView {
// Check if on conditional test view
XCTAssert(app.staticTexts["Conditional Test View"].waitForExistence(timeout: 2))
Expand Down

0 comments on commit bdb41b6

Please sign in to comment.