Skip to content

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
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 11, 2025

This PR adds comprehensive BDD tests for validating article content and layout, specifically targeting the article at /2025/07/08/08-comparing-anker-power-packs.html, and fixes the GitHub Actions workflow to ensure the tests can run on pull requests.

What's Added

BDD Test Suite:

  • New feature file tests/staging/features/article-content.feature with two scenarios:
    1. Article Content Validation - Tests all required page elements
    2. Desktop Layout Validation - Tests responsive layout doesn't overflow

Enhanced Step Definitions:

  • Added 9 new step definitions to tests/staging/step_definitions/website_steps.js
  • Comprehensive selectors for tags, headers, images, footer links, and layout validation
  • Properly scoped validation ensuring tag links are validated within the tags navigation element

Workflow Fix:

  • Removed paths restriction from .github/workflows/on_pr_test.yaml to allow BDD tests to run on all PRs instead of being limited to specific file paths

Test Coverage

The tests validate all requirements from the original issue:

  • Tags navigation with links to tag slugs (/tags/robotics-at-home, /tags/raspberry-pi, etc.)
  • Post header in H2 element with proper styling
  • Page title contains both post title and "orionrobots"
  • Visible images inside <article> tag with valid src attributes (7 images found)
  • Date and author in div element with proper semantic markup
  • Footer with Discord and YouTube links
  • Main navigation menu at top of page
  • Desktop layout prevents content overflow into sidebar

Usage

Run the BDD tests using Docker:

docker compose run test

The tests use the existing Cucumber.js + Playwright framework and follow the same patterns as other tests in the repository.

Fixes #262.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Add BDD tests for a test article Add BDD tests for article content validation Aug 11, 2025
@Copilot Copilot AI requested a review from dannystaple August 11, 2025 17:45
Copilot finished work on behalf of dannystaple August 11, 2025 17:45
@Copilot Copilot AI requested a review from dannystaple August 11, 2025 18:52
Copilot finished work on behalf of dannystaple August 11, 2025 18:52
@Copilot Copilot AI requested a review from dannystaple August 12, 2025 11:55
Copilot finished work on behalf of dannystaple August 12, 2025 11:55
@dannystaple dannystaple marked this pull request as ready for review August 12, 2025 21:01
Copy link
Contributor

github-actions bot commented Aug 12, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
❌ ACTION actionlint 5 6 0 0.09s
✅ BASH bash-exec 1 0 0 0.0s
✅ BASH shellcheck 1 0 0 0.05s
⚠️ BASH shfmt 1 1 0 0.0s
❌ C cppcheck 8 8 0 0.21s
❌ CPP cppcheck 8 8 0 0.32s
✅ JSON npm-package-json-lint yes no no 0.42s
✅ JSON v8r 12 0 0 8.16s
❌ MARKDOWN markdown-link-check 739 214 0 50.15s
✅ REPOSITORY gitleaks yes no no 12.72s
✅ REPOSITORY git_diff yes no no 0.39s
❌ REPOSITORY grype yes 2 no 33.94s
✅ REPOSITORY secretlint yes no no 43.35s
✅ REPOSITORY syft yes no no 2.06s
✅ REPOSITORY trivy-sbom yes no no 3.29s
✅ REPOSITORY trufflehog yes no no 4.98s
✅ XML xmllint 1 0 0 190.08s
✅ YAML v8r 13 0 0 6.97s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@dannystaple
Copy link
Member

@copilot I've spotted a problem, the tests in .github/workflows/on_pr_test.yaml are only set to run if certain paths are changed. I think removing the on.pull_request.paths item will allow the tests to run in this pr. We can refine and exclude things later if they are irrelevant.

Copy link
Contributor Author

Copilot AI commented Aug 12, 2025

@copilot I've spotted a problem, the tests in .github/workflows/on_pr_test.yaml are only set to run if certain paths are changed. I think removing the on.pull_request.paths item will allow the tests t...

Fixed! Removed the paths restriction from .github/workflows/on_pr_test.yaml so the BDD tests can now run on this PR. The workflow will now run on all PRs to master/main branches. Fixed in 1359c28.

@Copilot Copilot AI changed the title Add BDD tests for article content validation Add BDD tests for article content validation and enable test workflow Aug 12, 2025
Copilot finished work on behalf of dannystaple August 12, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add BDD tests for a test article
2 participants