-
Notifications
You must be signed in to change notification settings - Fork 1
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
Configure E2E testing package #1493
Merged
Merged
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
23a4349
Move end-to-end tests
trslater 60b7b59
Clean up env data
trslater 7ba82a6
Clean up unused files
trslater a7e3fbd
Add types for Node
trslater 9ccd635
Allow .env configurable secrets for local dev
trslater 13a6781
Align editor style with other projects
trslater 02fe763
Add `template.env` and instructions to setup local secrets
trslater d02eac4
Add table of contents
trslater f2e12fe
First draft of GitHub actions for E2E testing
trslater dd674ee
Remove unnecessary editor config
trslater d216722
Replace user/pass env vars with correct name
trslater 2fde234
Add expect statement to test
trslater 3c56819
Fix UI mode instructions
trslater 46beaae
Add back editor config
trslater 82051b4
Ignore test results
trslater ecdcc9e
Configure project for portal
trslater ddde7ae
Improve login test
trslater 0c1dabd
Add instructions on running projects
trslater 55ee278
Fix comment on cron
trslater a578144
Allow running E2E tests manually
trslater 352b23f
Use correct branch and working-dir
trslater d67686d
Do not include GitHub workflow in this branch
trslater 28d1696
Start writing tests instructions
trslater 66f1f19
Use basic login fixture
trslater 76a41cc
Run tests against dev env for now
trslater cf98b33
Load base URL from environment
trslater d17ead4
Create better frontend/browser selection strategy
trslater b97c5ab
Setup Prettier/eslint
trslater 8ef944d
Move Node types to dev deps
trslater File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
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,2 @@ | ||
.env | ||
test-results/ |
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,8 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"bracketSpacing": true | ||
} |
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,87 @@ | ||
# End-to-End Testing | ||
|
||
- [Writing Tests](#writing-tests) | ||
- [Running Tests](#running-tests) | ||
- [Local Setup](#local-setup) | ||
- [Installation](#installation) | ||
- [Configure secrets](#configure-secrets) | ||
|
||
E2E test automation is implemented using the [Playwright](https://playwright.dev/). | ||
|
||
> [!WARNING] | ||
> When writing tests, make sure they do not contain any credentials _before_ committing to the repo. | ||
|
||
## Writing Tests | ||
|
||
- Write tests for a given project, i.e., tests for the portal go in `/e2e/tests/portal`. | ||
|
||
## Running Tests | ||
|
||
To run tests: | ||
|
||
```bash | ||
$ npx playwright test | ||
``` | ||
|
||
To run tests just for a specific browser: | ||
|
||
```bash | ||
$ npx playwright test --project=[chromium] | ||
``` | ||
|
||
To run tests just for a specific frontend, specify by directory: | ||
|
||
```bash | ||
$ npx playwright test portal/ | ||
``` | ||
|
||
These can be combined: | ||
|
||
````bash | ||
$ npx playwright test --project=chromium portal/ | ||
``` | ||
|
||
To run headed: | ||
|
||
```bash | ||
$ npx playwright test --headed | ||
```` | ||
|
||
To run in UI mode: | ||
|
||
```bash | ||
$ npx playwright test --ui | ||
``` | ||
|
||
To run in debug mode: | ||
|
||
```bash | ||
$ npx playwright test --debug | ||
``` | ||
|
||
To show a report: | ||
|
||
```bash | ||
$ npx playwright show-report REPORT_DIR | ||
``` | ||
|
||
## Local Setup | ||
|
||
### Installation | ||
|
||
Install package: | ||
|
||
```bash | ||
$ npm i | ||
``` | ||
|
||
Install browsers: | ||
|
||
```bash | ||
$ npx playwright install | ||
``` | ||
|
||
### Configure secrets | ||
|
||
1. Copy `template.env` --> `.env` | ||
2. Fill in details |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use prettier like all our other packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this from portal frontend, so does it need to be updated as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I have no idea what this file does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It configures the code style for editors. It's set up the same for portal and ALCS frontends, not for services. Perhaps it is part of Angular scaffolding?
For now I'll leave it, but I'll install prettier as a dev dep and include
.prettierrc
as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added prettier and eslint