This project automates the validation of the sorting order for the latest 100 articles on Hacker News. It ensures that the articles are displayed from newest to oldest, as expected.
- Navigates to the Hacker News "newest" page using Playwright.
- Extracts article data (rank, id, timestamp) for at least the first 100 articles.
- Validates that:
- Exactly 100 articles are collected.
- Ranks from 1 to 100 are present and sequential.
- Articles are sorted from newest to oldest by timestamp.
- Provides clear test output for each validation step.
- Uses Playwright for browser automation and robust data extraction.
- Handles pagination to ensure exactly 100 articles are collected.
- Utilizes
lodashfor concise and reliable data manipulation. - Employs
dayjsfor date parsing and comparison. - Fully automated and headless, suitable for CI pipelines or local QA validation.
- Node.js
- Playwright
- Lodash
- Dayjs