Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 167
Fix/e2e tests#1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Fix/e2e tests #1061
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
909133c
chore: added all selected columns to the groupBy function
JohnAllenTech b685436
Merge branch 'develop' into fix/broken-article-query
JohnAllenTech 389acab
chore: updated drizzle orm dep and tested it works
JohnAllenTech 6649e50
fix: e2e tests back working
JohnAllenTech 3066351
fix: removing flaky part of e2e test
JohnAllenTech 94f8c72
chore: removing more flakiness
JohnAllenTech b2d088d
chore: working but still flaky
JohnAllenTech abdd4d1
chore: attempting to reuse single login across multiple tests
JohnAllenTech 489c459
chore: still not working in headless mode
JohnAllenTech 60ad7a8
Merge branch 'develop' into fix/e2e-tests
JohnAllenTech a0f3387
chore: reverted merge and added autheticated browser state to gitignore
JohnAllenTech 5cf2438
chore: removing browser.json to safeguard against people uploading thβ¦
JohnAllenTech 9db35ca
chore: removed playwright workflow
JohnAllenTech 28098da
Merge branch 'develop' into fix/e2e-tests
JohnAllenTech 91ea958
chore: classic hackerman stuff here
JohnAllenTech 97a9545
Merge branch 'develop' into fix/e2e-tests
JohnAllenTech 8415a67
chore: removing some unused code and making the authenticated browserβ¦
JohnAllenTech ec6172c
chore: some logging for future humans
JohnAllenTech 144a5bf
chore: nearly there. testing workflow
JohnAllenTech ed447a3
chore: updated e2e workflow to input new seed script
JohnAllenTech 9312347
chore: now logging error when browser.json fails
JohnAllenTech 7ac5ebc
chore: more logging around file creation errors
JohnAllenTech 732b6b0
chore: removed logging
JohnAllenTech 82ba182
Merge branch 'develop' into fix/e2e-tests
JohnAllenTech 86c3f68
chore: updated some naming
JohnAllenTech 6676d88
chore: now creating folder and file in workflow
JohnAllenTech f42dbf1
Merge branch 'develop' into fix/e2e-tests
NiallJoeMaher 78a03ba
chore: add more logging to file creation process
JohnAllenTech 3c8b921
chore: async file and folder creation added
JohnAllenTech e7f8d4f
chore: back to sync and more logging in folder/file creation
JohnAllenTech d62f95c
chore: removed throw errors for testing
JohnAllenTech bf7d103
chore: added hacky wait step
JohnAllenTech acf2e05
chore: new way of creating the files/folders added
JohnAllenTech e6bca18
chore: creating files successfully but module import failing
JohnAllenTech a75a83f
chore: now creating files in workflow step
JohnAllenTech 1da9338
chore: moved file/folder creation into seed step
JohnAllenTech 6154e0d
chore: removed git ignore as browser state is now fully mocked
JohnAllenTech e9fbb34
chore: now not depending on process env var
JohnAllenTech d5468c8
chore: made authenticated homepage test more robust
JohnAllenTech fbed02d
chore: replaced order of tests to see if cookies are cleared at a tesβ¦
JohnAllenTech 5f89326
chore: now seeding e2e user in normal seed script
JohnAllenTech fc64a92
chore: cleanup before PR review
JohnAllenTech 0ae6105
Merge branch 'develop' into fix/e2e-tests
JohnAllenTech b2f994f
chore: cleaning up old script
JohnAllenTech cb662cc
chore: prettier fix
JohnAllenTech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -67,4 +67,4 @@ ssmSetup.zsh | ||
| # open-next | ||
| .open-next | ||
| .open-next | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -26,6 +26,7 @@ We have a fantastic community growing on Discord. Click [here](https://discord.g | ||
| ```bash | ||
| npm install | ||
| ``` | ||
| - 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. | ||
| 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 | ||
| 6. Setup the tables in the database with Drizzle by running: | ||
| ```bash | ||
| npm run db:push | ||
| ``` | ||
| The full command can be seen in our [package.json](/package.json#16) file | ||
| 7. Seed the database with some mock data by running: | ||
| ```bash | ||
| npm run db:seed | ||
| ``` | ||
| The full command can be seen in our [package.json](/package.json#19) file | ||
| 8. Finally, run the development server: | ||
| @@ -94,17 +96,21 @@ Alternatively, if you have PostgreSQL running locally then you can use your loca | ||
| Currently, we only allow authentication via GitHub. To enable this you need to have a `GITHUB_ID` and `GITHUB_SECRET` value. | ||
| Setup your GitHub ID & Secret on GitHub: | ||
| - [Click here](https://github.com/settings/applications/new) to setup New OAuth App and fill in the details as shown below. | ||
| - [Click here](https://github.com/settings/applications/new) to setup New OAuth App and fill in the details as shown below. | ||
| For development, make sure you setup this with a **Homepage URL** of | ||
| ``` | ||
| http://localhost:3000/ | ||
| ``` | ||
| and **Authorization callback URL** of | ||
| ``` | ||
| ``` | ||
| http://localhost:3000/api/auth | ||
| ``` | ||
| as shown in the image below: | ||
|  | ||
| @@ -135,6 +141,16 @@ You shouldn't need to change the default value here. This is a variable used by | ||
| NEXTAUTH_URL=http://localhost:3000/api/auth | ||
| ``` | ||
| ### E2E_USER_SESSION_ID | ||
| This is the sessionToken uuid that . | ||
| This is currently hardcoded and there is no reason to change this until we require multiple E2E test users within the same test suite | ||
| ### E2E_USER_ID | ||
| This is the userId if the E2E user used for testing . | ||
| This is currently hardcoded and there is no reason to change this until we require multiple E2E test users within the same test suite | ||
JohnAllenTech marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| For more information, you can read the documentation [here](https://next-auth.js.org/configuration/options). | ||
| **Example .env file can be found [here](./sample.env). You can rename this to .env to get started** | ||
| @@ -147,6 +163,47 @@ For more information, you can read the documentation [here](https://next-auth.js | ||
| - Run Tests | ||
| - Also, Style Guide for Commit Messages | ||
| ## 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 | ||
| Please 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_SESSION_ID`: The session id that the user will use to authenticate. | ||
| Note the sample .env [here](./sample.env) 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 havent already | ||
| ``` | ||
| npm run db:seed | ||
| ``` | ||
| This will create a user and session for your E2E tests. Details of the E2E user created can be seen [here](./drizzle/seedE2E.ts) | ||
| ### Running the Tests | ||
| You can run the end-to-end tests using one of the following commands: | ||
| For headless mode: | ||
| ```zsh | ||
| npx playwright test | ||
| ``` | ||
| For UI mode: | ||
| ```zsh | ||
| npx playwright test --ui | ||
| ``` | ||
| ## π Prerequisite Skills to Contribute | ||
| - [Git](https://git-scm.com/) | ||
This file contains hidden or 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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.