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()