Files
Rocky 2bc8c1b87d fix(ipad): ship iPad P0 layout/globe fixes, edit-last-input, drop clipboard commands
Adapt typing/voice surfaces for iPad width and height, add the system globe
key and last-input editing flow, harden host-only Rime deployment, and remove
clipboard voice commands. Bump build to 61.
2026-08-10 13:50:50 +08:00

41 lines
1.7 KiB
Swift

import XCTest
@MainActor
final class EditPagerUITests: XCTestCase {
func testPagerSwipesBetweenOriginalAndEditedText() {
let app = XCUIApplication()
app.launchArguments = ["--edit-pager-ui-test"]
app.launch()
let swipeArea = app.descendants(matching: .any)["edit.pager.swipeArea"]
XCTAssertTrue(swipeArea.waitForExistence(timeout: 10))
XCTAssertTrue(app.staticTexts["ORIGINAL_ACTIVE"].waitForExistence(timeout: 5))
// Start from app coordinates, not the ScrollView accessibility
// element. Element-relative injection can bypass real screen hit
// testing and previously let a transparent dead zone pass this test.
let appFrame = app.frame
let areaFrame = swipeArea.frame
let y = areaFrame.minY + areaFrame.height * 0.9
let rightX = areaFrame.minX + areaFrame.width * 0.88
let leftX = areaFrame.minX + areaFrame.width * 0.12
let lowerRight = app.coordinate(
withNormalizedOffset: CGVector(
dx: (rightX - appFrame.minX) / appFrame.width,
dy: (y - appFrame.minY) / appFrame.height
)
)
let lowerLeft = app.coordinate(
withNormalizedOffset: CGVector(
dx: (leftX - appFrame.minX) / appFrame.width,
dy: (y - appFrame.minY) / appFrame.height
)
)
lowerRight.press(forDuration: 0.05, thenDragTo: lowerLeft)
XCTAssertTrue(app.staticTexts["EDITED_ACTIVE"].waitForExistence(timeout: 5))
lowerLeft.press(forDuration: 0.05, thenDragTo: lowerRight)
XCTAssertTrue(app.staticTexts["ORIGINAL_ACTIVE"].waitForExistence(timeout: 5))
}
}