Skip to content

Commit 9234d77

Browse files
authored
Add end to end integration tests with RC+ABT (#5636)
* Add ABT integration testing app * Fix formatting * Run scripts/style.sh * Fix Podfile to pull in dev versions of ABT, Remote config, and Core * Fake values in GoogleService-Info.plist
1 parent 5f5b65a commit 9234d77

File tree

12 files changed

+1189
-0
lines changed

12 files changed

+1189
-0
lines changed

FirebaseABTesting/Tests/Integration/ABTQA.xcodeproj/project.pbxproj

Lines changed: 643 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1140"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "255D24A0243E32BB00198B35"
18+
BuildableName = "ABTQA.app"
19+
BlueprintName = "ABTQA"
20+
ReferencedContainer = "container:ABTQA.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "255D24B6243E32BE00198B35"
36+
BuildableName = "ABTQATests.xctest"
37+
BlueprintName = "ABTQATests"
38+
ReferencedContainer = "container:ABTQA.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
<TestableReference
42+
skipped = "NO">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "255D24C1243E32BE00198B35"
46+
BuildableName = "ABTQAUITests.xctest"
47+
BlueprintName = "ABTQAUITests"
48+
ReferencedContainer = "container:ABTQA.xcodeproj">
49+
</BuildableReference>
50+
</TestableReference>
51+
</Testables>
52+
</TestAction>
53+
<LaunchAction
54+
buildConfiguration = "Debug"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
launchStyle = "0"
58+
useCustomWorkingDirectory = "NO"
59+
ignoresPersistentStateOnLaunch = "NO"
60+
debugDocumentVersioning = "YES"
61+
debugServiceExtension = "internal"
62+
allowLocationSimulation = "YES">
63+
<BuildableProductRunnable
64+
runnableDebuggingMode = "0">
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "255D24A0243E32BB00198B35"
68+
BuildableName = "ABTQA.app"
69+
BlueprintName = "ABTQA"
70+
ReferencedContainer = "container:ABTQA.xcodeproj">
71+
</BuildableReference>
72+
</BuildableProductRunnable>
73+
<CommandLineArguments>
74+
<CommandLineArgument
75+
argument = "-FIRDebugEnabled"
76+
isEnabled = "YES">
77+
</CommandLineArgument>
78+
</CommandLineArguments>
79+
</LaunchAction>
80+
<ProfileAction
81+
buildConfiguration = "Release"
82+
shouldUseLaunchSchemeArgsEnv = "YES"
83+
savedToolIdentifier = ""
84+
useCustomWorkingDirectory = "NO"
85+
debugDocumentVersioning = "YES">
86+
<BuildableProductRunnable
87+
runnableDebuggingMode = "0">
88+
<BuildableReference
89+
BuildableIdentifier = "primary"
90+
BlueprintIdentifier = "255D24A0243E32BB00198B35"
91+
BuildableName = "ABTQA.app"
92+
BlueprintName = "ABTQA"
93+
ReferencedContainer = "container:ABTQA.xcodeproj">
94+
</BuildableReference>
95+
</BuildableProductRunnable>
96+
</ProfileAction>
97+
<AnalyzeAction
98+
buildConfiguration = "Debug">
99+
</AnalyzeAction>
100+
<ArchiveAction
101+
buildConfiguration = "Release"
102+
revealArchiveInOrganizer = "YES">
103+
</ArchiveAction>
104+
</Scheme>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2020 Google
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import UIKit
18+
import Firebase
19+
20+
@UIApplicationMain
21+
class AppDelegate: UIResponder, UIApplicationDelegate {
22+
func application(_ application: UIApplication,
23+
didFinishLaunchingWithOptions
24+
launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
25+
// Override point for customization after application launch.
26+
FirebaseApp.configure()
27+
return true
28+
}
29+
30+
func application(_ application: UIApplication,
31+
configurationForConnecting connectingSceneSession: UISceneSession,
32+
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
33+
return UISceneConfiguration(name: "Default Configuration",
34+
sessionRole: connectingSceneSession.role)
35+
}
36+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"scale" : "2x",
6+
"size" : "20x20"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"scale" : "3x",
11+
"size" : "20x20"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"scale" : "2x",
16+
"size" : "29x29"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"scale" : "3x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"scale" : "2x",
26+
"size" : "40x40"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"scale" : "3x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"scale" : "2x",
36+
"size" : "60x60"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"scale" : "3x",
41+
"size" : "60x60"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"scale" : "1x",
46+
"size" : "20x20"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"scale" : "2x",
51+
"size" : "20x20"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"scale" : "1x",
56+
"size" : "29x29"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"scale" : "2x",
61+
"size" : "29x29"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"scale" : "1x",
66+
"size" : "40x40"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"scale" : "2x",
71+
"size" : "40x40"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"scale" : "1x",
76+
"size" : "76x76"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"scale" : "2x",
81+
"size" : "76x76"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"scale" : "2x",
86+
"size" : "83.5x83.5"
87+
},
88+
{
89+
"idiom" : "ios-marketing",
90+
"scale" : "1x",
91+
"size" : "1024x1024"
92+
}
93+
],
94+
"info" : {
95+
"author" : "xcode",
96+
"version" : 1
97+
}
98+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="EHf-IW-A2E">
11+
<objects>
12+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
14+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
17+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
18+
</view>
19+
</viewController>
20+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
21+
</objects>
22+
<point key="canvasLocation" x="53" y="375"/>
23+
</scene>
24+
</scenes>
25+
</document>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
6+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<scenes>
10+
<!--View Controller-->
11+
<scene sceneID="tne-QT-ifu">
12+
<objects>
13+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="ABTQA" customModuleProvider="target" sceneMemberID="viewController">
14+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
15+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
16+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17+
<subviews>
18+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="leJ-st-KAV">
19+
<rect key="frame" x="22" y="174" width="370" height="130.5"/>
20+
<string key="text">This will make a call to fetch the latest values from Remote Config. This project has a running A/B test with a parameter `bg_color`. Based on the result, the background color of the screen with either turn red or green based on variant assignment.</string>
21+
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
22+
<nil key="textColor"/>
23+
<nil key="highlightedColor"/>
24+
</label>
25+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KLS-Wd-htS">
26+
<rect key="frame" x="62.5" y="124" width="289" height="42"/>
27+
<fontDescription key="fontDescription" type="system" pointSize="25"/>
28+
<state key="normal" title="Fetch remote config values"/>
29+
<connections>
30+
<action selector="checkTestButtonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="tbq-Rk-knJ"/>
31+
</connections>
32+
</button>
33+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PD9-Py-SZW">
34+
<rect key="frame" x="52" y="427" width="310" height="42"/>
35+
<fontDescription key="fontDescription" type="system" pointSize="25"/>
36+
<state key="normal" title="Fire a custom analytics event"/>
37+
<connections>
38+
<action selector="fireAnalyticsEventButtonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="kgU-vo-FSg"/>
39+
</connections>
40+
</button>
41+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="This opens a text field where you can enter the name of a custom analytics event, which will then be fired." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XJp-Bw-Rfp">
42+
<rect key="frame" x="20" y="477" width="374" height="64.5"/>
43+
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
44+
<nil key="textColor"/>
45+
<nil key="highlightedColor"/>
46+
</label>
47+
</subviews>
48+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
49+
<constraints>
50+
<constraint firstItem="XJp-Bw-Rfp" firstAttribute="top" secondItem="PD9-Py-SZW" secondAttribute="bottom" constant="8" id="GGg-up-bp6"/>
51+
<constraint firstItem="PD9-Py-SZW" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="Hlb-Oc-fRL"/>
52+
<constraint firstItem="KLS-Wd-htS" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="IYs-Wo-iR7"/>
53+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="leJ-st-KAV" secondAttribute="trailing" constant="20" id="Ji6-Oq-YP4"/>
54+
<constraint firstItem="PD9-Py-SZW" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="MMF-eJ-aK8"/>
55+
<constraint firstItem="XJp-Bw-Rfp" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="OVz-W2-lIw"/>
56+
<constraint firstItem="leJ-st-KAV" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="20" id="PpX-Ah-EAp"/>
57+
<constraint firstItem="XJp-Bw-Rfp" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="20" id="YYV-YD-dRt"/>
58+
<constraint firstItem="leJ-st-KAV" firstAttribute="top" secondItem="KLS-Wd-htS" secondAttribute="bottom" constant="8" id="ghI-kV-JTk"/>
59+
<constraint firstItem="leJ-st-KAV" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="mDt-we-Cds"/>
60+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="XJp-Bw-Rfp" secondAttribute="trailing" constant="20" id="ndW-B7-DAa"/>
61+
<constraint firstItem="KLS-Wd-htS" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="80" id="rE4-d6-WYc"/>
62+
</constraints>
63+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
64+
</view>
65+
</viewController>
66+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
67+
</objects>
68+
<point key="canvasLocation" x="139" y="118"/>
69+
</scene>
70+
</scenes>
71+
</document>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CLIENT_ID</key>
6+
<string>correct_client_id</string>
7+
<key>REVERSED_CLIENT_ID</key>
8+
<string>correct_reversed_client_id</string>
9+
<key>API_KEY</key>
10+
<string>correct_api_key</string>
11+
<key>GCM_SENDER_ID</key>
12+
<string>correct_gcm_sender_id</string>
13+
<key>PLIST_VERSION</key>
14+
<string>1</string>
15+
<key>BUNDLE_ID</key>
16+
<string>com.firebase.ABTQA</string>
17+
<key>PROJECT_ID</key>
18+
<string>abt-qa</string>
19+
<key>STORAGE_BUCKET</key>
20+
<string>project-id-123.storage.firebase.com</string>
21+
<key>IS_ADS_ENABLED</key>
22+
<false></false>
23+
<key>IS_ANALYTICS_ENABLED</key>
24+
<false></false>
25+
<key>IS_APPINVITE_ENABLED</key>
26+
<true></true>
27+
<key>IS_GCM_ENABLED</key>
28+
<true></true>
29+
<key>IS_SIGNIN_ENABLED</key>
30+
<true></true>
31+
<key>GOOGLE_APP_ID</key>
32+
<string>1:123:ios:123abc</string>
33+
<key>DATABASE_URL</key>
34+
<string>https://abc-xyz-123.firebaseio.com</string>
35+
</dict>
36+
</plist>

0 commit comments

Comments
 (0)