Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XCUI] --env doesn't work for iOS xcuitest suites #398

Open
renaud-vmg opened this issue Aug 10, 2021 · 3 comments
Open

[XCUI] --env doesn't work for iOS xcuitest suites #398

renaud-vmg opened this issue Aug 10, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@renaud-vmg
Copy link
Contributor

Current behavior

The current behaviour of --env SOME=THING appears to not set environment variables "in" the device when launching a test (as is supported by xcodebuild-run tests). I can see USER, XPC_FLAGS, XPC_SERVICE_NAME and others, but additional --env-provided values seems to be broken.

Desired behavior

The expected behaviour is that using saucectl's --env SOME=THING cli option would set environment variables on the target as is being done by xcodebuild-driven testsé

Config to reproduce

Run any iOS xcuiapplication-based tests that print out the whole environment. Example code to do that in a setup method:

    for (NSString* key in [[NSProcessInfo processInfo] environment].allKeys) {
        NSLog(@"Full map reveal - key: %@", key);
        NSLog(@"Full map reveal - element: %@", [[NSProcessInfo processInfo] environment][key]);
        NSLog(@"==================================================");
    }

Versions

0.59.x

@renaud-vmg renaud-vmg changed the title [XCUI] --env doesn't work (and suite --env is unavailable) [XCUI] --env doesn't work for iOS xcuitest suites Aug 10, 2021
@alexplischke
Copy link
Contributor

Sorry, we need to better document this, but the ability to set env variables is not available for espresso/xcuitests. 🙏

@renaud-vmg
Copy link
Contributor Author

@alexplischke based on the above foreach loop, I still think there could be a backend change that would allow at least iOS env settings to be passed (as xcodebuild allows that locally). For the immediate term, I unfortunately might go with your suggestion, but on the long run this should be fixed in some way.

@alexplischke alexplischke added the enhancement New feature or request label Aug 14, 2021
@wswebcreation
Copy link

@renaud-vmg

Is this for Real or Virtual devices? We are working on supporting this for virtual as we speak. Real devices is harder due to the technology we use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants