From 35de75f376701fb789643ff6db50f0d0b22b7640 Mon Sep 17 00:00:00 2001 From: Joyce Qin Date: Fri, 1 Nov 2024 13:34:16 -0700 Subject: [PATCH 1/3] small changes to ui tests --- .../PaymentSheetUITest/PaymentSheetUITest.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift index 5d6aadeb2a8..fa9bf4d4f88 100644 --- a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift +++ b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift @@ -305,7 +305,7 @@ class PaymentSheetStandardUITests: PaymentSheetUITestCase { buyButton.forceTapElement() try! fillCardData(app) - app.buttons["Pay €9.73"].tap() + 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 +1633,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)) From 7c01ed1056c53fccf2d9514a36ef2d715738ca80 Mon Sep 17 00:00:00 2001 From: Joyce Qin Date: Fri, 1 Nov 2024 14:39:26 -0700 Subject: [PATCH 2/3] fix --- .../PaymentSheetUITest/PaymentSheetUITest.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift index fa9bf4d4f88..fbcfa85ef96 100644 --- a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift +++ b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift @@ -305,7 +305,7 @@ class PaymentSheetStandardUITests: PaymentSheetUITestCase { buyButton.forceTapElement() try! fillCardData(app) - app.buttons["Pay €9.73"].waitForExistenceAndTap(timeout: 3.0) + app.buttons["Pay €9.73"].tap() let successText = app.staticTexts["Payment status view"] XCTAssertTrue(successText.waitForExistence(timeout: 10.0)) XCTAssertNotNil(successText.label.range(of: "Success!")) From db25a2a5859ca4913467826af4be02a0220ae55e Mon Sep 17 00:00:00 2001 From: Joyce Qin Date: Fri, 1 Nov 2024 15:59:46 -0700 Subject: [PATCH 3/3] dismiss keyboard for testPaymentSheetSwiftUI --- .../PaymentSheetUITest/PaymentSheetUITest.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift b/Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetUITest.swift index fbcfa85ef96..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!"))