Skip to content

chore(auth): fix web authn and push notifications integration tests - #4241

Merged
harsh62 merged 3 commits into
mainfrom
chore/fix-auth-integ-tests
Jun 30, 2026
Merged

chore(auth): fix web authn and push notifications integration tests#4241
harsh62 merged 3 commits into
mainfrom
chore/fix-auth-integ-tests

Conversation

@thisisabhash

@thisisabhash thisisabhash commented Jun 30, 2026

Copy link
Copy Markdown
Member

Issue #

Failing WebAuthN and Push Notification Integration tests

Description

Fixes three failing integration tests on CI caused by the Xcode 26.3 / watchOS 26.2 upgrade and the aws-sdk-swift 1.7.27 bump.

Changes

1. AuthWebAuthnApp — fix flaky system dialog detection

The test previously checked for an API error (1s timeout) and the system Continue button (6s timeout) as two separate sequential steps. If the Cognito startWebAuthnRegistration call was slow or transiently failed after the 1s window, the test would proceed to wait for a button that would never appear.

Restructured to wait for the ASAuthorizationControllerContinueButton directly inside the attempt retry loop (30s per attempt, up to 3 retries). This handles both slow network responses and transient API failures in a single pass.

2. PushNotificationsWatchApp / AnalyticsWatchApp — fix simulator installation on watchOS 26.2

Both standalone watch app targets had SKIP_INSTALL = YES. In Xcode 26.3, this prevents WKWatchOnly apps from being installed on the watchOS 26.2 simulator, causing FBSApplicationLibrary to return nil when the test runner attempts to launch them. Changed to SKIP_INSTALL = NO.

Files changed

  • AmplifyPlugins/Auth/Tests/AuthWebAuthnApp/AuthWebAuthnAppUITests/AuthWebAuthnAppUITests.swift
  • AmplifyPlugins/Analytics/Tests/AnalyticsHostApp/AnalyticsHostApp.xcodeproj/project.pbxproj
  • AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostApp.xcodeproj/project.pbxproj

Test plan

  • AuthWebAuthnApp UI test passes on iOS 18.5 (Xcode 16.4)
  • PushNotificationWatchTests passes on watchOS 26.2 (Xcode 26.3)
  • AnalyticsWatchApp tests pass on watchOS 26.2 (Xcode 26.3)
  • No regressions on iOS/tvOS integration tests

Test plan

  • AuthWebAuthnApp integration test passes on iOS 18.5 (Xcode 16.4)
  • PushNotificationWatchTests integration test passes on watchOS 26.2 (Xcode 26.3)
  • No regressions on iOS/tvOS push notification tests

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@thisisabhash
thisisabhash requested a review from a team as a code owner June 30, 2026 17:48
@thisisabhash
thisisabhash force-pushed the chore/fix-auth-integ-tests branch from 4c0bace to 32db683 Compare June 30, 2026 17:58
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.74%. Comparing base (7cc49bc) to head (1b74195).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4241      +/-   ##
==========================================
- Coverage   66.95%   66.74%   -0.21%     
==========================================
  Files        1151     1151              
  Lines       43869    43869              
==========================================
- Hits        29372    29280      -92     
- Misses      14497    14589      +92     
Flag Coverage Δ
API_plugin_unit_test 68.33% <ø> (+0.17%) ⬆️
AWSPluginsCore 68.07% <ø> (ø)
Amplify 47.47% <ø> (ø)
Amplify_Foundation_Bridge_unit_test 62.28% <ø> (ø)
Amplify_Foundation_unit_test 67.64% <ø> (ø)
Analytics_plugin_unit_test 83.43% <ø> (ø)
Auth_plugin_unit_test 72.36% <ø> (-0.17%) ⬇️
DataStore_plugin_unit_test 81.75% <ø> (-1.04%) ⬇️
Firehose_plugin_unit_test 53.15% <ø> (ø)
Geo_plugin_unit_test 73.39% <ø> (ø)
Kinesis_plugin_unit_test 52.17% <ø> (ø)
Logging_plugin_unit_test 64.86% <ø> (ø)
Predictions_plugin_unit_test 33.89% <ø> (ø)
PushNotifications_plugin_unit_test 85.66% <ø> (ø)
RecordCache_unit_test 76.40% <ø> (ø)
Storage_plugin_unit_test 78.67% <ø> (-0.03%) ⬇️
unit_tests 66.74% <ø> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants