func testStaticUI()

in abtesting/Shared/UITests.swift [40:73]


  func testStaticUI() throws {
    // UI tests must launch the application that they test.
    let app = XCUIApplication()
    app.launch()

    // Use recording to get started writing UI tests.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
    #if !os(macOS)
      XCTAssertTrue(app.navigationBars["Firenotes"].exists,
                    "Firenotes is missing from the navigation bar")
    #else
      XCTAssert(app.windows.firstMatch.staticTexts["Firenotes"].exists,
                "Firenotes is missing from window")
    #endif

    XCTAssertTrue(app.buttons["Refresh"].exists, "Refresh button does not exist.")
    XCTAssertTrue(app.buttons["Refresh"].isEnabled, "Refresh button is not enabled.")
    XCTAssertTrue(app.buttons["Refresh"].isHittable, "Refresh button is missing from view.")

    #if !os(watchOS)
      let texts = [
        "Getting Started with Firebase", "An Introduction to Firebase",
        "Google Firestore", "Powerful Querying and Automatic Scaling",
        "Analytics", "Simple App Insights",
        "Remote Config", "Parameterize App Behavior",
        "A/B Testing", "Optimize App Experience through Experiments",
      ]
    #else
      let texts = ["Getting Started with Firebase", "An Introduction to Firebase"]
    #endif
    for text in texts {
      XCTAssertTrue(app.staticTexts[text].isHittable, "Text '\(text)' is missing from view.")
    }
  }