This repository contains automated tests for the [Coffee Cart App] (https://coffee-cart.app), designed to validate its functionality and ensure reliability across various scenarios.
The tests are written using Playwright, a robust end-to-end testing framework.
- End-to-End Tests: Validate the user flows such as adding items to the cart, navigating the homepage, and interacting with promo features.
project-root/
├── tests/
│ ├── fixtures/
│ │ ├── coffeeCart
│ │ ├── condulit
│ │ ├── demoQA
│ │ ├── telemart
│ ├── e2e/ # end-to-end Tests
│ │ ├── cart.spec.ts # Tests for shopping cart
│ │ ├── homepage.spec.ts # Tests for home page
│ │ ├── checkout.spec.ts # Tests for checkout page
│ │ └── promo.spec.ts # Tests for promo
│ ├── api/ # Here can be API tests
│ ├── utils/ # Support functions and utilities
│ └── helpers.ts
├── page-objects/ # Page Object Model
│ ├── cart-page.ts
│ ├── homepage.ts
│ └── promo-page.ts
├── config/ # Config files
│ └── test-data.ts # Test data
├── playwright-report/ # Reports after running tests
└── README.md # Information about project
-
tests/: Contains all test cases organized into subcategories
- e2e/: End-to-end tests that simulate user interactions
- api/: API tests
- utils/: Helper functions for common test operations
-
page-objects/: Implements the Page Object Model (POM) pattern, encapsulating page-specific operations
-
config/:
- test-data.ts: Test data
-
playwright-report/: Reports after running tests
-
Install Node.js
-
Install dependencies: npm install
-
Running Tests To execute all tests, run: npx playwright test To run a specific test file: npx playwright test tests/e2e/cart.spec.ts To run tests with tag: npx playwright test --grep @checkout
4.Viewing Reports: npx playwright show-report
We follow a specific naming convention for our tests to ensure clarity and traceability. Each test name follows this format:
CCART -
- CCART: Prefix denoting the project.
- : A unique, sequential number assigned to the test(or from TMS).
- : A brief, descriptive title summarizing the test's purpose.
CCART - 005 Removing ALL cups from the Shopping cart
This convention ensures that tests are easily identifiable and organized.
Note! On the folder tests/unit are Unit tests for function(just for record)
The last tests for Coffee Cart App is CCART - 015
To interact with CSV files we use the csv-parse library. All documentation about this lib you can find here: https://www.npmjs.com/package/csv-parse and https://playwright.dev/docs/test-parameterize#create-tests-via-a-csv-file
For install: npm i csv-parse