Post

Replies

Boosts

Views

Activity

No screenshot files in XCResult files using Xcode 16.1
Hello, I am using Xcode 16.1 (16B40) on MacOS Sequoia 15.1.0 using a Macbook pro M1 Max I am developing an app for iOS 17 and 18 using SwiftUI I created UITests to take the screenshots for the appStore on the simulator The tests run well and all of them are succeded The problem appears when I try to get the screenshot files from the xcresult files after the test. There is not any screenshot inside it. I found a data folder and a Info.plist file. In the data folder there are a lot of files with this pattern data.03zD4C6IGFFthK14NwA8mNvcwFHT16g6Tl40Tl1YmBC1bNh6d0YIcnWKyUaQPDXoa8fYo6C3Xcv8xvMtE3_NEXA== and other files with this pattern refs.03zD4C6IGFFthK14NwA8mNvcwFHT16g6Tl40Tl1YmBC1bNh6d0YIcnWKyUaQPDXoa8fYo6C3Xcv8xvMtE3_NEXA== Ok, I tryed to use fastlane to automatize the screenshots but the problem is still present. The xcresult files have not any png file. I had no problems doing this action (getting screenshots from a xcresult file) in previous versions of MacOS and Xcode in my current machine. I just updated my machine to MacOS Sequoia 15.1.1 and the problem is still present Honestly I don't know how to fix this situation. With Xcode 15 I had not any problem with that but I am not sure if Xcode 16.0 was runing without problems because I didn't need to use this functionality in those months Here is my code for a UITest: import XCTest final class ScreenshotsUITests: XCTestCase { let app = XCUIApplication() let device = "iPhone16" override func setUpWithError() throws { continueAfterFailure = true } override func tearDownWithError() throws {} @MainActor func testEnglishScreens() throws { let lang = "en" app.launchArguments.append("UITestMode") app.launchArguments += ["-AppleLanguages", "(en)"] app.launchArguments += ["-AppleLocale", "en_US"] app.launch() executeTestsForMenus(lang: lang, backLabel: "Back") executeTestForMatch(lang: lang) } @MainActor func testSpanishScreens() throws { let lang = "es" app.launchArguments.append("UITestMode") app.launchArguments += ["-AppleLanguages", "(es)"] app.launchArguments += ["-AppleLocale", "es_ES"] app.launch() executeTestsForMenus(lang: lang, backLabel: "Atrás") executeTestForMatch(lang: lang) } private func executeTestForMatch(lang: String) { let startButton = app.buttons["start-button"] startButton.tap() let key4 = app.buttons["key-4"] XCTAssertTrue(key4.waitForExistence(timeout: 30), "Key 4 in match screen is not found") key4.tap() let key2 = app.buttons["key-2"] XCTAssertTrue(key2.exists, "Key 2 in match screen is not found") key2.tap() makeScreenShot("playing", lang: lang) let closeButton = app.buttons["close-button"] XCTAssertTrue(closeButton.exists, "Close button in match screen is not found") closeButton.tap() } private func executeTestsForMenus(lang: String, backLabel: String) { let mainHeader = app.staticTexts["Math match"] XCTAssertTrue(mainHeader.exists, "Header in main screen is not found") makeScreenShot("mainMenu", lang: lang) let settingsButton = app.buttons["settings-button"] XCTAssertTrue(settingsButton.exists, "Settings button in main screen is not found") settingsButton.tap() makeScreenShot("Settings", lang: lang) let backButton = app.buttons[backLabel] XCTAssertTrue(backButton.exists, "Back button in match screen is not found") backButton.tap() let helpButton = app.buttons["help-button"] XCTAssertTrue(helpButton.exists, "Help button in main screen is not found") helpButton.tap() makeScreenShot("Help", lang: lang) backButton.tap() let scoreButton = app.buttons["score-button"] XCTAssertTrue(scoreButton.exists, "Scores button in main screen is not found") scoreButton.tap() makeScreenShot("Scores", lang: lang) backButton.tap() let playButton = app.buttons["play-button"] XCTAssertTrue(playButton.exists, "Play button in main screen is not found") playButton.tap() makeScreenShot("matchBuilder", lang: lang) let startButton = app.buttons["start-button"] XCTAssertTrue(startButton.exists, "Start button in match builder screen is not found") } private func makeScreenShot(_ name: String, lang: String) { takeScreenshot(app, named: "\(lang)-\(name)-\(device)") } } import XCTest extension XCTestCase { func takeScreenshot(_ app: XCUIApplication, named name: String, fullScreen: Bool = false) { let screenshot: XCUIScreenshot if fullScreen { screenshot = app.windows.firstMatch.screenshot() } else { screenshot = XCUIScreen.main.screenshot() } let screenshotAttachment = XCTAttachment( uniformTypeIdentifier: "public.png", name: "screenshot-\(name).png", payload: screenshot.pngRepresentation, userInfo: nil) screenshotAttachment.lifetime = .keepAlways add(screenshotAttachment) } } and here is the content of my testplan file: { "configurations" : [ { "id" : "35BC7C0B-9A5A-4027-9F30-36958C4C1AAF", "name" : "Test Scheme Action", "options" : { "preferredScreenCaptureFormat" : "screenshot", "testExecutionOrdering" : "random", "uiTestingScreenshotsLifetime" : "keepAlways", "userAttachmentLifetime" : "keepAlways" } } ], "defaultOptions" : { "targetForVariableExpansion" : { "containerPath" : "container:myAppProject.xcodeproj", "identifier" : "B27D1B022CA00314001A259B", "name" : "MyAppProject" } }, "testTargets" : [ { "parallelizable" : true, "target" : { "containerPath" : "container:MyAppProject.xcodeproj", "identifier" : "B27D1B122CA00315001A259B", "name" : "MyAppProjectTests" } }, { "parallelizable" : true, "target" : { "containerPath" : "container:MyAppProject.xcodeproj", "identifier" : "B27D1B1C2CA00315001A259B", "name" : "MyAppProjectUITests" } } ], "version" : 1 } I made tests with old projects in my machine and those projects have the same problem with screenshot files in the xcresult bundles I don't know if the problem is in my machine, my Xcode, MacOS or other ting. I don't know how to fix this problem Please, can anyone help me? Thanks in advance
0
0
34
1d
Accessible label for braille devices
Hello, I want to improve UX for users who uses braille devices. I am using accessibilityLabel in SwiftUI to show information for blind users but I want to give a better experience for braille users using special characters like a block in braille to draw simple figures. Those characters cannot be spoken by TextToSpeech and that is the reason that I need an alternative of accessibilityLabel only for braille devices. Is this possible in UIKit, AppKit or SwiftUI? I preffer using SwiftUI but I will use anything to get this. Thanks in advance
0
0
421
Apr ’23
How to use AXBrailleMapRenderer in SwiftUI to improve UX for braille users
Hello, I am developing an app for MacOS and iOS using SwiftUI and I want to include a better experience for braille display users. Braille display users use VoiceOver to access to the OS and all apps. My problem: I want to show an image with data. I have no problem for VoiceOver's voice output, I use the accessibilityLabel attribute to give information using a speech output channel. But I want to give a better format for braille output channel because deaf and blind users can find problem with the information in the accessibilityLabel value. I found information about AXBrailleMap and AXBrailleMapRenderer but there is not any code sample and I couldn't use AXBrailleMapRenderer. The information in the documentation seems not enough to do anything. I tryed to use with Swift an NSView, a SwiftUI view and a NSView in ObjectiveC but I couldn't get any success. I need to do these tasks: * to Get the dimension of the braille display * to print a custom string in the braille display * to get and to set specific points up and down in the braille display to draw a little icon. Can anybody help me? Thanks in advance
2
0
632
Feb ’23