mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
.. | ||
e2e | ||
README.md |
End-to-End Tests
This directory contains end-to-end tests using Playwright.
Running Tests
You can run the tests using the following commands:
# Run all tests
pnpm test:e2e
# Run tests in UI mode
pnpm test:e2e:ui
# Run only Chromium tests
pnpm test:e2e:chromium
Test Structure
e2e/
- Contains all end-to-end testssetup/
- Test utilities and helper functionshomepage.spec.ts
- Tests for the homepagechat.spec.ts
- Tests for the chat interface
Adding New Tests
When adding new tests:
- Create a new
.spec.ts
file in thee2e/
directory - Import the necessary utilities from
setup/test-utils.ts
- Use the
test.describe()
andtest()
functions to define test suites and cases
Debugging Tests
You can debug tests by running them in UI mode:
pnpm test:e2e:ui
This will open the Playwright UI, where you can:
- See test results
- View screenshots and videos
- Trace test execution
- Re-run specific tests
Test Data Attributes
For reliable selectors, we use data attributes in our components:
data-testid="chat-interface"
- The main chat interfacedata-testid="message-input"
- The message input fielddata-testid="send-button"
- The send message buttondata-testid="assistant-message"
- Messages from the assistantdata-testid="model-selector"
- The model selection dropdowndata-testid="model-option"
- Individual model options in the dropdown
Configuration
The Playwright configuration is in playwright.config.ts
at the project root.