From 360d6d0ee130f6a458c4cdadb539292f2b485903 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 17 Aug 2026 09:30:17 +0300 Subject: [PATCH] Attempt another kind of fix for the encryption settings UI test --- UITests/Sources/EncryptionSettingsTests.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/UITests/Sources/EncryptionSettingsTests.swift b/UITests/Sources/EncryptionSettingsTests.swift index 5f6949c53..ff96d35cb 100644 --- a/UITests/Sources/EncryptionSettingsTests.swift +++ b/UITests/Sources/EncryptionSettingsTests.swift @@ -32,10 +32,15 @@ class EncryptionSettingsUITests: XCTestCase { // Toggle key storage off. // app.switches[A11yIdentifiers.secureBackupScreen.keyStorage].tap() // Broken by https://github.com/element-hq/compound-ios/pull/140 - app.switches[A11yIdentifiers.secureBackupScreen.keyStorage].switches.firstMatch.tap() + let keyStorageToggle = app.switches[A11yIdentifiers.secureBackupScreen.keyStorage].switches.firstMatch + keyStorageToggle.tap() - // Has been failing often on CI, reasons unclear. - try await app.assertScreenshot(step: Step.keyBackupScreen, delay: .seconds(1)) + // The tap is occasionally lost on CI, retry it once. + if !app.buttons[A11yIdentifiers.secureBackupKeyBackupScreen.deleteKeyStorage].waitForExistence(timeout: 5) { + keyStorageToggle.tap() + } + + try await app.assertScreenshot(step: Step.keyBackupScreen) // Confirm deletion of keys. app.buttons[A11yIdentifiers.secureBackupKeyBackupScreen.deleteKeyStorage].tap()