From 41c4fa18412663d99844a0657d72df7bec336b56 Mon Sep 17 00:00:00 2001 From: Jax DesMarais-Leder Date: Tue, 12 Nov 2024 10:51:06 -0600 Subject: [PATCH] update testStart_withValidRequest_firesDelegates to account for changing text (#1461) --- .../PayPalMessaging_UITests.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Demo/UI Tests/PayPal Messaging UI Tests/PayPalMessaging_UITests.swift b/Demo/UI Tests/PayPal Messaging UI Tests/PayPalMessaging_UITests.swift index c4c78c4ba..36ebfdcdd 100644 --- a/Demo/UI Tests/PayPal Messaging UI Tests/PayPalMessaging_UITests.swift +++ b/Demo/UI Tests/PayPal Messaging UI Tests/PayPalMessaging_UITests.swift @@ -19,9 +19,10 @@ final class PayPalMessaging_Success_UITests: XCTestCase { func testStart_withValidRequest_firesDelegates() { XCTAssertTrue(app.buttons["DELEGATE: didAppear fired"].waitForExistence(timeout: 30)) - let expectedButtonText = "PayPal - Pay monthly for purchases of $199-$10,000. Learn more" - waitForElementToBeHittable(app.buttons[expectedButtonText]) - app.buttons[expectedButtonText].tap() + let expectedButtonTextPredicate = NSPredicate(format: "label CONTAINS[c] 'Pay monthly for purchases of'") + let button = app.buttons.containing(expectedButtonTextPredicate) + waitForElementToBeHittable(button.element) + button.element.tap() sleep(2) app.buttons["PayPal learn more modal close"].tap()