ExampleCodeUITests.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. import XCTest
  2. final class ExampleCodeUITests: XCTestCase {
  3. override func setUpWithError() throws {
  4. // Put setup code here. This method is called before the invocation of each test method in the class.
  5. // In UI tests it is usually best to stop immediately when a failure occurs.
  6. continueAfterFailure = false
  7. // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
  8. }
  9. override func tearDownWithError() throws {
  10. // Put teardown code here. This method is called after the invocation of each test method in the class.
  11. }
  12. func testExample() throws {
  13. // UI tests must launch the application that they test.
  14. let app = XCUIApplication()
  15. app.launch()
  16. // Use XCTAssert and related functions to verify your tests produce the correct results.
  17. }
  18. func testLaunchPerformance() throws {
  19. if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
  20. // This measures how long it takes to launch your application.
  21. measure(metrics: [XCTApplicationLaunchMetric()]) {
  22. XCUIApplication().launch()
  23. }
  24. }
  25. }
  26. }