You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-3Lines changed: 60 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ We have a fantastic community growing on Discord. Click [here](https://discord.g
26
26
```bash
27
27
npm install
28
28
```
29
+
29
30
- If you have any issues installing dependencies, check your node version against that defined in the `.nvmrc`. If you're using `nvm`, you can run `nvm use` before installing dependencies.
30
31
31
32
5. Create a `.env` file and add the following variables. You can copy the contents of `sample.env` with `cat sample.env > .env`.
@@ -46,17 +47,18 @@ For a more detailed how to guide on setting them up [go to the Environment Varia
46
47
47
48
6. Setup the tables in the database with Drizzle by running:
48
49
49
-
50
50
```bash
51
51
npm run db:push
52
52
```
53
+
53
54
The full command can be seen in our [package.json](/package.json#16) file
54
55
55
56
7. Seed the database with some mock data by running:
56
57
57
58
```bash
58
59
npm run db:seed
59
60
```
61
+
60
62
The full command can be seen in our [package.json](/package.json#19) file
61
63
62
64
8. Finally, run the development server:
@@ -94,17 +96,21 @@ Alternatively, if you have PostgreSQL running locally then you can use your loca
94
96
Currently, we only allow authentication via GitHub. To enable this you need to have a `GITHUB_ID` and `GITHUB_SECRET` value.
95
97
96
98
Setup your GitHub ID & Secret on GitHub:
97
-
-[Click here](https://github.com/settings/applications/new) to setup New OAuth App and fill in the details as shown below.
98
99
100
+
-[Click here](https://github.com/settings/applications/new) to setup New OAuth App and fill in the details as shown below.
99
101
100
102
For development, make sure you setup this with a **Homepage URL** of
103
+
101
104
```
102
105
http://localhost:3000/
103
106
```
107
+
104
108
and **Authorization callback URL** of
105
-
```
109
+
110
+
```
106
111
http://localhost:3000/api/auth
107
112
```
113
+
108
114
as shown in the image below:
109
115
110
116

@@ -135,6 +141,16 @@ You shouldn't need to change the default value here. This is a variable used by
135
141
NEXTAUTH_URL=http://localhost:3000/api/auth
136
142
```
137
143
144
+
### E2E_USER_SESSION_ID
145
+
146
+
This is the sessionToken uuid that .
147
+
This is currently hardcoded and there is no reason to change this until we require multiple E2E test users within the same test suite
148
+
149
+
### E2E_USER_ID
150
+
151
+
This is the userId if the E2E user used for testing .
152
+
This is currently hardcoded and there is no reason to change this until we require multiple E2E test users within the same test suite
153
+
138
154
For more information, you can read the documentation [here](https://next-auth.js.org/configuration/options).
139
155
**Example .env file can be found [here](./sample.env). You can rename this to .env to get started**
140
156
@@ -147,6 +163,47 @@ For more information, you can read the documentation [here](https://next-auth.js
147
163
- Run Tests
148
164
- Also, Style Guide for Commit Messages
149
165
166
+
## End-to-End Testing with Playwright
167
+
168
+
To run the end-to-end tests using Playwright, you need to configure your environment and follow these steps:
169
+
170
+
### Environment Variables
171
+
172
+
Please ensure you have the following variables set in your `.env` file:
173
+
174
+
-`E2E_USER_ID`: The id of the E2E user for testing.
175
+
-`E2E_USER_EMAIL`: The email of the E2E user for testing.
176
+
-`E2E_USER_SESSION_ID`: The session id that the user will use to authenticate.
177
+
178
+
179
+
Note the sample .env [here](./sample.env) is fine to use.
180
+
181
+
### Session and User setup
182
+
183
+
First you need to add your E2E test user to your locally running database. Do this by running the following script if you havent already
184
+
185
+
```
186
+
npm run db:seed
187
+
```
188
+
189
+
This will create a user and session for your E2E tests. Details of the E2E user created can be seen [here](./drizzle/seedE2E.ts)
190
+
191
+
### Running the Tests
192
+
193
+
You can run the end-to-end tests using one of the following commands:
0 commit comments