This directory contains end-to-end tests for the GitBucket NavLink Plugin using Playwright.
- Node.js 24
- Docker and Docker Compose
- GitBucket instance running on http://localhost:8080
- Install dependencies:
cd e2e
npm install- Install Playwright browsers:
npx playwright install chromium- Start GitBucket and PostgreSQL:
cd ..
docker compose up -d-
Wait for GitBucket to be ready (usually takes 30-60 seconds)
-
Build and install the plugin:
cd ..
export GITBUCKET_HOME=$(pwd)/docker
sbt install- Restart GitBucket to load the plugin:
docker compose restart gitbucket- Wait for GitBucket to restart, then run the tests:
cd e2e
npm test- Run all tests:
npm test - Run tests in headed mode (see browser):
npm run test:headed - Run tests in debug mode:
npm run test:debug - Open Playwright UI:
npm run test:ui
playwright.config.ts- Playwright configurationtests/navlink.spec.ts- E2E test suite for NavLink functionality
The test suite covers:
- Settings Access: Verify admin can access NavLink settings page
- Settings Update: Test updating NavLink configuration (menu name and path)
- Global Menu Display: Verify NavLink appears in navigation after configuration
- Form Validation: Test required field validation
- Data Persistence: Verify settings persist across page reloads
- If tests fail with connection errors, ensure GitBucket is running on http://localhost:8080
- If tests fail with timeout errors, increase the timeout in
playwright.config.ts - Check GitBucket logs:
docker compose logs -f gitbucket - If the plugin is not loaded, verify the JAR file exists in
docker/plugins/
The E2E tests are integrated into the GitHub Actions workflow. They run automatically on pull requests to master and develop branches.