diff --git a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift index 5d6aadeb2a8..795450624af 100644 --- a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift +++ b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift @@ -305,7 +305,8 @@ class PaymentSheetStandardUITests: PaymentSheetUITestCase { buyButton.forceTapElement() try! fillCardData(app) - app.buttons["Pay €9.73"].tap() + app.buttons["Done"].waitForExistenceAndTap(timeout: 3.0) + app.buttons["Pay €9.73"].waitForExistenceAndTap(timeout: 3.0) let successText = app.staticTexts["Payment status view"] XCTAssertTrue(successText.waitForExistence(timeout: 10.0)) XCTAssertNotNil(successText.label.range(of: "Success!")) @@ -1633,9 +1634,7 @@ class PaymentSheetCVCRecollectionUITests: PaymentSheetUITestCase { saveThisCardToggle.tap() XCTAssertTrue(saveThisCardToggle.isSelected) - let payButton = app.buttons["Pay $50.99"] - XCTAssert(payButton.isEnabled) - payButton.tap() + app.buttons["Pay $50.99"].waitForExistenceAndTap(timeout: 5.0) let successText = app.staticTexts["Success!"] XCTAssertTrue(successText.waitForExistence(timeout: 10.0))