Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Summary

  • detect the Codename One bundle identifier for the UI tests and log the fallback identifier
  • launch the simulator app via xcrun simctl launch once before falling back to XCUIApplication.launch()
  • take screenshots from the running app after ensuring it is in the foreground

Testing

  • not run (iOS simulator unavailable in container)

https://chatgpt.com/codex/tasks/task_e_68f669797d2c8331b1865058ee8aa328

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 52 to 82
emitScreenshotPayloads(for: shot, name: name)
}

private func ensureAppLaunched(timeout: TimeInterval = 45) {
if app.state == .runningForeground {
return
}

if !simctlLaunchAttempted, let bundleID = targetBundleIdentifier, launchViaSimctl(bundleIdentifier: bundleID) {
simctlLaunchAttempted = true
print("CN1SS:INFO:simctl_launch_attempted bundle=\(bundleID) result=success")
if app.wait(for: .runningForeground, timeout: timeout) {
return
}
app.activate()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Simctl launch bypasses configured locale arguments

The setup adds app.launchArguments += ["-AppleLocale", "en_US", "-AppleLanguages", "(en)"] to keep screenshots deterministic, but ensureAppLaunched() now returns immediately when launchViaSimctl succeeds. In that code path the app is never launched through XCUIApplication.launch(), so the configured launch arguments and any launch environment are never applied. When the simulator launch succeeds, the screenshots will run with whatever locale the simulator already has, producing nondeterministic output. You either need to pass the same arguments when calling simctl or still invoke app.launch()/activate() with those arguments after the simctl launch so the app sees the intended configuration.

Useful? React with 👍 / 👎.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Oct 21, 2025

Android screenshot updates

  • MainActivity — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/MainActivity.png.

    MainActivity
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as MainActivity.png in workflow artifacts.

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog shai-almog force-pushed the codex/fix-blank-screenshots-for-ios-jc5pqm branch from d6905ce to b5276a3 Compare October 25, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants