Sync build 64 manual reader and qualification tests
This commit is contained in:
1 parent
8236ca17c6
commit
4abc194001
5 files changed
+272
-76
No files matched your search
@@ -75,8 +75,16 @@ final class InteractionTests: XCTestCase {
|
||||
&& frame.width > 0 && frame.height > 0
|
||||
var pending = [try app.snapshot()]
|
||||
while let owned = pending.popLast() {
|
||||
if finite, owned.elementType == .window,
|
||||
interruption.elementType == .window, owned.frame == frame {
|
||||
// AppKit exposes native alerts, sheets and the Caps Lock
|
||||
// indicator as non-window containers. Require the same
|
||||
// immutable identity inside this app's own snapshot;
|
||||
// geometry alone must not accept another app's dialog.
|
||||
let containers: [XCUIElement.ElementType] = [.window, .dialog, .sheet, .alert]
|
||||
if finite, containers.contains(interruption.elementType),
|
||||
owned.elementType == interruption.elementType,
|
||||
owned.frame == frame,
|
||||
owned.identifier == interruption.identifier,
|
||||
owned.label == interruption.label {
|
||||
// Leave owned modal interaction to the test's explicit
|
||||
// control. Do not dismiss or claim to handle it here.
|
||||
return false
|
||||
@@ -88,6 +96,15 @@ final class InteractionTests: XCTestCase {
|
||||
// Only a fresh absence check can establish that it vanished.
|
||||
}
|
||||
if !element.exists { return false }
|
||||
let detail = XCTAttachment(string: "Interruption:\n" + element.debugDescription
|
||||
+ "\n\nIsolated application:\n" + app.debugDescription)
|
||||
detail.name = "Unowned interruption and isolated-app hierarchy"
|
||||
detail.lifetime = .keepAlways
|
||||
self.add(detail)
|
||||
let screen = XCTAttachment(screenshot: XCUIScreen.main.screenshot())
|
||||
screen.name = "Whole desktop at unowned interruption"
|
||||
screen.lifetime = .keepAlways
|
||||
self.add(screen)
|
||||
XCTFail("An unexpected window interrupted the isolated test; leave it for its owner.")
|
||||
return true
|
||||
}
|
||||
@@ -3927,6 +3944,8 @@ extension InteractionTests {
|
||||
let shot = XCTAttachment(screenshot: library.screenshot())
|
||||
shot.name = "Software Library — light appearance and format filter"; shot.lifetime = .keepAlways; add(shot)
|
||||
app.typeKey(.escape, modifierFlags: [])
|
||||
XCTAssertTrue(library.buttons["Clear filters"].exists,
|
||||
"The live format choice remains active before entering a global search")
|
||||
search.click(); app.typeText("Mega-Bug")
|
||||
let cartridge = library.buttons["library-title-0e1c55f0a29a52d91d28903454654bd7"]
|
||||
XCTAssertTrue(cartridge.waitForExistence(timeout: 5))
|
||||
@@ -3936,7 +3955,10 @@ extension InteractionTests {
|
||||
}
|
||||
XCTAssertEqual(XCTWaiter.wait(for: [XCTNSPredicateExpectation(predicate: oneResult, object: nil)], timeout: 5), .completed)
|
||||
cartridge.click()
|
||||
XCTAssertTrue(library.buttons["Clear filters"].exists)
|
||||
XCTAssertFalse(library.buttons["Clear filters"].exists,
|
||||
"Entering a global search clears the preceding collection's narrower filters")
|
||||
let heading = library.descendants(matching: .any)["library-heading"].firstMatch
|
||||
XCTAssertTrue((heading.value as? String ?? heading.label).contains("Search Results"))
|
||||
let after = session()
|
||||
XCTAssertEqual(after[0], before[0]); XCTAssertEqual(after[2], before[2]); XCTAssertEqual(after[3], before[3])
|
||||
XCTAssertGreaterThan(after[1], before[1])
|
||||
@@ -4590,7 +4612,18 @@ extension InteractionTests {
|
||||
XCTAssertEqual(search.frame.minY - library.frame.minY, searchY, accuracy: 2)
|
||||
search.click(); app.typeText("Pred")
|
||||
}
|
||||
library.buttons["Browse All Titles"].click()
|
||||
let heading = library.descendants(matching: .any)["library-heading"].firstMatch
|
||||
XCTAssertTrue((heading.value as? String ?? heading.label).contains("Search Results"),
|
||||
"Typing in the header starts a global search even from an empty collection")
|
||||
XCTAssertTrue(firstCover.waitForExistence(timeout: 8))
|
||||
// A global search has results, so its earlier empty-state action is no
|
||||
// longer a valid click target. Explicitly return to an empty collection
|
||||
// before exercising that action and its query reset.
|
||||
library.buttons["library-scope-installed"].click()
|
||||
XCTAssertTrue(library.staticTexts["No matching titles"].waitForExistence(timeout: 8))
|
||||
let browse = library.buttons["Browse All Titles"]
|
||||
XCTAssertTrue(browse.waitForExistence(timeout: 8)); XCTAssertTrue(browse.isHittable)
|
||||
browse.click()
|
||||
XCTAssertEqual(search.value as? String, "")
|
||||
XCTAssertTrue(firstCover.waitForExistence(timeout: 8))
|
||||
library.buttons["library-category-Cartridges"].click()
|
||||
@@ -5018,7 +5051,7 @@ extension InteractionTests {
|
||||
let log = (try? String(contentsOf: folder.appendingPathComponent("drag-trace.txt"))) ?? ""
|
||||
return log.contains("perform file-count=1") && matches(cover, red: false)
|
||||
}, object: nil)
|
||||
XCTAssertEqual(XCTWaiter.wait(for: [delivered], timeout: 180), .completed)
|
||||
XCTAssertEqual(XCTWaiter.wait(for: [delivered], timeout: 600), .completed)
|
||||
} else {
|
||||
source.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).press(forDuration: 0.25,
|
||||
thenDragTo: cover.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)), withVelocity: .slow, thenHoldForDuration: 1)
|
||||
|
||||
Reference in new issue
Block a user