Skip to content

Conversation

fr0l
Copy link

@fr0l fr0l commented May 12, 2025

First time contributor checklist

Contributor checklist

  • [ x] My commits are rebased on the latest main branch
  • [ x] My commits are in nice logical chunks
  • [ x] My contribution is fully baked and is ready to be merged as is
  • [ x] I have tested my contribution on these devices:
  • iDevice A, iOS X.Y.Z
  • iDevice B, iOS Z.Y

Description

This PR adds two arguments passed on Application Under Test launch: -AppleLocale en_US and -AppleLanguages (en)

This sets application locale to en_US in order to successfully run SignalUITests and SignalServiceKitTests on a Mac with locale set other than en_US (for example: en_GB).

Screenshot 2025-05-12 at 12 44 09

Otherwise when running on non-en_US locale some tests fail with following error:

XCTAssertEqual failed: ("["+445215550100", "+5215550100", "+15215550100"]") is not equal to ("["+15215550100", "+5215550100"]") - searchText: 5215550100

Tests fail due to wrong phone prefix +44 instead of +1

With setting locale to en_US and language to en tests succeed.

@fr0l fr0l force-pushed the FixLocaleForUITests branch from 800668f to e84e3d6 Compare May 21, 2025 09:09
@fr0l fr0l force-pushed the FixLocaleForUITests branch from 831b4fc to b7e359f Compare May 27, 2025 10:15
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@sashaweiss-signal
Copy link
Contributor

Hi, thanks for your interest. I believe this can also be achieved with the language/locale settings built into the Scheme editor, as described in https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html#//apple_ref/doc/uid/10000171i-CH7-SW2.

Screenshot 2025-08-26 at 09 58 53

That'd be the preferred approach here. Even better, I think, would be to make the tests that are locale-specific specify the locale during the test run.

I'll add this to our internal issue tracker, with an eye towards ideally isolating the Locale-specific tests and otherwise using the Scheme Editor options.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this change is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants