MarathonLabs / marathon

Cross-platform test runner
https://docs.marathonlabs.io
GNU General Public License v2.0
577 stars 120 forks source link

iOS: Ability to set simulator's locale before tests #906

Open Nemorokr opened 6 months ago

Nemorokr commented 6 months ago

Is your feature request related to a problem? Please describe. Need to be able to set simulator's locale before starting tests

Describe the solution you'd like Maybe some sort of config inside Vendor's block of Marathonfile

Describe alternatives you've considered N/A

Additional context N/A

matzuk commented 6 months ago

You can use xcodebuild test-without-building arguments.

For example, your marathonfile may look like:

name: "My application"
outputDir: "derived-data/Marathon"
vendorConfiguration:
  type: "iOS"
  xcodebuildTestArgs:
    "-testLanguage": "fr"
    "-testRegion": "FR"
  bundle:
    application: "sample.zip"
    testApplication: "sampleUITests-Runner.zip"
    testType: xcuitest
Nemorokr commented 6 months ago

These settings are for app's language. My request was about simulator's language

matzuk commented 6 months ago

@Nemorokr, could you provide an example of where these settings may be used and which cases may be covered? I mean real cases from your current experience, not theoretical cases.

danmir commented 6 months ago

Hello Our cases with simulator's language

Malinskiy commented 6 months ago

I'm pretty sure you can hardcode your language in the test app, get bundle resources for that language andget the appropriate title for the language. You essentially hardcode via environment setup, but your code should be flexible and detect which language it's using and use appropriate ones, i.e. for interacting with the app use one language and for the rest of interaction with the system - device's locale. That said, we're going to look into this issue

Also, can you please create issue(s) with additional permissions needed?