2018-08-15 22:27:48 -04:00
|
|
|
//
|
|
|
|
// TuskerUITests.swift
|
|
|
|
// TuskerUITests
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 8/15/18.
|
|
|
|
// Copyright © 2018 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
2022-10-07 21:12:20 -04:00
|
|
|
//import Embassy
|
|
|
|
//import Ambassador
|
2018-08-15 22:27:48 -04:00
|
|
|
|
|
|
|
class TuskerUITests: XCTestCase {
|
2019-12-30 15:59:49 -05:00
|
|
|
|
2022-10-07 21:12:20 -04:00
|
|
|
// var eventLoop: EventLoop!
|
|
|
|
// var router: Router!
|
|
|
|
// var server: HTTPServer!
|
|
|
|
// var eventLoopThreadCondition: NSCondition!
|
|
|
|
// var eventLoopThread: Thread!
|
2019-12-30 15:59:49 -05:00
|
|
|
|
|
|
|
var app: XCUIApplication!
|
|
|
|
|
2022-10-07 21:12:20 -04:00
|
|
|
// private func setupWebServer() {
|
|
|
|
// eventLoop = try! SelectorEventLoop(selector: try! KqueueSelector())
|
|
|
|
// router = Router()
|
|
|
|
// server = DefaultHTTPServer(eventLoop: eventLoop, port: 8080, app: router.app)
|
|
|
|
// router["/hello"] = JSONResponse(handler: { (_) in
|
|
|
|
// return ["Hello", "World"]
|
|
|
|
// })
|
|
|
|
// try! server.start()
|
|
|
|
//
|
|
|
|
// eventLoopThreadCondition = NSCondition()
|
|
|
|
// eventLoopThread = Thread(block: {
|
|
|
|
// self.eventLoop.runForever()
|
|
|
|
// self.eventLoopThreadCondition.lock()
|
|
|
|
// self.eventLoopThreadCondition.signal()
|
|
|
|
// self.eventLoopThreadCondition.unlock()
|
|
|
|
// })
|
|
|
|
// eventLoopThread.start()
|
|
|
|
// }
|
2019-12-30 15:59:49 -05:00
|
|
|
|
2018-08-15 22:27:48 -04:00
|
|
|
override func setUp() {
|
2022-10-07 21:12:20 -04:00
|
|
|
// setupWebServer()
|
2019-12-30 15:59:49 -05:00
|
|
|
|
2018-08-15 22:27:48 -04:00
|
|
|
continueAfterFailure = false
|
2019-12-30 15:59:49 -05:00
|
|
|
app = XCUIApplication()
|
|
|
|
app.launchEnvironment["UI_TESTING"] = "true"
|
2018-08-15 22:27:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
override func tearDown() {
|
2022-10-07 21:12:20 -04:00
|
|
|
// server.stopAndWait()
|
|
|
|
// eventLoopThreadCondition.lock()
|
|
|
|
// eventLoop.stop()
|
|
|
|
// while eventLoop.running {
|
|
|
|
// if !eventLoopThreadCondition.wait(until: Date(timeIntervalSinceNow: 10)) {
|
|
|
|
// fatalError("Join eventLoopThread timeout")
|
|
|
|
// }
|
|
|
|
// }
|
2018-08-15 22:27:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|