This project contains Playwright tests with custom annotations and comprehensive test scenarios, including:
- Use of annotations in your test scripts (Page title verification test case) - HTML reports will include the same in a separate section which can be used for better reporting)

- Employee CRUD (Create, Read, Update, Delete) Operations
- Node.js (version 16 or higher)
- npm
- Playwright
- Clone the repository:
git clone https://github.com/Zahid-Automate/Playwright-CURD-Operation.git
- Install dependencies:
npm install
- Install Playwright browsers:
npx playwright install
npx playwright test
npx playwright test --grep "@slow"
- Description: Verifies the title of the Playwright documentation page
- Tags: @slow
- Annotations:
- BugFix: BUGID#45443
- Sprint 39: Patch Release
- Description: Comprehensive test suite for Employee management
- Test Cases:
-
Add New Employee
- Generates a random user
- Navigates to employees page
- Adds a new employee
- Verifies employee addition
-
Update Employee
- Locates the last added employee
- Updates employee details
- Verifies update was successful
-
Delete Employee
- Adds a new employee
- Deletes the employee record
-
createRandomUser()
: Generates random user data for testingpaginationGoToLastPage()
: Navigates to the last page of pagination
- Base URL: http://localhost:8000/
- Department Selection: Department 2
- Timeout: 5000ms (for some operations)
BASE_URL
: Base URL of the applicationDEPARTMENT_ID
: Default department for employee creation (currently set to '2')
- Random user generation for consistent but unique test data
- Supports repeatable and reliable testing scenarios
- Ensure local server is running at http://localhost:8000/
- Check network connectivity
- Verify Playwright browser drivers are up to date
- Validate test data generation utility
- Uses serial test description to ensure test order
- Implements comprehensive error checking
- Utilizes page object model principles
- Generates unique test data for each run
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
- Ensure all dependencies are up to date
- Run
npm test
to execute the full test suite - Review test reports for detailed insights