npm install
npx playwright install
# Run all tests
npm run test
# Or directly with npx
npx playwright test
You can run a separate test file using the following command:
npx playwright test admin/admin-login.spec.js
npx playwright show-report
- SITE_URL
- USER_NAME
- USER_PASSWORD
For the security reason I recoment to create a separate user for the tests and delete it after testing.
- Front Page Structure Tests (front-page/front-page-structure.spec.js) - Check that front page has header, main and footer elements.
- Search Functionality Tests (front-page/search-functionality.spec.js) - Test the search form with "New book" query and verify search results page.
- Image Check Tests (front-page/check-images.spec.js) - Verify that all images on the front page exist, load properly, and have valid image content types.
- Admin Login Tests (admin/admin-login.spec.js) - Login to admin and check that it's redirected to the user page.
- Create Page Tests (admin/create-page.spec.js) - Actually it just preview page functionality test.
- Cron Status Test (admin/cron-status.spec.js) - Verify that cron is running properly on the site.
- Updates Test (admin/updates.spec.js) - Verify that there are no available updates for the site.
- Category Filter Test (collections/category-filter.spec.js) - Test filtering collections by the "Traditions" category and verify results.
- Browse Other Collections Test (collections/other-collection-form.spec.js) - Test navigating to a collection and using the "Browse Other Collections" form to view a different collection.
- Main Menu Test (menus/main-menu.spec.js) - Verify that all links in the main menu are working and don't return 404 errors.
- Footer Menu Test (menus/footer-menu.spec.js) - Verify that all links in the footer menu are working and don't return 404 errors.
- Contact Menu Test (menus/contact-menu.spec.js) - Verify that all links in the contact menu are working and don't return 404 errors.
- Get Form Test (subscribe-paw/get-form.spec.js) - Verify that the subscription form shows validation errors when submitted empty.
- XML Sitemap Test (seo/xml-sitemap.spec.js) - Verify that the XML sitemap is accessible and not returning a 404 error.
- Robots.txt Test (seo/robots-txt.spec.js) - Verify that the robots.txt file is accessible and properly formatted.