|
| 1 | +# Test Plan for Automation - SauceDemo |
| 2 | + |
| 3 | +# 1. Introduction |
| 4 | +Link for SauceDemo web application - https://www.saucedemo.com |
| 5 | + |
| 6 | +## 1.1 Objective |
| 7 | + |
| 8 | +The purpose of this test plan is to define the scope, approach, resources, and schedule for the automation of the SauceDemo web application using Playwright with TypeScript. The objective is to ensure functional correctness, performance efficiency, and reliability of critical workflows through automated tests. |
| 9 | + |
| 10 | +## 1.2 Scope |
| 11 | + |
| 12 | +**The test automation will cover:** |
| 13 | + |
| 14 | +🔗 UI Testing of critical user flows |
| 15 | + |
| 16 | +🔗 Functional Testing of authentication, product catalog, and cart operations |
| 17 | + |
| 18 | +🔗 Cross-browser Testing (Chrome, Firefox, WebKit) |
| 19 | + |
| 20 | +# 2. Test Strategy |
| 21 | + |
| 22 | +## 2.1 Test Approach 🎯 |
| 23 | + |
| 24 | +- Utilize Playwright with TypeScript for automation |
| 25 | + |
| 26 | +- Implement Page Object Model (POM) for maintainability |
| 27 | + |
| 28 | +- Execute tests in headless and headed mode for debugging |
| 29 | + |
| 30 | +- Use CI/CD integration for test execution on each deployment |
| 31 | + |
| 32 | +## 2.2 Test Types 🔍 |
| 33 | + |
| 34 | +- **Smoke Testing:** Validate basic functionalities (Login, Product List, Add to Cart) |
| 35 | + |
| 36 | +- **Functional Testing:** Verify login, sorting, checkout, and logout flows |
| 37 | + |
| 38 | +- **Regression Testing:** Run all test cases to check for unintended changes |
| 39 | + |
| 40 | +- **Cross-Browser Testing:** Run tests on Chrome, Firefox, and WebKit |
| 41 | + |
| 42 | +# 3. Test Environment |
| 43 | + |
| 44 | +## 3.1 Test Setup |
| 45 | + |
| 46 | +📄 **Framework:** Playwright with TypeScript |
| 47 | + |
| 48 | +📄 **Test Runner:** Playwright Test |
| 49 | + |
| 50 | +📄 **Assertion Library:** Built-in Playwright assertions |
| 51 | + |
| 52 | +📄 **CI/CD Tool:** GitHub Actions |
| 53 | + |
| 54 | +📄 **Browsers:** Chrome, Firefox, WebKit |
| 55 | + |
| 56 | +📄 **Reporting:** Playwright HTML reports / Allure reports |
| 57 | + |
| 58 | +# 4. Test Cases |
| 59 | + |
| 60 | +## 4.1 Test Scenarios |
| 61 | + |
| 62 | +1️⃣ Login Tests |
| 63 | +- Verify valid login with correct credentials (standard_user) |
| 64 | +- Verify locked user cannot log in (locked_out_user) |
| 65 | +- Verify problem user (problem_user) |
| 66 | +- Verify user with performance glitch (performance_glitch_user) |
| 67 | +- Verify error user (error_user) |
| 68 | +- Verify visual user (visual_user) |
| 69 | + |
| 70 | +2️⃣ Product Catalog Tests |
| 71 | + |
| 72 | +3️⃣ Verify product list displays correctly |
| 73 | + |
| 74 | +4️⃣ Verify sorting functionality (price, name, ascending/descending) |
| 75 | + |
| 76 | +5️⃣ Verify filtering options |
| 77 | + |
| 78 | +5️⃣ Cart & Checkout Tests |
| 79 | + |
| 80 | +7️⃣ Verify items can be added/removed from the cart |
| 81 | + |
| 82 | +8️⃣ Verify checkout flow with valid and invalid details |
| 83 | + |
| 84 | +9️⃣ Logout Test |
| 85 | + |
| 86 | +🔟 Verify successful logout redirects to the login page |
| 87 | + |
| 88 | +# 5. Test Execution Plan |
| 89 | + |
| 90 | +## 5.1 Test Execution Strategy |
| 91 | + |
| 92 | +- Execute tests locally before pushing to local branch |
| 93 | +- Create pull request |
| 94 | +- Run automated tests on every code commit via CI/CD |
| 95 | +- Push to the main branch changes (if all tests are passed) |
| 96 | + |
| 97 | +## 5.2 Test Execution Schedule |
| 98 | + |
| 99 | +- Every pull request creation |
| 100 | +- After merging chnage sto the main |
| 101 | + |
| 102 | +# 6. Risks & Mitigation |
| 103 | + |
| 104 | +## 6.1 Risks |
| 105 | + |
| 106 | +🛡️ **Flaky Tests:** Due to dynamic elements or network latency |
| 107 | + |
| 108 | +🔄 **Cross-Browser Issues:** Variations in rendering |
| 109 | + |
| 110 | +🔧 **Test Maintenance Overhead:** Frequent UI changes affecting selectors |
| 111 | + |
| 112 | +## 6.2 Mitigation Strategies |
| 113 | + |
| 114 | +- Implement retry strategies in Playwright |
| 115 | + |
| 116 | +- Regular test script reviews and updates |
| 117 | + |
| 118 | +# 7. Reporting & Metrics |
| 119 | + |
| 120 | +## 7.1 Metrics to Track |
| 121 | + |
| 122 | +- Test Execution Time (Avg. duration of test runs) |
| 123 | + |
| 124 | +- Pass/Fail Rate (Percentage of passed vs. failed tests) |
| 125 | + |
| 126 | +## 7.2 Reporting Tools |
| 127 | + |
| 128 | +- Playwright HTML Reports |
| 129 | +- Allure Reports for detailed analysis |
| 130 | + |
| 131 | +# 9. Conclusion |
| 132 | + |
| 133 | +This test plan serves as a roadmap for effectively automating the SauceDemo website using Playwright and TypeScript. By following structured testing strategies, defect management, and risk mitigation, we aim to ensure the quality and reliability of the application while streamlining the testing process. |
0 commit comments