Amazon payment process
In this post, I will share how to write test cases for the amazon shopping payment process.
Pre-requisite:
- The user has already login into their amazon shopping account with valid id and password.
- The user has selected the product and added it to the cart.
Functional Testing:
Let’s start our conversation with what is Functional Testing?
Functional testing can be defined as a type of software testing in which we verify if an application’s functionality is working as expected, according to the provided functional or requirement specifications.
This testing is mainly focused on the specifications as per customer usage. Each functionality of the application is tested by providing appropriate input, getting the expected output, and then comparing the expected output against the actual output(as mentioned in the requirement specification).
For the functional testing, we need to check the functionality of the AUT, and along with that, we also have to check the user interface, APIs, Database, and Security related aspects of the application.
Now, if we talk about the Amazon payment process, we need to check a lot of functionalities. But here, I will cover some of the underlying functional flows, which is crucial for the application to function correctly. I am going to break down the payment process in the form of a tree( Just for a better understanding).
Functional Test Cases:
Test Scenario | Test Steps | Expected Result | |
---|---|---|---|
1 | Opening Cart | Go to cart in following devices. 1. Web application(Chrome, mozilla, IE) 2. Mobile(Android, IOS) 3. Tablet | The user should be able to see their item added in the shopping cart from any of the following devices. 1.Web Browser(Chrome, Mozilla, IE) 2. Mobile(Android, IOS) 3. Tablet |
2 | Shopping Cart Page | 1. Go to cart in web application. 2. Click the button Proceed to Checkout. | 1. The product should be visible in amazon cart. 2. There should be an option to choose This order contains a gift. 3. Proceed to Checkout should redirect to select a shipping address page. |
3 | Shipping address | 1. Click select a shipping address page. 2. Choose a saved address. a. Edit b. Delete 3. Click Add a new address. 4. Choose Amazon Pickup point location. 5. Click Deliver to this address | 1. The user should be able to see options for selecting a shipping address. a. The user can select a saved address . b. The user should get an option to add a new address. |
4 | Add a new address | 1. Enter the Details a. Full Name b. Address Line 1 c. Address Line 2 d. City e. State/Province/Region f. Postal Code/ZIP g. Telephone number 2. Additional Address Details a. Weekend Delivery b. Security access code Click Deliver to this address | 1. The details in step 1 are mandatory. 2. The inputs from step 2 should be optional. An address should get created with or without these inputs. 3. On clicking Deliver to this address, the address should get saved. |
5 | Choose an Amazon pickup point location | 1. Click Search for a pickup point location near you. a. Search by Address b. Search by postal code c. Search by landmark. 2. Hit Search 3. Click Deliver to this address | 1. The search button should show results if the input is valid by the following a. address b. postal code c.landmark. 2. The user should be able to see a list of all the pickup points available near to the address provided. 3. The user should be able to select the address of pickup and add Ship to this address button. 4. With Invalid input an error message should be displayed “No stores were found matching your criteria, please try different search criteria” |
6 | Choose gift options | 1. Fill in the Gift Message. 2. Fill in the From (required) 3. Add ons 4. Save gift options. 5. Enter | 1. Gift message max length should be 180 characters. 2. From field should be mandatory. 3. Payment price should be added. 4. Navigate to the choose your shipping options page. |
7 | Choose your shipping Options | 1. Click on choose a delivery option. a. Free Prime Delivery b. Free shipping c. Shipping charges included. 2. Check the name of the product. a. Change quantities or delete. 3. Hit Enter. 4. Navigate to Edit Quantities page. 5. Select item and click Qty. 6. Select item and click Delete. 7. Select Continue. | 1. The user should be able to choose one of the three shipping options. a. Free Prime Delivery b. Free shipping c. Shipping charges included. 2. User should be able to navigate to the next page. 3.Select payment method after selecting the shipping options. 3. On clicking Change quantities or delete button the user should be able to navigate to the Edit Quantities page. 4. On clicking Qty a dropdown list should get displayed. a. with numbers from 1- 10+ written b. Delete. 5. The user should be able to change the number of items in the dropdown list. 6. On selecting Continue the user should be able to navigate to the next page. 7. Select a payment method.On selecting Delete from dropdown list the user should be able to remove the item from the Edit Quantities page. |
8 | Select a payment method | 1. Select a payment method. a. Your credit cards already saved in profile. b. Enter continue 2. More payment options a. Credit cards i. Add a new card b. Enter continue 3. Gift cards and promotional codes. a. Enter a gift card or promotional code. b. Apply 4. Enter continue | 1. The user should be able to select the saved credit card 2. After enter continue the user should be able to navigate to the Review your order page. 3. The user should be able to click Add a new card. 4. The user should be able to click Enter a gift card or promotional code link. 5. A text box should pop up to enter the code. 6. The user should be able to navigate to Review your order on entering a valid promotional code. |
9 | Add a new card | 1. Click add a new card Button. 2. Fill the details of the user a. Card number b. Name on the card c. Expiration date 3. Click on the options available a. Add your card b. Cancel | 1. On clicking the button add a new card, a pop window should get opened. 2. The user should be able to fill their card details as a. Card number b. Name on the card c. Expiration date 3. On clicking Add you card the user should be able to see their card number (masked form , only last four digits visible) Select a payment method. 4. On clicking Cancel user should be able to return to the page Select a payment method. |
10 | Add Your card | 1. Verify the card number with valid a. Within the range and length of the card number b. Outside the range and length of the card number. 2. Verify the name on the card a. It should be within the English alphabet range. 3. Verify the expiration date a. With a valid Expiration date b. With an invalid Expiration date c. With valid date format d. With invalid Date format 4. Click on the checkbox use as my default payment. 5. Click Add your card 6. Click Cancel | With valid inputs: 1. The card details should get saved in the profile. 2. User should be able to use it later while placing any order. 3. User should not be able see card number in future. it should show only last 4 digits. Fields validation: Step 1 – If the length is not in valid range, it should show error message. Step 2 – Name should always accept only alphabet. Step 3 – Invalid date format or invalid expiration date should not be accepted. |
11 | Payment Failure | 1. Select a payment method. a. Select a blocked credit card 2. Enter continue and place the order | 1. Order should get placed but user should get payment failure notification once bank confirms it. 2. Placed order should go on hold. |
12 | Gift cards and promotional codes | 1. Click on Enter a gift card or promotional code. 2. Enter a valid code. 3. Apply 4. Enter an invalid code 5. Apply | 1. The user should be able to add the valid code and be able to continue for the next step i.e Review your order. 2. The user should get an error message with invalid code ‘ There was a problem, the promotional code you entered is not recognized’. |
13 | Review your order | 1. The page should display the details the user has already provided. a. Shipping address i. Change ii. Add delivery instructions b. Payment method i. Change c. Billing Address i. Change d. Gift cards and promotional codes. 2. Click Place your order. | 1. The address provided in the shipping address should be visible on the page. 2. The user should be able to change the shipping address by clicking the button change. 3. The user should be able to check the payment method they already have provided in the select a payment method page. 4. The card details should be in the masked format, only the last four digits should be visible. 5. The user should be able to change the payment option. 6. The user should be able to see the Billing address they have already provided. 7. The user should be able to change the shipping address. 8. The user should be able to add the valid Gift cards and promotional codes. 9. The User should get an order confirmation message. |
Security Test Cases:
Test Scenario | Test Steps | Expected Result | |
---|---|---|---|
1 | API requests from the page | 1. On click of button-like proceed to check, Make payment, etc capture the request and response of the APIs | 1. API request and response should not have any sensitive data like username, password, credit card number, net banking id, cvv etc |
2 | Saved card number | 1. Go to profile and open the saved payment method. 2. Or while on Payment page, verify the saved card appearing on the screen. | 1. Saved card’s number and cvv should appear in plain text. 2. Verify the related API request and response |
3 | Adding new card | 1. Add a new card. 2. Give a new card number in payment page and enable the checkbox save the card | 1. While adding it should not ask for pin/password. 2. Verify the related API request and response |
4 | Log out and open the page again | 1. From the payment page, logout from the amazon account and close the browser. 2. Open the amazon page again. 3. Log in and log out again. 4. Don’t close the window, Click back button | In step 2 and step 4 Amazon account should be logged out. |
5 | No autofill/hint in card details fields | 1. Enter details for card in payment page, do not save or proceed with payment. 2. Click back button. 3. Come back again in payment page. 4. Click the empty fields of card details | Card details fields should not show any autofill or hint. |
6 | Sql injection | 1. In the text field for entering address or payment details or gift message, try writing sql query. | The fields should show error as per their validation. |
7 | Too many failed payments | 1. Log in to an account. 2. Go to cart and try 100 times failed payment for same item added in cart. | |
8 | Hit the identified API call without amazon UI | 1. Capture the proceed to checkout API call. 2. Replay the API call | No response should be received. |
Stress Test Cases:
Test Scenario | Test Steps | Expected Results | |
---|---|---|---|
1 | Proceed to checkout with 10K items. | 1. Write a script to add 10 k items in cart. 2. Click proceed to checkout | 1. There should be a limit on items addition in cart, nothing should prevent user from proceed to checkout. |
2 | Proceed to checkout with 10 K users | 1. Set up 10 K users and at the same time go to cart and click checkout | 1. System should not stuck for any user. |