feat: refine native iOS chat experience
This commit is contained in:
1 parent
9c5e9bce5b
commit
7bd893ae5c
14 files changed
+415
-93
No files matched your search
@@ -57,31 +57,20 @@ final class VoiceUITests: XCTestCase {
|
||||
server.tap()
|
||||
let original = server.value as? String ?? ""
|
||||
server.typeText(String(repeating: XCUIKeyboardKey.delete.rawValue, count: original.count) + "http://example.com")
|
||||
app.buttons["Save server address"].tap()
|
||||
app.buttons["Change server"].tap()
|
||||
XCTAssertTrue(app.staticTexts.matching(NSPredicate(format: "label CONTAINS 'must use https'")).firstMatch.waitForExistence(timeout: 5))
|
||||
|
||||
let invalid = server.value as? String ?? ""
|
||||
server.tap()
|
||||
server.typeText(String(repeating: XCUIKeyboardKey.delete.rawValue, count: invalid.count) + " https://127.0.0.1:1 ")
|
||||
app.buttons["Save server address"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Server address saved."].waitForExistence(timeout: 5))
|
||||
XCTAssertEqual(server.value as? String, "https://127.0.0.1:1")
|
||||
app.buttons["Change server"].tap()
|
||||
// A validated address presents an explicit account-switch action rather
|
||||
// than silently replacing the active authenticated server.
|
||||
let confirm = app.buttons["Change server and sign out"]
|
||||
XCTAssertTrue(confirm.waitForExistence(timeout: 5))
|
||||
// Do not apply the destructive action in this fixture: the assertion
|
||||
// above proves a validated change cannot bypass the confirmation gate.
|
||||
|
||||
let unchanged = server.value as? String ?? ""
|
||||
server.tap()
|
||||
server.typeText(String(repeating: XCUIKeyboardKey.delete.rawValue, count: unchanged.count) + " https://127.0.0.1:2 ")
|
||||
app.buttons["Save server address"].tap()
|
||||
Thread.sleep(forTimeInterval: 2)
|
||||
XCTAssertTrue(app.navigationBars["Settings"].exists)
|
||||
XCTAssertTrue(app.staticTexts["Server address saved."].exists)
|
||||
XCTAssertEqual(server.value as? String, "https://127.0.0.1:2")
|
||||
|
||||
app.terminate()
|
||||
app.launchArguments = ["--ui-testing"]
|
||||
app.launch()
|
||||
app.buttons["Settings"].tap()
|
||||
XCTAssertTrue(app.buttons.matching(NSPredicate(format: "label CONTAINS 'Speaking voice' AND label CONTAINS 'Jenny'")).firstMatch.waitForExistence(timeout: 5))
|
||||
XCTAssertEqual(app.textFields["Server URL"].value as? String, "https://127.0.0.1:2")
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user