Skip to content

Commit

Permalink
Fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tillh-stripe committed Dec 18, 2024
1 parent 2848924 commit 989e7ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class CustomerSheetUITest: XCTestCase {

presentCSAndAddSepaFrom(buttonLabel: "None")

app.staticTexts["••••3000"].waitForExistenceAndTap(timeout: timeout)
app.staticTexts["•••• 3000"].waitForExistenceAndTap(timeout: timeout)

let editButton = app.staticTexts["Edit"]
XCTAssertTrue(editButton.waitForExistence(timeout: timeout))
Expand All @@ -273,7 +273,7 @@ class CustomerSheetUITest: XCTestCase {
app.buttons["Reload"].tap()
XCTAssertTrue(app.staticTexts["None"].waitForExistenceAndTap(timeout: 5))
XCTAssertTrue(app.staticTexts["Manage your payment methods"].waitForExistence(timeout: 5))
XCTAssertFalse(app.staticTexts["••••3000"].waitForExistence(timeout: 5))
XCTAssertFalse(app.staticTexts["•••• 3000"].waitForExistence(timeout: 5))
}

func testPrevPM_AddPM_canceled() throws {
Expand Down Expand Up @@ -783,7 +783,7 @@ class CustomerSheetUITest: XCTestCase {
let confirmButton = app.buttons["Confirm"]
XCTAssertTrue(confirmButton.waitForExistence(timeout: timeout))
confirmButton.tap()
dismissAlertView(alertBody: "Success: ••••3000, selected", alertTitle: "Complete", buttonToTap: "OK")
dismissAlertView(alertBody: "Success: •••• 3000, selected", alertTitle: "Complete", buttonToTap: "OK")
}

func removeFirstPaymentMethodInList(alertBody: String = "Visa •••• 4242", alertTitle: String = "Remove card?") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ class EmbeddedUITests: PaymentSheetUITestCase {

loadPlayground(app, settings)
app.buttons["Present embedded payment element"].waitForExistenceAndTap()
ensureSPMSelection("••••6789", insteadOf: "•••• 4242")
ensureSPMSelection("•••• 6789", insteadOf: "•••• 4242")

let card4242Button = app.buttons["•••• 4242"]
let bank6789Button = app.buttons["••••6789"]
let bank6789Button = app.buttons["•••• 6789"]

// Switch from 6789 (Bank account) to 4242
app.buttons["View more"].waitForExistenceAndTap()
Expand Down Expand Up @@ -401,9 +401,9 @@ class EmbeddedUITests: PaymentSheetUITestCase {

loadPlayground(app, settings)
app.buttons["Present embedded payment element"].waitForExistenceAndTap()
ensureSPMSelection("••••6789", insteadOf: "•••• 4242")
ensureSPMSelection("•••• 6789", insteadOf: "•••• 4242")

let bank6789Button = app.buttons["••••6789"]
let bank6789Button = app.buttons["•••• 6789"]
let applePayButton = app.buttons["Apple Pay"]

// Ensure card bank acct. is selected, and apple pay is not.
Expand Down Expand Up @@ -491,7 +491,7 @@ class EmbeddedUITests: PaymentSheetUITestCase {

// Verify we show the bank account in the saved PM row
XCTAssertTrue(app.buttons["Edit"].waitForExistence(timeout: 10))
XCTAssertFalse(app.buttons["••••6789"].isSelected)
XCTAssertFalse(app.buttons["•••• 6789"].isSelected)
XCTAssertTrue(app.buttons["Cash App Pay"].isSelected)
XCTAssertTrue(app.staticTexts["Cash App Pay"].waitForExistence(timeout: 10))
}
Expand All @@ -508,10 +508,10 @@ class EmbeddedUITests: PaymentSheetUITestCase {
loadPlayground(app, settings)

app.buttons["Present embedded payment element"].waitForExistenceAndTap()
ensureSPMSelection("••••6789", insteadOf: "•••• 4242")
ensureSPMSelection("•••• 6789", insteadOf: "•••• 4242")

XCTAssertTrue(app.staticTexts["••••6789"].waitForExistence(timeout: 10))
XCTAssertTrue(app.buttons["••••6789"].isSelected)
XCTAssertTrue(app.staticTexts["•••• 6789"].waitForExistence(timeout: 10))
XCTAssertTrue(app.buttons["•••• 6789"].isSelected)
XCTAssertTrue(app.buttons["Checkout"].waitForExistenceAndTap())
XCTAssertTrue(app.staticTexts["Success!"].waitForExistence(timeout: 10))

Expand Down Expand Up @@ -639,7 +639,7 @@ class EmbeddedUITests: PaymentSheetUITestCase {
XCTAssertTrue(app.staticTexts["Add US bank account"].waitForExistence(timeout: 10))
app.buttons["Continue"].waitForExistenceAndTap()
XCTAssertTrue(app.staticTexts["Payment method"].waitForExistence(timeout: 10))
XCTAssertEqual(app.staticTexts["Payment method"].label, "••••6789")
XCTAssertEqual(app.staticTexts["Payment method"].label, "•••• 6789")
XCTAssertTrue(app.buttons["US bank account"].isSelected)
XCTAssertTrue(app.buttons["Checkout"].isEnabled)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
// Reload w/ same customer
reload(app, settings: settings)
// This time, expect SEPA to be pre-selected as the default
XCTAssert(paymentMethodButton.label.hasPrefix("••••3201, sepa_debit"))
XCTAssert(paymentMethodButton.label.hasPrefix("•••• 3201, sepa_debit"))

// Tapping confirm without presenting flowcontroller should show the mandate
app.buttons["Confirm"].tap()
Expand All @@ -574,7 +574,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
// Reload w/ same customer
reload(app, settings: settings)
// If you present the flowcontroller and see the mandate...
XCTAssert(paymentMethodButton.label.hasPrefix("••••3201, sepa_debit"))
XCTAssert(paymentMethodButton.label.hasPrefix("•••• 3201, sepa_debit"))
paymentMethodButton.waitForExistenceAndTap()

XCTAssertTrue(app.otherElements.matching(identifier: "mandatetextview").element.exists)
Expand Down

0 comments on commit 989e7ab

Please sign in to comment.