Skip to content

Instantly share code, notes, and snippets.

@delasign
Created November 9, 2024 14:22
Show Gist options
  • Save delasign/d2323fcd5ee0447459f5079bd74b713c to your computer and use it in GitHub Desktop.
Save delasign/d2323fcd5ee0447459f5079bd74b713c to your computer and use it in GitHub Desktop.
Code for automating search in an NSOpenPanel.
let openPanel = XCUIApplication().dialogs["open-panel"]
XCTAssertTrue(openPanel.exists, "Open Panel is visible.")
XCTAssertTrue(openPanel.isHittable, "Open Panel is hittable.")
let openPanelSearchBox = openPanel.searchFields.firstMatch
XCTAssertTrue(openPanelSearchBox.exists, "Open Panel Search Box is visible.")
XCTAssertTrue(openPanelSearchBox.isHittable, "Open Panel Search Box hittable.")
openPanelSearchBox.tap()
openPanelSearchBox.typeText("SEARCH_TEXT")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment