mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
2.3 KiB
2.3 KiB
Integration Tests
This directory contains end-to-end integration tests for the application using Playwright.
Prerequisites
- Node.js (v18 or higher)
- npm or yarn
- Playwright browsers installed
Setup
- Install dependencies:
npm install
# or
yarn install
- Install Playwright browsers:
npx playwright install
- Create a
.envfile in thetests/integration-testsdirectory with the following variables:
BASE_URL=http://localhost:3000 # Your application URL
EMAIL=your-email@example.com # Your test user email
PASSWORD_BASE64=base64-encoded-password # Your test user password in base64
Running Tests
Authentication Setup
First, you need to set up the authentication state:
npx playwright test auth.setup.ts
This will create a playwright/.auth/user.json file containing the authentication state.
Running All Tests
npx playwright test
Running Specific Test Files
# Run a specific test file
npx playwright test projects.spec.ts
# Run tests in a specific browser
npx playwright test --project=chromium
Running Tests in UI Mode
npx playwright test --ui
Debugging Tests
# Run tests in debug mode
npx playwright test --debug
# Run a specific test in debug mode
npx playwright test projects.spec.ts --debug
Test Structure
auth.setup.ts: Handles user authentication and creates a persistent auth stateprojects.spec.ts: Contains the actual test cases for the projects functionality
Test Reports
After running tests, you can view the HTML report:
npx playwright show-report
Troubleshooting
-
If tests fail due to authentication:
- Delete the
playwright/.auth/user.jsonfile - Run
npx playwright test auth.setup.tsagain - Try running your tests
- Delete the
-
If you need to see what's happening during test execution:
- Use
--debugflag - Or run with
--headedflag to see the browser
- Use
-
If you need to update the auth state:
- Delete the existing auth file
- Run the auth setup again
- Run your tests
CI/CD Integration
For CI/CD environments, make sure to:
- Set the appropriate environment variables
- Run
npx playwright install-depsbefore running tests - Use
--reporter=htmlfor test reports