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

Add Localization UI Tests #1051

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ee2b9f4
Add a unit test that visits all screens in the Examples test app
aa-stripe Nov 29, 2018
318f1d3
Clean up some unused code, change shipping form test data
aa-stripe Nov 29, 2018
eaffa83
Remove crappy Xcode UI test tokens
aa-stripe Nov 29, 2018
8670e25
Change file name in comment
aa-stripe Nov 29, 2018
30cc38a
STPAddCardViewController strings all covered.
csabol-stripe Dec 14, 2018
5341802
Didn't need those. STPPaymentCardTextField covered
csabol-stripe Dec 14, 2018
b2128b3
Actually now all of STPAddCardViewController is covered
csabol-stripe Dec 14, 2018
893c1c6
STPPaymentMethodsViewController covered.
csabol-stripe Dec 14, 2018
8c9841a
All screens available, just need to visit them.
csabol-stripe Dec 14, 2018
ad2bbd6
Full coverage in tests
csabol-stripe Dec 14, 2018
be680d8
Autoscroll
csabol-stripe Dec 19, 2018
eecfa9a
Starting reverts
csabol-stripe Dec 19, 2018
5882b6b
Revert "Starting reverts"
csabol-stripe Dec 19, 2018
b9688af
Reverts unneeded changes
csabol-stripe Dec 19, 2018
c444be6
Suppress autoscrolling as needed
csabol-stripe Dec 19, 2018
0e02684
Add localizations to LocalizationTester
csabol-stripe Dec 19, 2018
a276eec
Adds screenshot script.
csabol-stripe Feb 6, 2019
6b39815
Updated translations.
csabol-stripe Feb 6, 2019
88c6c3f
Move the script.
csabol-stripe Feb 6, 2019
342b4f9
Permissions
csabol-stripe Feb 7, 2019
cd246b6
Suppress keyboard.
csabol-stripe Feb 7, 2019
2dd45d9
Use correct language codes
csabol-stripe Feb 7, 2019
a5494fd
Updates from review
csabol-stripe Feb 8, 2019
1586497
Merge branch 'master' into aa-stripe/add-localization-tests
csabol-stripe Mar 18, 2019
b4d9005
Pulls latest translations, fixes es-AR script issue.
csabol-stripe Mar 18, 2019
fb061b3
Fixes string file encoding. Payment method -> payment options
csabol-stripe Mar 18, 2019
2961ea0
Update reference snapshots for new translations
csabol-stripe Mar 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions LocalizationTester/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// AppDelegate.h
// LocalizationTester
//
// Created by Cameron Sabol on 12/11/18.
// Copyright © 2018 Stripe, Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;


@end

64 changes: 64 additions & 0 deletions LocalizationTester/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// AppDelegate.m
// LocalizationTester
//
// Created by Cameron Sabol on 12/11/18.
// Copyright © 2018 Stripe, Inc. All rights reserved.
//

#import "AppDelegate.h"

#import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

- (void)_keyboardDidShowNotification {
[((UINavigationController *)self.window.rootViewController).topViewController.view endEditing:YES];
}

- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions {

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_keyboardDidShowNotification) name:UIKeyboardDidShowNotification object:nil];

UIViewController *rootVC = [[ViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootVC];
UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
window.rootViewController = nav;
[window makeKeyAndVisible];
self.window = window;
return YES;
}


- (void)applicationWillResignActive:(__unused UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}


- (void)applicationDidEnterBackground:(__unused UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}


- (void)applicationWillEnterForeground:(__unused UIApplication *)application {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}


- (void)applicationDidBecomeActive:(__unused UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}


- (void)applicationWillTerminate:(__unused UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions LocalizationTester/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
25 changes: 25 additions & 0 deletions LocalizationTester/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
43 changes: 43 additions & 0 deletions LocalizationTester/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
15 changes: 15 additions & 0 deletions LocalizationTester/MockCustomerContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// MockCustomerContext.h
// LocalizationTester
//
// Created by Cameron Sabol on 12/14/18.
// Copyright © 2018 Stripe, Inc. All rights reserved.
//

#import <Stripe/Stripe.h>

@interface MockCustomerContext : STPCustomerContext

@property (nonatomic) BOOL neverRetrieveCustomer;

@end
Loading