KoalaUITests.swift 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // KoalaUITests.swift
  3. // KoalaUITests
  4. //
  5. // Created by 刘千军 on 2020/3/27.
  6. // Copyright © 2020 刘千军. All rights reserved.
  7. //
  8. import XCTest
  9. class KoalaUITests: XCTestCase {
  10. override func setUp() {
  11. // Put setup code here. This method is called before the invocation of each test method in the class.
  12. // In UI tests it is usually best to stop immediately when a failure occurs.
  13. continueAfterFailure = false
  14. // 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.
  15. }
  16. override func tearDown() {
  17. // Put teardown code here. This method is called after the invocation of each test method in the class.
  18. }
  19. func testExample() {
  20. // UI tests must launch the application that they test.
  21. let app = XCUIApplication()
  22. app.launch()
  23. // Use recording to get started writing UI tests.
  24. // Use XCTAssert and related functions to verify your tests produce the correct results.
  25. }
  26. func testLaunchPerformance() {
  27. if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
  28. // This measures how long it takes to launch your application.
  29. measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) {
  30. XCUIApplication().launch()
  31. }
  32. }
  33. }
  34. }