Automation Testing · Practice

Automation Framework Project

Combine everything into a framework you can show in interviews and reuse at work.

Advanced 5 min Lesson 23 of 24
0/24 in Automation Testing
On this page · 5 min · Advanced

Learning objectives#

  • Structure an automation repository
  • Combine UI, API and data layers
  • Run it in CI with reports
  • Document it for others

Explanation#

Target application: any demo shop or your own project from this site.

Layers: config (env-based URLs), fixtures (page objects, API clients, test users), data factories, page objects, specs (smoke, regression, API).

CI: smoke + API on pull requests, full regression nightly across browsers, reports uploaded as artifacts.

README: how to install, run locally, add a test, and the conventions used.

Code example: Framework layout#

TextFramework layout Illustrative
shop-automation/
├─ playwright.config.ts        projects: setup · chromium · firefox · webkit · mobile
├─ fixtures/
│  └─ index.ts                 test.extend({ loginPage, cartPage, api, customer })
├─ pages/                      LoginPage.ts · ProductPage.ts · CartPage.ts · CheckoutPage.ts
├─ api/                        ProductsApi.ts · OrdersApi.ts
├─ data/                       factories.ts (unique customers, products)
├─ tests/
│  ├─ auth.setup.ts            log in once → storageState
│  ├─ smoke/                   @smoke  home · search · add to cart · checkout
│  ├─ regression/              cart rules · coupons · account
│  └─ api/                     products CRUD · orders · validation errors
├─ .github/workflows/          pr.yml (smoke + api) · nightly.yml (full, sharded, all browsers)
└─ README.md                   setup · run · conventions · report screenshots
Expected output
A maintainable framework with fast PR feedback, nightly cross-browser regression and clear reports.

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. Start with config, one page object and one smoke test.
  2. Add API clients and data factories.
  3. Grow smoke and regression suites.
  4. Add CI workflows and reports, then document.

Real-world use case#

A portfolio piece that demonstrates real automation engineering skills, not just recorded scripts.

Common mistakes#

Recording tests with codegen and never refactoring

Recorded scripts are a starting point; move locators into page objects.

No README

Others cannot run or extend the framework.

Best practices#

  • Layers: config · fixtures · pages · api · data · tests
  • Tags like @smoke for selective runs
  • CI on PR and nightly
  • Document conventions

Remember this#

Pages act, tests assert, factories feed data.

@smoke on PRs, full suite nightly.

A README makes it a framework.

Practice exercise#

Your task: Run only tests tagged @smoke.

Show solution
Shell Illustrative
npx playwright test --grep @smoke

Mini quiz#

Automation Framework Project quizMultiple choice Question 1 of 1

Which suite should run on every pull request?

Score so far: 0/0

Want more? Practise all Automation Testing MCQs · Automation Testing interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.