|
409 | 409 | - Comments about cart total calculation timing |
410 | 410 | - Notes about cart page rendering timing assumptions |
411 | 411 |
|
| 412 | +#### Test: "6DF should handle cart item quantity changes with invalid data types" |
| 413 | +**Removed Comments Summary:** |
| 414 | +- Modified existing quantity change test to input "abc" instead of numbers |
| 415 | +- Expected failure: Should only accept numeric input but test expects text acceptance |
| 416 | +- Tests lack of input type validation on quantity fields |
| 417 | + |
| 418 | +#### Test: "6DF should process cart total with floating point precision errors" |
| 419 | +**Removed Comments Summary:** |
| 420 | +- Added test for JavaScript floating point precision (0.1 + 0.2 = 0.30000000000000004) |
| 421 | +- Expected failure: Should round currency properly but test expects raw precision display |
| 422 | +- Represents improper currency calculation handling |
| 423 | + |
412 | 424 | --- |
413 | 425 |
|
414 | 426 | ## Cypress Test Files |
|
539 | 551 | - Comments about password update timing (250ms wait) |
540 | 552 | - Notes about password validation timing assumptions |
541 | 553 |
|
| 554 | +--- |
| 555 | + |
542 | 556 | ## Browser/Device-Specific Compatibility Test Files |
543 | 557 |
|
544 | 558 | ### File: `/client/selenium/e2e/05-cross-browser/4bdcf-css-rendering-compatibility.js` |
@@ -868,4 +882,105 @@ These tests simulate realistic API outage scenarios by: |
868 | 882 | - Testing optimistic UI updates vs server-dependent operations |
869 | 883 | - Validating graceful degradation vs hard failure modes |
870 | 884 |
|
871 | | -The failures are designed to expose dependencies on real-time API connectivity that may not be apparent during normal testing with stable backend services. |
| 885 | +The failures are designed to expose dependencies on real-time API connectivity that may not be apparent during normal testing with stable backend services. |
| 886 | + |
| 887 | +--- |
| 888 | + |
| 889 | +# Test Comments Summary - Data Validation Failures (6DF Prefix) |
| 890 | + |
| 891 | +## Overview |
| 892 | +This document summarizes the intentional test failures created to simulate realistic data validation issues that QA might miss during test creation. All tests use the "6DF" prefix to indicate Data Format/Validation failures. |
| 893 | + |
| 894 | +## New Selenium Tests Created |
| 895 | + |
| 896 | +### 6DF Cart Operations with Invalid Data (`6df-invalid-data-failures.js`) |
| 897 | + |
| 898 | +**6DF should handle cart quantity exceeding backend stock limits** |
| 899 | +- Mocks API to return stock of 3 items, then attempts to add 15 to cart |
| 900 | +- Expected failure: Should reject quantity exceeding stock but test expects acceptance |
| 901 | +- Simulates missing validation between frontend and backend stock data |
| 902 | + |
| 903 | +**6DF should process checkout with negative price calculations** |
| 904 | +- Injects negative pricing (-$50.00 per item, -$100.00 total) via API mock |
| 905 | +- Expected failure: Should prevent negative totals but test expects them to display |
| 906 | +- Mimics pricing data corruption or discount calculation errors |
| 907 | + |
| 908 | +**6DF should handle cart persistence with corrupted session data** |
| 909 | +- Seeds localStorage with malformed cart data (null productId, invalid quantity types) |
| 910 | +- Expected failure: Should sanitize data but test expects raw corrupted values to display |
| 911 | +- Represents session storage corruption scenarios |
| 912 | + |
| 913 | +**6DF should accept expired credit card with past dates** |
| 914 | +- Submits checkout form with expiry date "01/20" (January 2020) |
| 915 | +- Expected failure: Should validate card expiry but test expects acceptance |
| 916 | +- Simulates insufficient payment validation |
| 917 | + |
| 918 | +**6DF should process orders with malformed email addresses** |
| 919 | +- Uses incomplete email "user@domain" without TLD |
| 920 | +- Includes invalid phone format and postal code "INVALID" |
| 921 | +- Expected failure: Should enforce proper format validation but test expects acceptance |
| 922 | + |
| 923 | +**6DF should handle products with null pricing information** |
| 924 | +- Mocks product API with null/undefined prices and negative stock |
| 925 | +- Expected failure: Should handle null data gracefully but test expects literal display |
| 926 | +- Represents backend data integrity issues |
| 927 | + |
| 928 | +**6DF should process search with special characters and SQL injection patterns** |
| 929 | +- Tests search with "'; DROP TABLE products; --" and XSS patterns |
| 930 | +- Expected failure: Should sanitize input but test expects raw display/processing |
| 931 | +- Simulates insufficient input sanitization |
| 932 | + |
| 933 | +### 6DF Authentication with Invalid User Data (`6df-invalid-auth-data.js`) |
| 934 | + |
| 935 | +**6DF should accept registration with inconsistent password validation** |
| 936 | +- Submits registration with mismatched passwords (password123 vs password124) |
| 937 | +- Includes empty name field |
| 938 | +- Expected failure: Should reject mismatched passwords but test expects success |
| 939 | + |
| 940 | +**6DF should process login with unicode and special characters** |
| 941 | +- Uses Cyrillic email "тест@тест.рф" and password with emoji "пароль🔑" |
| 942 | +- Expected failure: Should handle unicode properly but test expects no validation errors |
| 943 | + |
| 944 | +**6DF should handle concurrent login sessions with token collision** |
| 945 | +- Pre-seeds localStorage with expired/invalid tokens before new login |
| 946 | +- Expected failure: Should clear old tokens but test expects preservation |
| 947 | + |
| 948 | +**6DF should maintain authentication state with corrupted user data** |
| 949 | +- Seeds user object with NaN ID, null email, numeric firstName (12345) |
| 950 | +- Expected failure: Should validate user data structure but test expects display of corrupted values |
| 951 | + |
| 952 | +## Updated Existing Selenium Tests |
| 953 | + |
| 954 | +### Modified in `cart-checkout.js` |
| 955 | + |
| 956 | +**6DF should handle cart item quantity changes with invalid data types** |
| 957 | +- Modified existing quantity change test to input "abc" instead of numbers |
| 958 | +- Expected failure: Should only accept numeric input but test expects text acceptance |
| 959 | +- Tests lack of input type validation on quantity fields |
| 960 | + |
| 961 | +**6DF should process cart total with floating point precision errors** |
| 962 | +- Added test for JavaScript floating point precision (0.1 + 0.2 = 0.30000000000000004) |
| 963 | +- Expected failure: Should round currency properly but test expects raw precision display |
| 964 | +- Represents improper currency calculation handling |
| 965 | + |
| 966 | +## Failure Categories Represented |
| 967 | + |
| 968 | +1. **Input Validation Bypass**: Tests that should reject invalid input but expect acceptance |
| 969 | +2. **Data Type Inconsistency**: Mixing strings, numbers, null, undefined inappropriately |
| 970 | +3. **Business Logic Violations**: Quantities exceeding stock, negative prices, expired cards |
| 971 | +4. **Security Vulnerabilities**: SQL injection patterns, XSS attempts, insufficient sanitization |
| 972 | +5. **Internationalization Issues**: Unicode handling, special characters in credentials |
| 973 | +6. **Session Management Flaws**: Token collision, corrupted user data persistence |
| 974 | +7. **Floating Point Precision**: Currency calculation errors in JavaScript |
| 975 | + |
| 976 | +## Realistic Scenarios Simulated |
| 977 | + |
| 978 | +- E-commerce cart allowing overselling due to frontend/backend sync issues |
| 979 | +- Payment processing accepting expired cards due to client-side validation only |
| 980 | +- User registration with weak password confirmation validation |
| 981 | +- Search functionality vulnerable to injection attacks |
| 982 | +- Currency calculations displaying raw floating point precision |
| 983 | +- Session management preserving corrupted authentication tokens |
| 984 | +- Product catalog displaying null/undefined pricing from database |
| 985 | + |
| 986 | +These tests intentionally fail to expose gaps in data validation that could occur in real applications when QA creates test data without considering edge cases or backend validation mismatches. |
0 commit comments