Skip to content

This project demonstrates automated testing of web applications using Playwright on LetCode. It covers testing scenarios like form handling, button clicks, input fields, and element interactions, showcasing Playwright's capabilities in real-world test cases.

License

Notifications You must be signed in to change notification settings

darvinpatel/playwright-demo-letcode

Repository files navigation

Practice test automation with Playwright Logo on Let Code

Note

  • Let Code is a set of very clean pages along with video tutorials explaining how to automate interactions.

PLaywright features

End to End testing using:

This tests are purely for Playwright features practice to automate interactions with:

  • Inputs
  • Buttons
  • Select ✅
  • Alert 💬
  • Frame 👉
  • Radio 🔘
  • Window
  • Elements 🎲
  • Drag&Drop
  • Sort
  • Multi-select 💫
  • Slider
  • Table
  • Calendar 📆
  • Waits 🕜
  • Forms ⁉️
  • File 📝
  • Shadow 👻

Structure

Folders

  • tests 📁 This folder contains actual test scripts.
  • services 📁 This folder containse enums,pages and steps. Page functions are functions that return Locators or Promises<> that we solve later. We use those functions in the Steps class. The Steps class literally contains the steps that we will do in the test files to execute a test case (add a book to the cart, open the cart, confirm that the book is in the cart).
  • download 📁 This folder contains downloaded files for testing purposes.
  • test-data 📁 This folder contains files with test data.

Files

  • 📄 .gitignore: This file helps while using git repository
  • 📄 package.json and package-lock.json: Those files helps to track dependencies, create a shortcut for running tests, etc.
  • 📄 playwright.config.ts: This is the global configuration file for the Playwright
  • 📄 tsconfig.json: This is a config file which helps us avoid some JS syntax errors & use better the TS features.
  • 📄 environments.json:
  • 📄 selectors.json: This is where we store all selectors.

Useful Commands

Run all tests in Playwright

npm run test

Run tests with TAGs

Tag = @alert

npm run test-a

Tag = @drop

npm run test-d

Tag = @input

npm run test-i

Tag = @select

npm run test-s

Tag = @radio

npm run test-r

Tag = @slider

npm run test-sl

Tag = @table

npm run test-t

Tag = @file

npm run test-f

About

This project demonstrates automated testing of web applications using Playwright on LetCode. It covers testing scenarios like form handling, button clicks, input fields, and element interactions, showcasing Playwright's capabilities in real-world test cases.

Topics

Resources

License

Stars

Watchers

Forks