Skip to content

Commit 7c33f91

Browse files
ci(e2e/ios): exclude real social-login test from CI (mirror SDK hosted:no-social)
The Google social-login smoke test drives a real ASWebAuthenticationSession that can't complete headlessly on a CI simulator. The frontegg-ios-swift SDK handles this by running its E2E with the "hosted:no-social" suite — it excludes the real system-web-auth social test from the standard pipeline. Mirror that: build + run in Release (app embeds main.jsbundle, no Metro) and skip LoginViaGoogleTest via -skip-testing. Reverts the Debug+FORCE_BUNDLING+mock-transport attempt, since the SDK does not run real social in CI at all. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 72a9823 commit 7c33f91

4 files changed

Lines changed: 10 additions & 19 deletions

File tree

.github/workflows/react-native-sdk-e2e.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,27 @@ jobs:
188188
build-for-testing \
189189
-workspace ReactNativeExample.xcworkspace \
190190
-scheme ReactNativeExample \
191+
-configuration Release \
191192
-destination "platform=iOS Simulator,name=iPhone 16" \
192193
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
193194
CODE_SIGNING_ALLOWED=NO \
194-
FORCE_BUNDLING=1 \
195195
2>&1 | tee "$RUNNER_TEMP/build.log"
196196
197197
- name: Run UI tests
198198
working-directory: example/ios
199199
run: |
200200
set -o pipefail
201+
# Exclude the real social-login test from CI: it drives a real
202+
# ASWebAuthenticationSession that can't complete headlessly on a simulator.
203+
# This mirrors the frontegg-ios-swift SDK E2E, which runs the
204+
# "hosted:no-social" suite and excludes real system-web-auth social login.
201205
xcodebuild \
202206
test-without-building \
203207
-workspace ReactNativeExample.xcworkspace \
204208
-scheme ReactNativeExample \
209+
-configuration Release \
205210
-only-testing:ReactNativeExampleUITests \
211+
-skip-testing:ReactNativeExampleUITests/LoginViaGoogleTest \
206212
-destination "platform=iOS Simulator,name=iPhone 16" \
207213
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
208214
-resultBundlePath "$RUNNER_TEMP/ios-e2e.xcresult" \

example/ios/ReactNativeExample/AppDelegate.mm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull N
4949
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
5050
{
5151
#if DEBUG
52-
// Under E2E tests the JS bundle is embedded (FORCE_BUNDLING) and Metro is not running,
53-
// while the SDK's mock web-auth transport requires a DEBUG build. So in a testing launch
54-
// prefer the embedded bundle; fall back to Metro for normal development.
55-
if ([[[NSProcessInfo processInfo] environment][@"frontegg-testing"] isEqualToString:@"true"]) {
56-
NSURL *embeddedBundleURL = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
57-
if (embeddedBundleURL != nil) {
58-
return embeddedBundleURL;
59-
}
60-
}
6152
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
6253
#else
6354
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

example/ios/ReactNativeExampleUITests/LoginViaGoogleTest.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import XCTest
44
/// the app survives tapping it.
55
final class LoginViaGoogleTest: UITestCase {
66
func test_social_login_button_is_reachable() throws {
7-
// Use the SDK's mock web-auth transport (DEBUG-only) so the social flow completes
8-
// against the local mock server instead of a real ASWebAuthenticationSession, which
9-
// can't be driven headlessly in CI.
10-
launchApp(useTestingWebAuthenticationTransport: true)
7+
launchApp()
118
let button = app.buttons["loginWithGoogleButton"]
129
waitFor(button, timeout: 10)
1310
button.tap()

example/ios/ReactNativeExampleUITests/UITestCase.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,11 @@ class UITestCase: XCTestCase {
5050
// MARK: - Launch
5151

5252
@discardableResult
53-
func launchApp(
54-
resetState: Bool = true,
55-
useTestingWebAuthenticationTransport: Bool = false
56-
) -> XCUIApplication {
53+
func launchApp(resetState: Bool = true) -> XCUIApplication {
5754
let app = XCUIApplication()
5855
app.launchEnvironment = Self.server.launchEnvironment(
5956
resetState: resetState,
60-
useTestingWebAuthenticationTransport: useTestingWebAuthenticationTransport
57+
useTestingWebAuthenticationTransport: false
6158
)
6259
app.launch()
6360
self.app = app

0 commit comments

Comments
 (0)