Tusker/TuskerUITests/MyProfileTests.swift

64 lines
2.1 KiB
Swift
Raw Permalink Normal View History

2019-12-31 16:40:56 +00:00
//
// MyProfileTests.swift
// TuskerUITests
//
// Created by Shadowfacts on 12/31/19.
// Copyright © 2019 Shadowfacts. All rights reserved.
//
import XCTest
class MyProfileTests: TuskerUITests {
override func setUp() {
super.setUp()
2022-10-08 01:12:20 +00:00
// router.allRoutes()
2019-12-31 16:40:56 +00:00
app.launchEnvironment["UI_TESTING_LOGIN"] = "true"
app.launch()
}
func testProfileHeader() {
app.tabBars.buttons["My Profile"].tap()
XCTAssertTrue(app.staticTexts["Admin Account"].exists)
XCTAssertTrue(app.staticTexts["@admin"].exists)
XCTAssertTrue(app.staticTexts["My profile description."].exists)
let segmented = app.segmentedControls.firstMatch
XCTAssertTrue(segmented.exists)
XCTAssertEqual(segmented.buttons.count, 3)
XCTAssertTrue(segmented.buttons["Posts"].exists)
XCTAssertTrue(segmented.buttons["Posts and Replies"].exists)
XCTAssertTrue(segmented.buttons["Media"].exists)
XCTAssertTrue(app.buttons["More Actions"].exists)
app.buttons["More Actions"].tap()
2021-02-06 18:47:45 +00:00
XCTAssertTrue(app.buttons["Open in Safari"].exists)
XCTAssertTrue(app.buttons["Share..."].exists)
XCTAssertTrue(app.buttons["Send Message"].exists)
app.buttons["Open in Safari"].tap()
XCTAssertTrue(app.otherElements["TopBrowserBar"].exists)
app.buttons["Done"].tap()
XCTAssertFalse(app.otherElements["TopBrowserBar"].exists)
app.buttons["More Actions"].tap()
app.buttons["Share..."].tap()
let activityListView = app.otherElements["ActivityListView"]
XCTAssertTrue(activityListView.waitForExistence(timeout: 0.2))
activityListView.buttons["Close"].tap()
XCTAssertFalse(activityListView.exists)
app.buttons["More Actions"].tap()
app.buttons["Send Message"].tap()
XCTAssertTrue(app.staticTexts["Compose"].exists)
XCTAssertTrue(app.buttons["Cancel"].exists)
XCTAssertTrue(app.buttons["Post"].exists)
app.buttons["Cancel"].tap()
2019-12-31 16:40:56 +00:00
}
}