-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into chore/adding-my-posts-e2e-tests
- Loading branch information
Showing
3 changed files
with
78 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# End-to-End Testing with Playwright | ||
|
||
To run the end-to-end tests using Playwright, you need to configure your environment and follow these steps: | ||
|
||
### Environment Variables | ||
|
||
Ensure you have the following variables set in your `.env` file: | ||
|
||
- `E2E_USER_ID`: The ID of the E2E user for testing. | ||
- `E2E_USER_EMAIL`: The email of the E2E user for testing. | ||
- `E2E_USER_ONE_SESSION_ID`: The session ID that the user will use to authenticate. | ||
|
||
Note: The sample `.env` file is fine to use. | ||
|
||
### Session and User Setup | ||
|
||
First, you need to add your E2E test user to your locally running database. Do this by running the following script if you haven't already: | ||
|
||
```bash | ||
npm run db:seed | ||
``` | ||
|
||
This will create a user and session for your E2E tests. Details of the E2E user created can be seen in `drizzle/seedE2E.ts`. | ||
|
||
### Running the Tests | ||
|
||
You can run the end-to-end tests using one of the following commands: | ||
|
||
For headless mode: | ||
|
||
```bash | ||
npx playwright test | ||
``` | ||
|
||
For UI mode: | ||
|
||
```bash | ||
npx playwright test --ui | ||
``` | ||
|
||
### Additional E2E Environment Variables | ||
|
||
- **E2E_USER_ONE_SESSION_ID**: This is the session token UUID for one E2E user. | ||
- **E2E_USER_TWO_SESSION_ID**: This is the session token UUID for another E2E user. | ||
- **E2E_USER_ONE_ID**: The user ID of one of the E2E users. | ||
- **E2E_USER_TWO_ID**: The user ID of another E2E user. | ||
|
||
These values are currently hardcoded and should be unique for each user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters