-
Notifications
You must be signed in to change notification settings - Fork 484
test: SwiftUI integration tests and View tests for create user and sign-in #1257
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
584a8f9
chore: delete benchmark file
russellwheatley 5039d4b
firebase emulator setup
russellwheatley fe5d04e
example app test setup
russellwheatley a657fe1
test: createUser/sign in with email/password
russellwheatley 08e6900
chore: make signedInCredential public
russellwheatley efba6c3
test: add currentUser to test
russellwheatley 8a09f9a
test: rm name for unused var
russellwheatley 77a7a86
test: update setup logic
russellwheatley 9cad904
create random email address
russellwheatley 8207e1c
test: unit test updates
russellwheatley f1b7396
UI test runner scheme
russellwheatley be2a093
test: SignedInView UI when signing-in
russellwheatley 38d3113
test: create user UI flow
russellwheatley 08d7020
chore: rm comment
russellwheatley 85d3ff5
test: update test logic
russellwheatley ce618c6
test: create initial workflow for swiftui test runner
russellwheatley a4c69a2
chore: update emulator step in CI
russellwheatley 230392b
test: check correct port number
russellwheatley 3b1fd8e
test: use correct path
russellwheatley d89c443
test: improve test logs
russellwheatley 125e95e
test: bump uload-artifact
russellwheatley a83fd29
test: preserve exit code if test fails
russellwheatley c93af1f
test: add permissions to workflow
russellwheatley 649a723
Merge branch 'main' into swiftui-tests
russellwheatley 76be537
test: set ConnectHardwareKeyboard to 0 and reboot simulator
russellwheatley b0baad8
test: reload simulator to get new preferences
russellwheatley af16c22
test: try to create simulator for UI tests
russellwheatley e777220
test: rm arg
russellwheatley c3a57bb
test: rm creating simulator in CI
russellwheatley 7d8a8e3
test: workaround for SecureField bug where full string isn't typed
russellwheatley 1dcaf2a
chore: get xcresult from test failure
russellwheatley 03d50d1
ci: only upload if tests fail
russellwheatley ba6d0bc
test: further UI View tests
russellwheatley 61f13fb
ci: rename xcresult folder
russellwheatley 3851eab
test: increase timeout waiting for visible element
russellwheatley 9a8ac32
test: increase timeout for element
russellwheatley e8dc34d
test: upload FirebaseSwiftUIExampleTests on failure
russellwheatley 69b4901
chore: improve logic
russellwheatley 758fe3f
Merge branch 'main' into swiftui-tests
russellwheatley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: SwiftUI Auth | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/swiftui-auth.yml' | ||
- 'samples/swiftui/**' | ||
- 'FirebaseSwiftUI/**' | ||
- 'Package.swift' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/swiftui-auth.yml' | ||
- 'samples/swiftui/**' | ||
- 'FirebaseSwiftUI/**' | ||
- 'Package.swift' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
swiftui-auth: | ||
runs-on: macOS-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | ||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a | ||
name: Install Node.js 20 | ||
with: | ||
node-version: '20' | ||
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Install Firebase | ||
run: | | ||
sudo npm i -g firebase-tools | ||
- name: Start Firebase Emulator | ||
run: | | ||
sudo chown -R 501:20 "/Users/runner/.npm" && cd ./samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample && ./start-firebase-emulator.sh | ||
- name: Install xcpretty | ||
run: gem install xcpretty | ||
- name: Select Xcode version | ||
run: | | ||
sudo xcode-select -switch /Applications/Xcode_16.1.app/Contents/Developer | ||
- name: Disable iOS Simulator hardware keyboard | ||
# needed for SecureFields otherwise the UI flow tests will fail | ||
run: | | ||
defaults delete com.apple.iphonesimulator ConnectHardwareKeyboard || true | ||
- name: Run Integration Tests | ||
run: | | ||
cd ./samples/swiftui/FirebaseSwiftUIExample | ||
xcodebuild test -scheme FirebaseSwiftUIExampleTests -destination 'platform=iOS Simulator,name=iPhone 16 Plus' -enableCodeCoverage YES | tee FirebaseSwiftUIExampleTests.log | xcpretty --test --color --simple | ||
- name: Run View UI Tests | ||
run: | | ||
cd ./samples/swiftui/FirebaseSwiftUIExample | ||
xcodebuild test -scheme FirebaseSwiftUIExampleUITests -destination 'platform=iOS Simulator,name=iPhone 16 Plus' -enableCodeCoverage YES | tee FirebaseSwiftUIExampleUITests.log | xcpretty --test --color --simple | ||
- name: Upload test logs | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: swiftui-auth-test-logs | ||
path: | | ||
samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleTests.log | ||
samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleUITests.log | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...ebaseSwiftUIExample.xcodeproj/xcshareddata/xcschemes/FirebaseSwiftUIExampleTests.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1620" | ||
version = "1.7"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES" | ||
buildArchitectures = "Automatic"> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
shouldAutocreateTestPlan = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO" | ||
parallelizable = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "46F89C192D64A86D000F8BC0" | ||
BuildableName = "FirebaseSwiftUIExampleTests.xctest" | ||
BlueprintName = "FirebaseSwiftUIExampleTests" | ||
ReferencedContainer = "container:FirebaseSwiftUIExample.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</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"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
55 changes: 55 additions & 0 deletions
55
...aseSwiftUIExample.xcodeproj/xcshareddata/xcschemes/FirebaseSwiftUIExampleUITests.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1620" | ||
version = "1.7"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES" | ||
buildArchitectures = "Automatic"> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
shouldAutocreateTestPlan = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO" | ||
parallelizable = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "46F89C232D64A86D000F8BC0" | ||
BuildableName = "FirebaseSwiftUIExampleUITests.xctest" | ||
BlueprintName = "FirebaseSwiftUIExampleUITests" | ||
ReferencedContainer = "container:FirebaseSwiftUIExample.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</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"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
5 changes: 5 additions & 0 deletions
5
samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample/.firebaserc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "flutterfire-e2e-tests" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.