Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
osx_image: xcode8.2
osx_image: xcode8.3
language: objective-c
xcode_workspace: FirebaseUI.xcworkspace
xcode_scheme: FirebaseUI
cache:
- bundler
- cocoapods

rvm: 2.3.1
before_install:
- gem uninstall cocoapods -a
- gem install cocoapods -v 1.2.0
- open -a "simulator" --args -CurrentDeviceUDID 1FC0DC01-6B14-4A81-9F05-E337EEDC11B2
- bundle install
- gem install xcpretty
- pod install --repo-update
- bundle exec pod install --repo-update

script: ./test.sh
1,130 changes: 2 additions & 1,128 deletions FirebaseUI.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
skipped = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C329B15A1DA8694A00059A13"
Expand Down
103 changes: 103 additions & 0 deletions FirebaseUI.xcodeproj/xcshareddata/xcschemes/FirebaseUISample.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C329B1371DA8694A00059A13"
BuildableName = "FirebaseUISample.app"
BlueprintName = "FirebaseUISample"
ReferencedContainer = "container:FirebaseUI.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C329B15A1DA8694A00059A13"
BuildableName = "FirebaseUISampleUITests.xctest"
BlueprintName = "FirebaseUISampleUITests"
ReferencedContainer = "container:FirebaseUI.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C329B1371DA8694A00059A13"
BuildableName = "FirebaseUISample.app"
BlueprintName = "FirebaseUISample"
ReferencedContainer = "container:FirebaseUI.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
language = "en"
region = "US">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C329B1371DA8694A00059A13"
BuildableName = "FirebaseUISample.app"
BlueprintName = "FirebaseUISample"
ReferencedContainer = "container:FirebaseUI.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C329B1371DA8694A00059A13"
BuildableName = "FirebaseUISample.app"
BlueprintName = "FirebaseUISample"
ReferencedContainer = "container:FirebaseUI.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion FirebaseUISample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>en_US</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
148 changes: 76 additions & 72 deletions FirebaseUISampleUITests/FirebaseUISampleUITests.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,176 +28,180 @@ - (void) forceTap {
@end

@interface FirebaseUISampleUITests : XCTestCase

@property (nonatomic, strong) XCUIApplication *app;
@end

@implementation FirebaseUISampleUITests

- (void)setUp {
[super setUp];
self.continueAfterFailure = NO;
[[[XCUIApplication alloc] init] launch];
[super setUp];
self.continueAfterFailure = NO;
self.app = [[XCUIApplication alloc] init];

// force US locale on travis
self.app.launchArguments = @[
@"-inUITest",
@"-AppleLanguages", @"(en)",
@"-AppleLocale", @"en_US",
];

[self.app launch];
}

- (void)tearDown {
[self.app terminate];
[super tearDown];
}

- (void)testSuccesSignIn {
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
- (void)testSuccessSignIn {
XCUIElementQuery *tablesQuery = self.app.tables;
[tablesQuery.cells.staticTexts[@"Simulate Existing User"] tap];
[app.toolbars.buttons[@"Sign In"] tap];
[self.app.toolbars.buttons[@"Sign In"] tap];
[tablesQuery.cells[@"EmailCellAccessibilityID"].textFields[@"Enter your email"] tap];
[[tablesQuery.cells[@"EmailCellAccessibilityID"] childrenMatchingType:XCUIElementTypeTextField].element typeText:@"test@test.com"];
[app.navigationBars[@"Sign in with email"].buttons[@"NextButtonAccessibilityID"] tap];
[self.app.navigationBars[@"Sign in with email"].buttons[@"NextButtonAccessibilityID"] tap];
[tablesQuery.secureTextFields[@"Enter your password"] tap];
[[[tablesQuery.cells containingType:XCUIElementTypeStaticText identifier:@"Password"] childrenMatchingType:XCUIElementTypeSecureTextField].element typeText:@"test"];
[app.navigationBars[@"Sign in"].buttons[@"Sign in"] tap];
[self.app.navigationBars[@"Sign in"].buttons[@"Sign in"] tap];
}

- (void)testSuccesSignUp {
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
- (void)testSuccessSignUp {
XCUIElementQuery *tablesQuery = self.app.tables;
[tablesQuery.staticTexts[@"Simulate New User"] tap];
[app.toolbars.buttons[@"Sign In"] tap];
[self.app.toolbars.buttons[@"Sign In"] tap];

[tablesQuery.cells[@"EmailCellAccessibilityID"].textFields[@"Enter your email"] tap];
[[tablesQuery.cells[@"EmailCellAccessibilityID"] childrenMatchingType:XCUIElementTypeTextField].element typeText:@"test2@test2.com"];
[app.navigationBars[@"Sign in with email"].buttons[@"NextButtonAccessibilityID"] tap];
[self.app.navigationBars[@"Sign in with email"].buttons[@"NextButtonAccessibilityID"] tap];
[tablesQuery.cells[@"NameSignUpCellAccessibilityID"].textFields[@"First & last name"] tap];
[[tablesQuery.cells[@"NameSignUpCellAccessibilityID"] childrenMatchingType:XCUIElementTypeTextField].element typeText:@"test2"];

[tablesQuery.cells[@"PasswordSignUpCellAccessibilityID"].secureTextFields[@"Choose password"] tap];
[[tablesQuery.secureTextFields containingType:XCUIElementTypeButton identifier:@"ic visibility"].element typeText:@"test"];
[tablesQuery.buttons[@"ic visibility"] tap];
[tablesQuery.buttons[@"ic visibility off"] tap];
[app.navigationBars[@"Create account"].buttons[@"SaveButtonAccessibilityID"] tap];
[self.app.navigationBars[@"Create account"].buttons[@"SaveButtonAccessibilityID"] tap];
}

- (void)testSeveralIDPs {

XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
XCUIElementQuery *tablesQuery = self.app.tables;
[tablesQuery.cells.staticTexts[@"Google"] tap];
[tablesQuery.cells.staticTexts[@"Simulate Existing User"] tap];
[app.toolbars.buttons[@"Sign In"] tap];
[app.buttons[@"EmailButtonAccessibilityID"] tap];
[self.app.toolbars.buttons[@"Sign In"] tap];
[self.app.buttons[@"EmailButtonAccessibilityID"] tap];
[tablesQuery.cells[@"EmailCellAccessibilityID"].textFields[@"Enter your email"] tap];
[[tablesQuery.cells[@"EmailCellAccessibilityID"] childrenMatchingType:XCUIElementTypeTextField].element typeText:@"test@test.com"];

XCUIElement *signInWithEmailNavigationBar = app.navigationBars[@"Sign in with email"];
XCUIElement *signInWithEmailNavigationBar = self.app.navigationBars[@"Sign in with email"];
[signInWithEmailNavigationBar.buttons[@"NextButtonAccessibilityID"] tap];
[[[[app.navigationBars[@"Sign in"] childrenMatchingType:XCUIElementTypeButton] matchingIdentifier:@"Back"] elementBoundByIndex:0] tap];
[[[[self.app.navigationBars[@"Sign in"] childrenMatchingType:XCUIElementTypeButton] matchingIdentifier:@"Back"] elementBoundByIndex:0] tap];
[[[[signInWithEmailNavigationBar childrenMatchingType:XCUIElementTypeButton] matchingIdentifier:@"Back"] elementBoundByIndex:0] tap];
[app.navigationBars[@"Welcome"].buttons[@"Cancel"] tap];
[app.alerts[@"Error"].buttons[@"Close"] tap];
[self.app.navigationBars[@"Welcome"].buttons[@"Cancel"] tap];
[self.app.alerts[@"Error"].buttons[@"Close"] tap];
}

- (void)testEmailRecovery {

XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
XCUIElementQuery *tablesQuery = self.app.tables;
[tablesQuery.cells.staticTexts[@"Simulate Email Recovery"] tap];
[app.toolbars.buttons[@"Sign In"] tap];
[self.app.toolbars.buttons[@"Sign In"] tap];

XCUIElement *enterYourEmailTextField = tablesQuery.cells[@"EmailCellAccessibilityID"].textFields[@"Enter your email"];
[enterYourEmailTextField tap];
[enterYourEmailTextField tap];
[[tablesQuery.cells[@"EmailCellAccessibilityID"] childrenMatchingType:XCUIElementTypeTextField].element typeText:@"test@test.com"];

XCUIElement *signInWithEmailNavigationBar = app.navigationBars[@"Sign in with email"];
XCUIElement *signInWithEmailNavigationBar = self.app.navigationBars[@"Sign in with email"];
[signInWithEmailNavigationBar.buttons[@"NextButtonAccessibilityID"] tap];
[tablesQuery.secureTextFields[@"Enter your password"] tap];
[tablesQuery.buttons[@"Trouble signing in?"] tap];

XCUIElement *recoverPasswordNavigationBar = app.navigationBars[@"Recover password"];
XCUIElement *recoverPasswordNavigationBar = self.app.navigationBars[@"Recover password"];
[recoverPasswordNavigationBar.buttons[@"Send"] tap];
XCUIElement *okButton = app.alerts.buttons[@"OK"];
XCUIElement *okButton = self.app.alerts.buttons[@"OK"];
[okButton tap];
[[[[recoverPasswordNavigationBar childrenMatchingType:XCUIElementTypeButton] matchingIdentifier:@"Back"] elementBoundByIndex:0] tap];
[[[[app.navigationBars[@"Sign in"] childrenMatchingType:XCUIElementTypeButton] matchingIdentifier:@"Back"] elementBoundByIndex:0] tap];
[[[[self.app.navigationBars[@"Sign in"] childrenMatchingType:XCUIElementTypeButton] matchingIdentifier:@"Back"] elementBoundByIndex:0] tap];
[signInWithEmailNavigationBar.buttons[@"Cancel"] tap];
[app.alerts[@"Error"].buttons[@"Close"] tap];
[self.app.alerts[@"Error"].buttons[@"Close"] tap];

}

- (void)testPhoneAuthCoutryPicker {
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
- (void)testPhoneAuthCountryPicker {
XCUIElementQuery *tablesQuery = self.app.tables;

[tablesQuery.cells.staticTexts[@"Phone"] tap];
[app.toolbars.buttons[@"Sign In"] tap];
[app.buttons[@"Sign in with phone"] tap];
[self.app.toolbars.buttons[@"Sign In"] tap];
[self.app.buttons[@"Sign in with phone"] tap];

[tablesQuery.staticTexts[@"Country"] tap];

[app.tables.cells.staticTexts[@"\U0001F1E6\U0001F1F8 American Samoa"] tap];
[self.app.tables.cells.staticTexts[@"\U0001F1E6\U0001F1F8 American Samoa"] tap];

[tablesQuery.staticTexts[@"Country"] tap];
[app.tables.searchFields[@"Search"] tap];
[app.searchFields[@"Search"] typeText:@"united"];
[self.app.tables.searchFields[@"Search"] tap];
[self.app.searchFields[@"Search"] typeText:@"united"];

[app.tables.cells.staticTexts[@"\U0001F1FA\U0001F1F8 United States"] forceTap];
[self.app.tables.cells.staticTexts[@"\U0001F1FA\U0001F1F8 United States"] forceTap];

[app.navigationBars[@"Enter phone number"].buttons[@"Cancel"] tap];
[app.navigationBars[@"Welcome"].buttons[@"Cancel"] tap];
[app.alerts[@"Error"].buttons[@"Close"] tap];
[self.app.navigationBars[@"Enter phone number"].buttons[@"Cancel"] tap];
[self.app.navigationBars[@"Welcome"].buttons[@"Cancel"] tap];
[self.app.alerts[@"Error"].buttons[@"Close"] tap];
}

- (void)testPhoneAuthFlow {
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
XCUIElementQuery *tablesQuery = self.app.tables;

[tablesQuery.cells.staticTexts[@"Phone"] tap];
[app.toolbars.buttons[@"Sign In"] tap];
[app.buttons[@"Sign in with phone"] tap];
[self.app.toolbars.buttons[@"Sign In"] tap];
[self.app.buttons[@"Sign in with phone"] tap];

[tablesQuery.cells[@"PhoneNumberCellAccessibilityID"].textFields[@"Phone number"] tap];
[[tablesQuery.cells[@"PhoneNumberCellAccessibilityID"]
childrenMatchingType:XCUIElementTypeTextField].element typeText:@"123456789"];
[app.navigationBars[@"Enter phone number"].buttons[@"NextButtonAccessibilityID"] tap];
[self.app.navigationBars[@"Enter phone number"].buttons[@"NextButtonAccessibilityID"] tap];

[app.keyboards.keys[@"1"] tap];
[app.keyboards.keys[@"2"] tap];
[app.keyboards.keys[@"3"] tap];
[app.keyboards.keys[@"4"] tap];
[app.keyboards.keys[@"5"] tap];
[self.app.keyboards.keys[@"1"] tap];
[self.app.keyboards.keys[@"2"] tap];
[self.app.keyboards.keys[@"3"] tap];
[self.app.keyboards.keys[@"4"] tap];
[self.app.keyboards.keys[@"5"] tap];

XCUIElement *nextbuttonaccessibilityidButton =
app.navigationBars[@"Verify phone number"].buttons[@"NextButtonAccessibilityID"];
self.app.navigationBars[@"Verify phone number"].buttons[@"NextButtonAccessibilityID"];
[nextbuttonaccessibilityidButton tap];
[app.keyboards.keys[@"6"] tap];
[self.app.keyboards.keys[@"6"] tap];
[nextbuttonaccessibilityidButton tap];

}

- (void)testDirectPhoneAuthSignIn {
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElementQuery *tablesQuery = app.tables;
XCUIElementQuery *tablesQuery = self.app.tables;
[tablesQuery.cells.staticTexts[@"Phone"] tap];
[tablesQuery.cells.staticTexts[@"Email"] tap];

XCUIElement *signInButton = app.toolbars.buttons[@"Sign In"];
XCUIElement *signInButton = self.app.toolbars.buttons[@"Sign In"];
[signInButton tap];

XCUIElement *textField = [tablesQuery.cells[@"PhoneNumberCellAccessibilityID"]
childrenMatchingType:XCUIElementTypeTextField].element;
[textField typeText:@"1"];

XCUIElement *enterPhoneNumberNavigationBar = app.navigationBars[@"Enter phone number"];
XCUIElement *enterPhoneNumberNavigationBar = self.app.navigationBars[@"Enter phone number"];
XCUIElement *nextbuttonaccessibilityidButton =
enterPhoneNumberNavigationBar.buttons[@"NextButtonAccessibilityID"];
[nextbuttonaccessibilityidButton tap];
[app.buttons[@"+11"] tap];
[self.app.buttons[@"+11"] tap];
[enterPhoneNumberNavigationBar.buttons[@"Cancel"] tap];
[app.alerts[@"Error"].buttons[@"Close"] tap];
[self.app.alerts[@"Error"].buttons[@"Close"] tap];
[signInButton tap];
[textField typeText:@"2"];
[nextbuttonaccessibilityidButton tap];
[app.keyboards.keys[@"1"] tap];
[app.keyboards.keys[@"2"] tap];
[app.keyboards.keys[@"3"] tap];
[app.keyboards.keys[@"4"] tap];
[app.keyboards.keys[@"5"] tap];
[app.keyboards.keys[@"6"] tap];
[app.navigationBars[@"Verify phone number"].buttons[@"NextButtonAccessibilityID"] tap];
[self.app.keyboards.keys[@"1"] tap];
[self.app.keyboards.keys[@"2"] tap];
[self.app.keyboards.keys[@"3"] tap];
[self.app.keyboards.keys[@"4"] tap];
[self.app.keyboards.keys[@"5"] tap];
[self.app.keyboards.keys[@"6"] tap];
[self.app.navigationBars[@"Verify phone number"].buttons[@"NextButtonAccessibilityID"] tap];
[signInButton tap];
}

Expand Down
Loading