-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/playwright tests #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: astro
Are you sure you want to change the base?
Conversation
Introduces Playwright-based test helpers and test suites for SEO, performance, and social media meta tags. Adds new exports in the tests module, updates .gitignore for Playwright artifacts, and declares Playwright as a peer dependency in package.json.
Introduces a new test suite under src/tests and helpers for validating SEO, performance, and social media meta tags using Playwright. Adds build scripts, exports, and TypeScript config for test code. Removes test exports from main index to keep test utilities separate from the main package exports.
Converted all test suite and helper module exports from ES module syntax to CommonJS for compatibility. Updated import statements to use require and adjusted function exports accordingly in dist/helpers/TestsHelper.js, dist/tests/index.js, and all test suite files.
Renamed test suite functions for consistency (e.g., SeoTest_* to TestSeo_*), added skip logic and improved error reporting for image and iframe tests, and introduced new helper functions for element existence and content checks. Updated type definitions and testDist outputs accordingly. Social media tests now support additional Open Graph and Twitter meta tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds Playwright-based end-to-end testing infrastructure to the hat-ring-components library. The changes introduce reusable test suites for validating SEO metadata, performance optimizations (like lazy loading), and social media tags (Open Graph and Twitter Cards).
Changes:
- Added Playwright test suites for SEO, performance, and social media validation with configurable test functions
- Created TypeScript configuration for compiling tests to CommonJS in
testDist/directory - Added Grid component exports (Grid, Box, Container) to main package exports
Reviewed changes
Copilot reviewed 15 out of 28 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.tests.json | TypeScript configuration for test compilation with CommonJS output |
| src/tests/types.ts | TypeScript interfaces for Playwright test wrapper types |
| src/tests/suites/seo.test.ts | SEO validation tests for title, meta tags, structured data, and accessibility |
| src/tests/suites/performance.test.ts | Performance tests for image lazy-loading and iframe optimization |
| src/tests/suites/socialMedia.test.ts | Tests for Open Graph and Twitter Card meta tags |
| src/tests/index.ts | Central export file for all test suites |
| src/helpers/TestsHelper.ts | Helper functions for extracting meta content and structured data from pages |
| package.json | Added Playwright peer dependencies and build scripts for tests |
| .gitignore | Added Playwright-specific ignore patterns |
| src/index.ts | Exported Grid layout components |
| testDist/** | Compiled JavaScript output from TypeScript (all files) |
Updated the 'build:tests' and 'run:tests' npm scripts to include the --clean flag, ensuring a clean build for test projects.
Removed unnecessary --clean flag from test build scripts in package.json. Improved formatting and variable usage in performance and SEO test suites for better readability and correctness.
No description provided.