-
Notifications
You must be signed in to change notification settings - Fork 1
Add BDD tests for article content validation and enable test workflow #263
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
Open
Copilot
wants to merge
8
commits into
master
Choose a base branch
from
copilot/fix-262
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
248fde2
Initial plan
Copilot 8a41e9e
Create BDD tests for article content validation
Copilot 0667dbd
Complete BDD tests implementation with validation script and document…
Copilot c76a87e
Address PR feedback: remove fallback script, simplify docs, fix test …
Copilot 6615e67
Update documentation based on PR feedback
Copilot 08eee49
Merge branch 'master' into copilot/fix-262
dannystaple 1359c28
Remove paths restriction from PR test workflow to enable BDD tests
Copilot 2d61724
Merge branch 'master' into copilot/fix-262
dannystaple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Article Content Tests | ||
|
||
This directory contains BDD tests for validating article content and layout. | ||
|
||
## Test Files | ||
|
||
### `article-content.feature` | ||
Contains two scenarios testing the article at `/2025/07/08/08-comparing-anker-power-packs.html`: | ||
|
||
1. **Article Content Validation**: Tests that the article has: | ||
- Tags navigation with links to tag slugs | ||
- Post header in H2 element | ||
- Page title containing post title and "orionrobots" | ||
- Visible images inside article tag without dead links | ||
- Date and author in div element | ||
- Footer with Discord and YouTube links | ||
- Main navigation menu at top | ||
|
||
2. **Desktop Layout Validation**: Tests that in desktop view: | ||
- Images, tables and text don't overflow the article container margin | ||
dannystaple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### `validate-article.sh` | ||
A simple bash script that validates article structure without requiring Playwright. This is useful for: | ||
- Quick validation during development | ||
- CI environments where Playwright installation fails | ||
- Manual testing | ||
|
||
## Running Tests | ||
|
||
### BDD Tests (Preferred) | ||
```bash | ||
# With local server | ||
BASE_URL=http://localhost:8080 npm run test:bdd | ||
dannystaple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# With Docker (includes staging server) | ||
docker compose --profile manual run test | ||
``` | ||
|
||
### Simple Validation (Fallback) | ||
```bash | ||
# Start a local server first | ||
cd _site && python3 -m http.server 8080 | ||
|
||
# Run validation | ||
./tests/validate-article.sh | ||
``` | ||
dannystaple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Prerequisites | ||
|
||
### For BDD Tests | ||
- Playwright browsers installed (`npx playwright install`) | ||
- Site built and served (see project README) | ||
|
||
### For Simple Validation | ||
- `curl` command available | ||
- Site served on localhost:8080 | ||
dannystaple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Test Coverage | ||
|
||
The tests validate that the article meets all requirements specified in issue #262: | ||
|
||
- ✅ Set of tags in nav linking to tag slug places | ||
- ✅ Post header in H2 element | ||
- ✅ Page title contains post title and "orionrobots" | ||
- ✅ Visible images inside article tag (not dead links) | ||
- ✅ Date and author in div element | ||
- ✅ Footer with Discord and YouTube links | ||
- ✅ Main menu navigation at top | ||
- ✅ Desktop layout doesn't overflow into sidebar | ||
dannystaple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Article Structure Verified | ||
|
||
The target article `/2025/07/08/08-comparing-anker-power-packs.html` contains: | ||
|
||
- Title: "Comparing anker power packs | Orionrobots - Learn to build robots at home" | ||
- H2 header with `class="page-header"` | ||
- 4 tag links: `/tags/robotics-at-home`, `/tags/robotics-projects`, `/tags/raspberry-pi`, `/tags/robot-building` | ||
- 7 images within `<article>` tag with proper src attributes | ||
- Date/author in `<div class="date text-secondary">` with `<time>` and author info | ||
- Footer with Discord (`discord.gg`) and YouTube (`youtube.com/orionrobots`) links | ||
- Main navigation in `<nav class="navbar">` | ||
dannystaple marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Feature: Article Content Tests | ||
|
||
Scenario: Article has required content elements | ||
Given the Staging site is started | ||
When I navigate to the article "/2025/07/08/08-comparing-anker-power-packs.html" | ||
Then the article should have a set of tags in a nav linking to tag slugs | ||
And the article should have a post header in an H2 element | ||
And the page title should contain the post title and "orionrobots" | ||
And the article should have visible images inside the article tag | ||
And the article should have a date and author in a div element | ||
And the page should have a footer with Discord and YouTube links | ||
And the page should have the main menu in a nav element at the top | ||
|
||
Scenario: Desktop view layout does not overflow | ||
Given the Staging site is started | ||
When I navigate to the article "/2025/07/08/08-comparing-anker-power-packs.html" | ||
And I am in desktop view | ||
Then the images, tables and text should not overflow the article container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.