Mercurial > public > lazybear
annotate LazyBearUITests/LazyBearUITests.swift @ 454:c79a3ed3d230
StockView for WatchOS implemented
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 27 Jun 2021 20:55:05 +0200 |
parents | 1b3ba58730e1 |
children | 783b567800d9 |
rev | line source |
---|---|
359
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
1 // |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
2 // LazyBearUITests.swift |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
3 // LazyBearUITests |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
4 // |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
5 // Created by Dennis Concepción Martín on 16/4/21. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
6 // |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
7 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
8 import XCTest |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
9 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
10 class LazyBearUITests: XCTestCase { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
11 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
12 override func setUpWithError() throws { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
13 // Put setup code here. This method is called before the invocation of each test method in the class. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
14 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
15 // In UI tests it is usually best to stop immediately when a failure occurs. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
16 continueAfterFailure = false |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
17 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
18 // 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. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
19 } |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
20 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
21 override func tearDownWithError() throws { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
22 // Put teardown code here. This method is called after the invocation of each test method in the class. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
23 } |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
24 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
25 func testExample() throws { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
26 // UI tests must launch the application that they test. |
371
1b3ba58730e1
Testing
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
359
diff
changeset
|
27 |
359
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
28 let app = XCUIApplication() |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
29 app.launch() |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
30 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
31 // Use recording to get started writing UI tests. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
32 // Use XCTAssert and related functions to verify your tests produce the correct results. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
33 } |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
34 |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
35 func testLaunchPerformance() throws { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
36 if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
37 // This measures how long it takes to launch your application. |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
38 measure(metrics: [XCTApplicationLaunchMetric()]) { |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
39 XCUIApplication().launch() |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
40 } |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
41 } |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
42 } |
3d6f0329d691
Add tests
Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
parents:
diff
changeset
|
43 } |