2019-12-30 15:59:49 -05:00
|
|
|
//
|
|
|
|
// OnboardingTests.swift
|
|
|
|
// TuskerUITests
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 12/21/19.
|
|
|
|
// Copyright © 2019 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
2022-10-07 21:12:20 -04:00
|
|
|
//import Ambassador
|
2019-12-30 15:59:49 -05:00
|
|
|
|
|
|
|
class OnboardingTests: TuskerUITests {
|
|
|
|
|
|
|
|
override func setUp() {
|
|
|
|
super.setUp()
|
|
|
|
|
2022-10-07 21:12:20 -04:00
|
|
|
// router.instanceRoutes()
|
2019-12-31 11:40:56 -05:00
|
|
|
|
|
|
|
app.launch()
|
2019-12-30 15:59:49 -05:00
|
|
|
}
|
2019-12-31 11:40:56 -05:00
|
|
|
|
|
|
|
// can't test logging in because there's no way of interacting with the safari VC that's used in the OAuth flow
|
2019-12-30 15:59:49 -05:00
|
|
|
|
2020-09-12 22:15:45 -04:00
|
|
|
func testSearchSuggestedInstances() {
|
|
|
|
XCTAssertTrue(app.cells.firstMatch.waitForExistence(timeout: 2))
|
|
|
|
let firstInstanceLabel = app.cells.staticTexts.firstMatch.label
|
|
|
|
let secondInstanceLabel = app.cells.element(boundBy: 1).staticTexts.firstMatch.label
|
|
|
|
let searchField = app.searchFields.element
|
|
|
|
searchField.tap()
|
|
|
|
searchField.typeText(firstInstanceLabel)
|
|
|
|
XCTAssertTrue(app.staticTexts[firstInstanceLabel].exists)
|
|
|
|
XCTAssertFalse(app.staticTexts[secondInstanceLabel].exists)
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:40:56 -05:00
|
|
|
func testCustomInstanceAppears() {
|
2019-12-30 15:59:49 -05:00
|
|
|
let searchField = app.searchFields.element
|
|
|
|
searchField.tap()
|
|
|
|
searchField.typeText("http://localhost:8080")
|
2020-09-12 22:15:45 -04:00
|
|
|
XCTAssertTrue(app.staticTexts["localhost"].waitForExistence(timeout: 2))
|
2019-12-30 15:59:49 -05:00
|
|
|
XCTAssertTrue(app.staticTexts["An instance description"].exists)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|