Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

This PR implements the initial step definitions in tests/staging/step_definitions/website_steps.js using Playwright for browser automation, replacing the placeholder implementations that returned 'pending'.

Key Changes

Added Playwright Integration:

  • Added playwright as a devDependency
  • Updated Dockerfile tests target to install Playwright browsers and system dependencies
  • Configured Playwright with proper Chrome arguments for containerized environments

Implemented Step Definitions:

  1. "Given the Staging site is started" - Verifies that the BASE_URL can be reached and returns a valid HTTP response
  2. "When the index page is visited" - Navigates to the index page and ensures it loads without HTTP errors
  3. "Then the Logo should be displayed in the top left corner" - Checks that favicon.png is displayed within a <nav> element

Environment Configuration:

  • Added BASE_URL environment variable support with default value http://staging for Docker networking
  • Handles redirects gracefully (staging service redirects to production via .htaccess)
  • Added robust timeout handling (30s for navigation, 10s for element waits) suitable for Docker environments

Error Handling:

  • Comprehensive error messages for debugging test failures
  • Proper browser cleanup with BeforeAll/AfterAll hooks
  • Graceful handling of network timeouts and element visibility

The implementation follows the existing Docker Compose setup where the staging service serves the built site and test service runs the BDD tests. The step definitions are compatible with the current workflow structure and will integrate seamlessly with GitHub Actions.

Fixes #237.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/builds/chromium/1181/chromium-linux.zip
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/orionrobots.github.io/orionrobots.github.io/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits August 4, 2025 16:29
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Implement the initial step definitions in tests/staging/step_definitions/website_steps.js Implement Playwright step definitions for BDD staging tests Aug 4, 2025
@Copilot Copilot AI requested a review from dannystaple August 4, 2025 16:48
Copilot finished work on behalf of dannystaple August 4, 2025 16:48
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.08s
✅ BASH bash-exec 1 0 0 0.0s
✅ BASH shellcheck 1 0 0 0.06s
⚠️ BASH shfmt 1 1 0 0.0s
❌ C cppcheck 8 8 0 0.27s
❌ CPP cppcheck 8 8 0 0.28s
✅ JSON npm-package-json-lint yes no no 0.42s
✅ JSON v8r 12 0 0 7.42s
❌ MARKDOWN markdown-link-check 736 213 0 38.8s
✅ REPOSITORY gitleaks yes no no 14.34s
✅ REPOSITORY git_diff yes no no 0.56s
✅ REPOSITORY grype yes no no 33.01s
✅ REPOSITORY secretlint yes no no 42.6s
✅ REPOSITORY syft yes no no 1.68s
✅ REPOSITORY trivy-sbom yes no no 3.4s
✅ REPOSITORY trufflehog yes no no 4.74s
✅ XML xmllint 1 0 0 189.99s
✅ YAML v8r 13 0 0 7.17s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@dannystaple dannystaple marked this pull request as ready for review August 4, 2025 19:12
@dannystaple dannystaple merged commit e722471 into master Aug 4, 2025
4 checks passed
@dannystaple dannystaple deleted the copilot/fix-237 branch August 4, 2025 19:12
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.

Implement the initial step definitions in tests/staging/step_definitions/website_steps.js
2 participants