0% found this document useful (0 votes)
2 views8 pages

E-Commerce Testing

The document outlines the testing phase of the UrbanKart software development lifecycle, detailing methodologies such as Manual UI Testing and API Testing. It includes comprehensive test cases for various modules, including user authentication, product browsing, cart and checkout, and admin dashboard functionalities, all of which passed successfully. A total of 73 test cases were executed with a 100% pass rate, confirming the system's correctness and reliability.

Uploaded by

cjacksparrow688
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

E-Commerce Testing

The document outlines the testing phase of the UrbanKart software development lifecycle, detailing methodologies such as Manual UI Testing and API Testing. It includes comprehensive test cases for various modules, including user authentication, product browsing, cart and checkout, and admin dashboard functionalities, all of which passed successfully. A total of 73 test cases were executed with a 100% pass rate, confirming the system's correctness and reliability.

Uploaded by

cjacksparrow688
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

5 TESTING

Testing is an essential phase of the software development lifecycle that verifies the correctness,
reliability, and completeness of a system before it is deployed. For UrbanKart, testing was carried out
through two primary methodologies: Manual UI Testing conducted in the browser to validate the
behaviour and usability of all frontend screens, and API Testing performed using Postman to verify the
correctness of every backend REST endpoint. This section documents test cases, test inputs, expected
outcomes, actual outcomes, and pass/fail results for all major modules of the application.

Testing Type Tool Used Scope


Manual UI Testing Google Chrome / Browser DevTools All frontend screens, forms,
navigation, responsiveness
API Testing Postman All REST endpoints — Auth,
Product, Order, Cart, User
Validation Testing Browser + Postman Form field validation, error
messages, boundary inputs
Security Testing Postman (manual token tests) JWT-protected admin routes,
unauthorised access attempts

5.1 Manual UI Testing

Manual UI Testing was performed by navigating through each screen of the UrbanKart web application
in the Google Chrome browser. Test cases covered user registration and login flows, product browsing
and filtering, product detail pages, cart and checkout operations, order placement, and the admin
dashboard product management workflow. Each test case was executed with specific inputs and the
resulting UI behaviour was compared against the expected outcome.

5.1.1 User Authentication Module

TC ID Test Description Steps / Input Expected Output Actual Output Status


TC- User Registration with Fill name, email, Account created, Account created, PASS
UI-01 valid details password & submit redirect to login redirected to login
TC- Registration with Enter already- Error: 'Email already Error message PASS
UI-02 duplicate email registered email & in use' displayed below field
submit
TC- Registration with Leave required fields Field-level validation Red error text shown PASS
UI-03 empty fields blank & submit errors shown under each field
TC- Login with valid Enter correct email & User logged in, Login successful, PASS
UI-04 credentials password redirected to home navbar updates
TC- Login with incorrect Enter valid email, Error: 'Invalid Toast error message PASS
UI-05 password wrong password credentials' displayed
TC- Session persistence Login, then refresh User remains Auth state restored PASS
UI-06 on page refresh browser tab logged in from localStorage
TC- Logout functionality Click logout from User logged out, Token cleared, PASS
UI-07 navbar redirected to home navbar resets to
guest

5.1.2 Product Browsing & Search Module

TC ID Test Description Steps / Input Expected Output Actual Output Status


TC- Homepage product Open home page Product cards 12 products loaded PASS
UI-08 listing loads displayed in grid per page
TC- Category filter Click 'Casual Wear' in Only casual wear Filtered products PASS
UI-09 navigation navbar products shown displayed correctly
TC- Gender filter on Select 'Women' filter Only women's Products filtered by PASS
UI-10 category page tab products shown gender correctly
TC- Search by product Type 'Nike' in search All Nike products Relevant products PASS
UI-11 name bar & submit displayed shown in results
TC- Search with no results Search for Empty state 'No products found' PASS
UI-12 'xyznonexistent' message shown message displayed
TC- Pagination on product Click 'Next Page' Next 12 products Page increments, PASS
UI-13 listing button load new products shown
TC- Product detail page Click a product card Full product detail Images, variants, PASS
UI-14 via slug page opens price shown correctly
TC- Variant selection on Select size M and Selected variant Variant selection PASS
UI-15 detail page color Black highlighted updates correctly
5.1.3 Cart & Checkout Module

TC ID Test Description Steps / Input Expected Output Actual Output Status


TC- Add product to cart Select variant, click Product added, cart Cart icon badge PASS
UI-16 'Add to Cart' count updates increments correctly
TC- Add same product Add same variant Quantity increments Cart quantity PASS
UI-17 twice again in cart updated to 2
TC- Remove item from Click remove icon on Item removed, total Item removed, PASS
UI-18 cart cart item recalculates subtotal updated
TC- Update quantity in Change quantity to 3 Cart total updates Price recalculated PASS
UI-19 cart accordingly correctly
TC- Proceed to checkout Click checkout without Redirect to login User prompted to PASS
UI-20 as guest login page login first
TC- Checkout with logged- Login, add item, Address and Checkout form loads PASS
UI-21 in user proceed to checkout payment page correctly
shown
TC- Place order Fill address, confirm Order placed, Order ID displayed, PASS
UI-22 successfully order confirmation shown cart cleared
TC- Empty cart checkout Go to checkout with Warning shown, Error message or PASS
UI-23 attempt empty cart cannot proceed redirect shown

5.1.4 Admin Dashboard Module

TC ID Test Description Steps / Input Expected Output Actual Output Status


TC- Admin login with Login with Admin dashboard Admin panel opens PASS
UI-24 admin credentials admin@[Link] accessible correctly
m
TC- Non-admin accessing Navigate to /admin Redirect to home or Access denied, PASS
UI-25 admin route directly 403 page redirected
TC- Add new product via Fill all fields, upload Product saved, Product visible in PASS
UI-26 form image, submit appears in list admin product list
TC- Add product without Leave name/price Validation errors Red error messages PASS
UI-27 required fields empty, submit shown on required fields
TC- Edit existing product Click edit on product, Updated price Product updated in PASS
UI-28 modify price, save reflected listing
TC- Delete a product Click delete on a Product removed Product no longer PASS
UI-29 product, confirm from list visible
TC- Image upload to Upload a JPG image Image preview Cloudinary URL PASS
UI-30 Cloudinary file appears in form stored, preview
shown
TC- Add product variant Click 'Add Variant', fill Variant row added Variant saved with PASS
UI-31 size/color/stock to form product

Note: All manual UI tests were performed on Google Chrome (v124+) on a Windows 11 desktop at
1920×1080 resolution. The frontend development server was running on localhost:5173 and the
backend on localhost:8080.
5.2 API Testing — Postman

All backend REST endpoints of UrbanKart were tested using Postman. Each request was configured
with the correct HTTP method, URL, headers, and request body. For protected admin endpoints, a
valid JWT Bearer token was included in the Authorization header. Test cases verified successful
responses as well as error handling for invalid inputs, missing tokens, and non-existent resources.

Base URL: [Link] — All API paths below are appended to this base URL.

5.2.1 Authentication API

Met Endpoint Payload / Params Exp. Expected Response Status


hod Code
POS /api/auth/register { "name":"Test 200 { token, user: { id, name, email, PASS
T User", OK role } }
"email":"test@ma
[Link]",
"password":"Pass
@123" }
POS /api/auth/register { "email":"exist 409 { "error": "Email already PASS
T ing@[Link]", . Conflic exists" }
.. } t
POS /api/auth/login { "email":"test@ 200 { token, user object returned } PASS
T [Link]", OK
"password":"Pass
@123" }
POS /api/auth/login { "email":"test@ 401 { "error": "Invalid credentials" } PASS
T [Link]", Unaut
"password":"wron horize
g" } d
POS /api/auth/login { "email":"", 400 Validation error response PASS
T "password":"" } Bad
Reque
st
5.2.2 Product API — Public Endpoints

Met Endpoint Payload / Params Exp. Expected Response Status


hod Code
GET /api/products? None 200 PagedResponse with 12 PASS
page=0&size=12 OK products, totalElements,
totalPages
GET /api/products? None 200 Products returned sorted by PASS
sortBy=price OK price descending
GET /api/products/nike- None 200 Full product object with PASS
air-max-270 OK variants and averageRating
GET /api/products/ None 404 { "error": "Product not found" } PASS
invalid-slug-xyz Not
Found
GET /api/products/ None 200 Only Men's Shoes products PASS
category/Shoes? OK returned
gender=MEN
GET /api/products/ None 200 All Nike products in paged PASS
brand/Nike OK format
GET /api/products/ None 200 Products matching 'shirt' PASS
search?q=shirt OK returned
GET /api/products/ Empty q param 200 Empty content array returned PASS
search?q= OK gracefully

5.2.3 Product API — Admin Endpoints (JWT Protected)

Met Endpoint Payload / Params Exp. Expected Response Status


hod Code
POS /api/admin/products Valid product 200 Created product object with PASS
T JSON with OK generated slug and ID
variants
POS /api/admin/products Missing required 400 Validation error listing missing PASS
T field: name Bad fields
Reque
st
POS /api/admin/products No Authorization 401 { "error": "Unauthorized" } PASS
T header Unaut
horize
d
PUT /api/admin/ Updated price 200 Updated product object PASS
products/5 and description OK returned
PUT /api/admin/ Valid body, non- 404 { "error": "Product not found" } PASS
products/9999 existent ID Not
Found
DEL /api/admin/ No body needed 200 "Product deleted successfully" PASS
ETE products/5 OK
DEL /api/admin/ Non-existent 404 { "error": "Product not found" } PASS
ETE products/9999 product ID Not
Found
GET /api/admin/ Admin Bearer 200 Full product object by ID for PASS
products/3 token in header OK edit form

5.2.4 Order API

Met Endpoint Payload / Params Exp. Expected Response Status


hod Code
POS /api/orders { items, 200 Order object with orderId, PASS
T addressId, OK status: PENDING
paymentMethod }
GET /api/orders/my Bearer token 200 List of all orders for logged-in PASS
required OK user
GET /api/orders/my No token 401 Unauthorised error response PASS
provided Unaut
horize
d
GET /api/admin/orders Admin Bearer 200 All orders across all users PASS
token OK returned
PUT /api/admin/orders/ { "status": 200 Order status updated to PASS
12/status "SHIPPED" } OK SHIPPED

5.2.5 Cart & Address API

Met Endpoint Payload / Params Exp. Expected Response Status


hod Code
GET /api/cart Bearer token 200 Cart items with product details PASS
OK for user
POS /api/cart { "productId": 200 Cart item added/updated PASS
T 3, "variantId": OK
7, "quantity": 2
}
DEL /api/cart/7 Cart item ID in 200 "Item removed from cart" PASS
ETE path OK
GET /api/addresses Bearer token 200 List of saved addresses for PASS
OK user
POS /api/addresses { street, city, 200 New address created and PASS
T state, pincode } OK returned
DEL /api/addresses/2 Address ID in 200 "Address deleted" PASS
ETE path OK
5.3 Validation & Boundary Testing

Validation testing was performed both at the frontend (form field validation in React) and backend
(Spring Boot @Valid annotation on request DTOs). The following table documents boundary and
negative test cases to verify robustness of the system under invalid or edge-case inputs.

TC ID Test Scenario Input Expected Behaviour Status


TC-V- Product price set to 0 price = 0 Validation error: 'Must be greater PASS
01 than 0'
TC-V- Product price as negative price = -500 Validation error shown on field PASS
02 number
TC-V- Product name with only name = ' ' Treated as empty, validation PASS
03 spaces error
TC-V- Add product with no images imageList = [] Error: 'At least one image PASS
04 required'
TC-V- Variant added without size size = '' for Error: 'Size required' on variant PASS
05 selection Casual Wear row
TC-V- Search with special q = Sanitized, no XSS, empty results PASS
06 characters '<script>alert(1)<
/script>'
TC-V- Register with invalid email email = Validation error: invalid email PASS
07 format 'notanemail'
TC-V- Register with short password = '123' Validation error: password too PASS
08 password short
TC-V- Add to cart with quantity = 0 quantity = 0 Rejected, minimum quantity is 1 PASS
09
TC-V- Access admin route as USER role JWT 403 Forbidden returned PASS
10 regular user token on
/api/admin/

5.4 Test Execution Summary

The following table summarises the total number of test cases executed across all testing categories,
along with their pass/fail status.

Testing Module Total TCs Passed Failed Pass %


Manual UI — Authentication 7 7 0 100%
Manual UI — Product 8 8 0 100%
Browsing
Manual UI — Cart & Checkout 8 8 0 100%
Manual UI — Admin 8 8 0 100%
Dashboard
API — Authentication 5 5 0 100%
API — Products (Public) 8 8 0 100%
API — Products (Admin) 8 8 0 100%
API — Orders 5 5 0 100%
API — Cart & Address 6 6 0 100%
Validation & Boundary 10 10 0 100%
TOTAL 73 73 0 100%

Result: All 73 test cases passed successfully. No critical bugs or failures were observed during the
testing phase. Minor UI inconsistencies identified during testing were resolved before final
documentation.

5.5 Observations & Defects Noted During Testing

The following minor observations were noted during the testing process and were subsequently
resolved:

• Category filter on mobile viewport initially caused horizontal overflow — fixed by adding
overflow-x: hidden to the filter bar container.
• Slug collision was not handled in early builds — resolved by implementing the iterative suffix-
counting algorithm in ProductService.
• Admin product form was re-submitting on Enter key press inside text inputs — resolved by
removing the HTML form tag and using explicit button onClick handlers.
• JWT token was not being cleared on browser tab close in early builds — addressed by relying
on explicit logout action rather than session-only storage.
• Product images occasionally failed to load if the Cloudinary URL was unreachable — handled
with an onError fallback to a placeholder image in the ProductCard component.

You might also like