Files
OSGKeyboard/OSGKeyboardUITests/EnglishKeyboardDeviceUITests.swift
T
Rocky 4749a9cbf2 feat(keyboard): add English QuickType bar and system lexicon
Show verbatim/correction/completion slots, mmap a 40k-word list, and
use UITextChecker plus supplementary lexicon for conservative autocorrect.
2026-08-14 21:49:22 +08:00

44 lines
1.4 KiB
Swift

// EnglishKeyboardDeviceUITests.swift
// OSGKeyboardUITests
//
// Physical-device pass: Notes-like host + the real keyboard extension.
// Skips if OSGKeyboard is not enabled as the current keyboard.
import XCTest
final class EnglishKeyboardDeviceUITests: XCTestCase {
func testOSGKeyboardAppearsOnNotesHost() throws {
let app = XCUIApplication()
app.launchArguments = [
"--whats-new-host",
"--whats-new-lang=en",
"--whats-new-scenario=edit"
]
app.launch()
let textView = app.textViews["notes.host.textView"]
XCTAssertTrue(
textView.waitForExistence(timeout: 12),
"Notes host text view should appear"
)
if !textView.exists {
return
}
textView.tap()
let keyboard = XCUIApplication(bundleIdentifier: "com.osgkeyboard.ios.keyboard")
let appeared = keyboard.wait(for: .runningForeground, timeout: 8)
|| keyboard.windows.firstMatch.waitForExistence(timeout: 8)
if !appeared {
throw XCTSkip(
"OSGKeyboard extension is not the active keyboard on this device. Enable it in Settings ▸ Keyboard, then re-run."
)
}
XCTAssertTrue(
keyboard.windows.firstMatch.exists,
"OSGKeyboard extension window should be on screen"
)
}
}