Xcode 7 UITests with localized UI

后端 未结 11 963
既然无缘
既然无缘 2020-12-07 17:38

In my App I\'m using NSLocalizedString to localize my app. Now I want to switch to UITests and habe Testcode like this:

[tabBarsQue         


        
11条回答
  •  渐次进展
    2020-12-07 18:01

    In addition to Joe's answer you can also force language for UI tests directly in test code without editing a scheme like this:

    - (void)setUp
    {
        [super setUp];
    
        self.continueAfterFailure = NO;
        XCUIApplication *app = [[XCUIApplication alloc] init];
        app.launchArguments = @[@"-AppleLanguages", @"(en)", @"-AppleLocale", @"en_EN"];
        [app launch];
    }
    

提交回复
热议问题