In order to test my application UI I need to be able to open file but XCUITests recording doesn't work after a NSOpenPanel is displayed.
Is there something I'm missing or any workaround?
In my case I want to open a video in my AVPlayer.
In order to test my application UI I need to be able to open file but XCUITests recording doesn't work after a NSOpenPanel is displayed.
Is there something I'm missing or any workaround?
In my case I want to open a video in my AVPlayer.
Code Block Swift func testAddCertificateButton() { let app = XCUIApplication() let windowsQuery = app.windows let addButton = windowsQuery.buttons["+"] XCTAssert(addButton.exists) addButton.click() let openDialog = app.dialogs.firstMatch XCTAssert(openDialog.waitForExistence(timeout: 5)) // Make sure we're on the right type of dialog by checking the "Where:" popover button exists // Also grab a reference to the Open button so we can click it later let openButton = openDialog.buttons["Open"] let whereButton = openDialog.popUpButtons["Where:"] XCTAssert(whereButton.exists) XCTAssert(openButton.exists) app.typeKey("g", modifierFlags: [.command, .shift]) let sheet = openDialog.sheets.firstMatch XCTAssert(sheet.waitForExistence(timeout: 5)) let goButton = openDialog.buttons["Go"] let input = sheet.comboBoxes.firstMatch XCTAssert(goButton.exists) XCTAssert(input.exists) input.typeText("/Full/Path/To/Location") goButton.click() let file = openDialog.images["FileYouExpect.txt"] XCTAssert(cert.waitForExistence(timeout: 5)) file.click() openButton.click() }
Code Block Swift XCTAssert(file.waitForExistence(timeout: 5))
Seems this broke in Monterey.