Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 3, 2025

This PR implements a comprehensive BDD (Behavior-Driven Development) integration test infrastructure using Gherkin syntax and Cucumber.js for the OrionRobots website.

What's Added

Test Infrastructure:

  • Created tests/staging/ folder structure with a sample Gherkin feature file
  • Installed @cucumber/cucumber as a dev dependency for JavaScript BDD testing
  • Added basic step definitions that return "pending" status (implementations to be added later)

Build Integration:

  • Added tests folder to .eleventyignore to prevent Eleventy from processing test files during site builds
  • Updated npm scripts: test now runs test:bdd which executes Cucumber tests
  • Verified Eleventy builds continue to work correctly (1383 files processed successfully)

Docker Support:

  • Created tests.Dockerfile with Alpine-based Node.js image for containerized testing
  • Added test service to docker-compose.yml under manual profile
  • Tests can be run with docker compose run test

Documentation:

  • Updated README.md with "Running Tests" section explaining both local and Docker test execution
  • Documented the BDD integration testing approach and available commands
  • Added recommendation to use Docker Compose for CI/workflows
  • Added "Project tooling strategy" section explaining the Docker Compose first approach and JavaScript tooling preference

CI/CD Integration:

  • Enhanced .github/workflows/on_call_staging_test.yaml to include BDD test execution using Docker Compose
  • Integrated BDD tests into the existing "Run as service and test" step after curl tests
  • Tests run in containerized environment alongside staging service
  • Test results are captured and posted as workflow summary
  • Tests are non-gating (expected to fail until step implementations are complete)

Code Quality:

  • Added final newlines to test files per .editorconfig requirements
  • Fixed terminology from "Unit Tests" to "Integration Tests" in README

Sample Test Output

The framework runs successfully and shows the expected behavior:

> cucumber-js tests/staging/features --require tests/staging/step_definitions/**/*.js

P--

Warnings:

1) Scenario: Logo on main index in staging # tests/staging/features/website-logo.feature:3
   ✓ Given the Staging site is started # tests/staging/step_definitions/website_steps.js:8
       Pending
   - When the index page is visited # tests/staging/step_definitions/website_steps.js:13
   - Then the Logo should be displayed in the top left corner # tests/staging/step_definitions/website_steps.js:18

1 scenario (1 pending)
3 steps (1 pending, 2 skipped)

These are integration tests that require the staging site to be running, making them suitable for end-to-end validation of website functionality. The framework is properly configured and ready for step implementation development.

Fixes #227.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits August 3, 2025 14:32
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
…mization

Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Create a starter gherkin test setup Create a starter Gherkin BDD test setup with Cucumber.js Aug 3, 2025
@Copilot Copilot AI requested a review from dannystaple August 3, 2025 14:39
Copilot finished work on behalf of dannystaple August 3, 2025 14:39
…e into CI workflow

Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
@Copilot Copilot AI changed the title Create a starter Gherkin BDD test setup with Cucumber.js Create a starter Gherkin BDD integration test setup with Cucumber.js Aug 3, 2025
@Copilot Copilot AI requested a review from dannystaple August 3, 2025 18:43
Copilot finished work on behalf of dannystaple August 3, 2025 18:43
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
Copilot finished work on behalf of dannystaple August 3, 2025 18:49
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
Copilot finished work on behalf of dannystaple August 4, 2025 08:52
@dannystaple dannystaple marked this pull request as ready for review August 4, 2025 08:57
Copy link
Contributor

github-actions bot commented Aug 4, 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.01s
✅ BASH shellcheck 1 0 0 0.06s
⚠️ BASH shfmt 1 1 0 0.0s
❌ C cppcheck 8 8 0 0.3s
❌ CPP cppcheck 8 8 0 0.29s
✅ JSON npm-package-json-lint yes no no 0.41s
✅ JSON v8r 12 0 0 6.8s
❌ MARKDOWN markdown-link-check 736 212 0 43.13s
✅ REPOSITORY gitleaks yes no no 12.93s
✅ REPOSITORY git_diff yes no no 1.38s
✅ REPOSITORY grype yes no no 36.78s
✅ REPOSITORY secretlint yes no no 41.2s
✅ REPOSITORY syft yes no no 1.72s
✅ REPOSITORY trivy-sbom yes no no 3.43s
✅ REPOSITORY trufflehog yes no no 5.02s
✅ XML xmllint 1 0 0 195.68s
✅ YAML v8r 13 0 0 6.47s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@dannystaple dannystaple merged commit 4b3663b into master Aug 4, 2025
4 checks passed
@dannystaple dannystaple deleted the copilot/fix-227 branch August 4, 2025 09:06
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.

Create a starter gherkin test setup
2 participants