From e736c28d394f53cae2e71fd477891c5fc0080692 Mon Sep 17 00:00:00 2001 From: Joao Dordio Date: Mon, 16 Dec 2024 19:07:32 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Potential=20fix=20for=20the=20fl?= =?UTF-8?q?aky=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/inbox-ui-tests/InboxCustomizationTests.swift | 5 +++-- tests/inbox-ui-tests/InboxUITests.swift | 3 ++- tests/inbox-ui-tests/NavInboxSessionUITests.swift | 3 ++- tests/inbox-ui-tests/PopupInboxSessionUITests.swift | 3 ++- tests/ui-tests/UITestsHelper.swift | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/inbox-ui-tests/InboxCustomizationTests.swift b/tests/inbox-ui-tests/InboxCustomizationTests.swift index 1b510e209..0151f3c9c 100644 --- a/tests/inbox-ui-tests/InboxCustomizationTests.swift +++ b/tests/inbox-ui-tests/InboxCustomizationTests.swift @@ -7,11 +7,12 @@ import XCTest @testable import IterableSDK class InboxCustomizationTests: XCTestCase, IterableInboxUITestsProtocol { - lazy var app: XCUIApplication! = UITestsGlobal.application - + internal var app: XCUIApplication! override func setUp() { // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false + app = XCUIApplication() + app.launch() clearNetwork() } diff --git a/tests/inbox-ui-tests/InboxUITests.swift b/tests/inbox-ui-tests/InboxUITests.swift index 6deb80b0c..b62676569 100644 --- a/tests/inbox-ui-tests/InboxUITests.swift +++ b/tests/inbox-ui-tests/InboxUITests.swift @@ -12,7 +12,8 @@ class InboxUITests: XCTestCase, IterableInboxUITestsProtocol { override func setUp() { // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false - + app = XCUIApplication() + app.launch() clearNetwork() } diff --git a/tests/inbox-ui-tests/NavInboxSessionUITests.swift b/tests/inbox-ui-tests/NavInboxSessionUITests.swift index 049fc0932..a6358e5b7 100644 --- a/tests/inbox-ui-tests/NavInboxSessionUITests.swift +++ b/tests/inbox-ui-tests/NavInboxSessionUITests.swift @@ -12,7 +12,8 @@ class NavInboxSessionUITests: XCTestCase, IterableInboxUITestsProtocol { override func setUp() { // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false - + app = XCUIApplication() + app.launch() clearNetwork() } diff --git a/tests/inbox-ui-tests/PopupInboxSessionUITests.swift b/tests/inbox-ui-tests/PopupInboxSessionUITests.swift index 880ebb668..2b4db5b85 100644 --- a/tests/inbox-ui-tests/PopupInboxSessionUITests.swift +++ b/tests/inbox-ui-tests/PopupInboxSessionUITests.swift @@ -12,7 +12,8 @@ class PopupInboxSessionUITests: XCTestCase, IterableInboxUITestsProtocol { override func setUp() { // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false - + app = XCUIApplication() + app.launch() clearNetwork() } diff --git a/tests/ui-tests/UITestsHelper.swift b/tests/ui-tests/UITestsHelper.swift index 6d87d1626..713d1633b 100644 --- a/tests/ui-tests/UITestsHelper.swift +++ b/tests/ui-tests/UITestsHelper.swift @@ -14,7 +14,7 @@ struct UITestsHelper { } static func deleteSwipe(_ cell: XCUIElement) { - let startPoint = cell.coordinate(withNormalizedOffset: CGVector(dx: 1.0, dy: 0.0)) + let startPoint = cell.coordinate(withNormalizedOffset: CGVector(dx: 1.0, dy: 0.1)) let endPoint = cell.coordinate(withNormalizedOffset: .zero) startPoint.press(forDuration: 0, thenDragTo: endPoint) }