From 1de9f28f3ce343749763fa7f4a2c0febd88d74c1 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Tue, 26 Mar 2024 09:31:25 +0100 Subject: [PATCH] fix(MailUITests): Avoid unnecessary waiting --- MailUITests/MailUITests.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MailUITests/MailUITests.swift b/MailUITests/MailUITests.swift index daa09faf1f..f6600281d9 100644 --- a/MailUITests/MailUITests.swift +++ b/MailUITests/MailUITests.swift @@ -170,8 +170,13 @@ class MailUITests: XCTestCase { func undo() { let cancelButton = app.buttons[MailResourcesStrings.Localizable.buttonCancel] - _ = cancelButton.waitForExistence(timeout: 10) - cancelButton.tap() + if cancelButton.exists { + cancelButton.tap() + } else { + _ = cancelButton.waitForExistence(timeout: 10) + + cancelButton.tap() + } } func swipeFirstCell() {