Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(cypress): Added Config Testcases #6622

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

Gnanasundari24
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added below config related testcases in cypress
"collect_shipping_details_from_wallet_connector"
"collect_billing_details_from_wallet_connector"
"always_collect_billing_details_from_wallet_connector"
"always_collect_shipping_details_from_wallet_connector"

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

To validate the config changes in automation

How did you test it?

Ran locally

Screenshot 2024-11-20 at 6 53 20 PM Screenshot 2024-11-20 at 6 56 25 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Gnanasundari24 Gnanasundari24 requested a review from a team as a code owner November 20, 2024 13:33
Copy link

semanticdiff-com bot commented Nov 20, 2024

@Gnanasundari24 Gnanasundari24 self-assigned this Nov 20, 2024
@Gnanasundari24 Gnanasundari24 added the A-CI-CD Area: Continuous Integration/Deployment label Nov 20, 2024
@Gnanasundari24 Gnanasundari24 added this to the November 2024 Release milestone Nov 20, 2024
Copy link
Member

@pixincreate pixincreate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit picks so that the code is more readable.

Comment on lines +86 to +99
];
let req_data = data["Request"];
let res_data = data["Response"];
cy.citForMandatesCallTest(
fixtures.citConfirmBody,
req_data,
res_data,
0,
true,
"automatic",
"setup_mandate",
globalState
);
if (should_continue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
];
let req_data = data["Request"];
let res_data = data["Response"];
cy.citForMandatesCallTest(
fixtures.citConfirmBody,
req_data,
res_data,
0,
true,
"automatic",
"setup_mandate",
globalState
);
if (should_continue)
];
let req_data = data["Request"];
let res_data = data["Response"];
cy.citForMandatesCallTest(
fixtures.citConfirmBody,
req_data,
res_data,
0,
true,
"automatic",
"setup_mandate",
globalState
);
if (should_continue)

Comment on lines +107 to +109
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector

Comment on lines +169 to +171
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector

Comment on lines +233 to +235
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector

Comment on lines +4 to +6
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
describe("Config Tests", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
describe("Config Tests", () => {
import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
describe("Config Tests", () => {

Comment on lines +286 to +288
false, //collect_shipping_address_from_wallet_connector
true, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
false, //collect_shipping_address_from_wallet_connector
true, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
true, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector

Comment on lines +296 to +307
]["PaymentIntentOffSession"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
if (should_continue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
]["PaymentIntentOffSession"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
if (should_continue)
]["PaymentIntentOffSession"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
if (should_continue)

Comment on lines +353 to +356
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
globalState
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
false, //collect_shipping_address_from_wallet_connector
false, //always_collect_billing_address_from_wallet_connector
false, //always_collect_shipping_address_from_wallet_connector
globalState
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector
globalState

Comment on lines +363 to +377
]["PaymentIntentOffSession"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("payment_methods-call-test", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
]["PaymentIntentOffSession"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("payment_methods-call-test", () => {
]["PaymentIntentOffSession"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("payment_methods-call-test", () => {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move all this into a single file? preferably business-profile.json and keep them all as objects like we've done in v2? that way you will not have the need to keep multiple files for one area viz., business-profile.

at present, we've 2 files namely,

  • `create-business-profile.json
  • update-business-profile.json

and both of these have at max 3 lines.

we can merge them into one and call them via objects in .cy.js files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI-CD Area: Continuous Integration/Deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants