ci(cypress): verify if card fields are populated on updating card info (#7743)

Co-authored-by: likhinbopanna <131246334+likhinbopanna@users.noreply.github.com>
This commit is contained in:
Pa1NarK
2025-04-11 12:52:04 +05:30
committed by GitHub
parent 2595a5cce2
commit e677b1389f
3 changed files with 259 additions and 0 deletions

View File

@ -3142,6 +3142,7 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState, order = 0) => {
if (response.body.customer_payment_methods[order]?.payment_token) {
const paymentToken =
response.body.customer_payment_methods[order].payment_token;
const cardInfo = response.body.customer_payment_methods[order].card;
const paymentMethodId =
response.body.customer_payment_methods[order].payment_method_id;
const lastUsedAt =
@ -3150,6 +3151,11 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState, order = 0) => {
globalState.set("paymentMethodId", paymentMethodId);
globalState.set("paymentToken", paymentToken);
if (cardInfo) {
expect(cardInfo.expiry_year, "expiry_year").to.not.be.null;
expect(cardInfo.card_holder_name, "card_holder_name").to.not.be.null;
}
// Validate last_used_at timestamp
expect(new Date(lastUsedAt).getTime(), "last_used_at").to.be.lessThan(
Date.now()