forked from lukakerr/Pine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInitialOpenUITests.swift
55 lines (41 loc) · 1.14 KB
/
InitialOpenUITests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// InitialOpenUITests
// PineUITests
//
// Created by Luka Kerr on 25/4/18.
// Copyright © 2018 Luka Kerr. All rights reserved.
//
import XCTest
class InitialOpenUITests: XCTestCase {
override func setUp() {
super.setUp()
// Stop immediately when a failure occurs
continueAfterFailure = false
// Launch the application
XCUIApplication().launch()
}
func testEmptyTextViewOpened() {
let app = XCUIApplication()
let textview = app.textViews.firstMatch
let contents = textview.value as? String
XCTAssertEqual(contents, "")
}
func testEmptyWebViewOpened() {
let app = XCUIApplication()
let webView = app.webViews.firstMatch
let contents = webView.value as? String
XCTAssertEqual(contents, "")
}
func testEmptySidebarOpened() {
let app = XCUIApplication()
let outlineViews = app.outlines.firstMatch
let numberOfRows = outlineViews.outlineRows.count
XCTAssertEqual(numberOfRows, 0)
}
func testUntitledDocumentOpened() {
let app = XCUIApplication()
let window = app.windows.firstMatch
let title = window.title
XCTAssertEqual(title, "Untitled")
}
}