-
Notifications
You must be signed in to change notification settings - Fork 77
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
Use playwright for functional tests #1163
Conversation
e8e7cab
to
4fb26fb
Compare
# Upload playwright traces if tests fail | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-traces | ||
path: build/test-results/ |
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.
Uploads traces you can view at https://trace.playwright.dev/ if tests fail
@@ -34,6 +34,7 @@ $(document).ready(function() { | |||
$('#current-uii').text(deptUiidLabel); | |||
$('#uii-question').show(); | |||
} else { | |||
$('#unique_internal_identifier').text(''); |
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.
Fixed a minor bug where unique internal identifier would still be included in the form submission if you fill in the field for a department with UII but then switched to a department without UII
@@ -107,3 +107,4 @@ services: | |||
TIMEZONE: "America/Chicago" | |||
volumes: | |||
- ./OpenOversight/:/usr/src/app/OpenOversight/:z | |||
- ./build/test-results:/test-results |
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.
Mount the folder with Playwright traces to build/test-results
COPY requirements.txt dev-requirements.txt /usr/src/app/ | ||
# install rust and cargo so we can use jellyfish | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ | ||
. "$HOME/.cargo/env" && \ | ||
pip3 install --no-cache-dir -r requirements.txt && \ | ||
pip3 install --no-cache-dir -r dev-requirements.txt | ||
|
||
RUN playwright install --with-deps chromium |
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.
Switching functional tests from Firefox to Chromium due to current browser market shares
apt-get install -y libsqlite3-0 graphviz-dev graphviz && apt-get clean | ||
|
||
# install geckodriver |
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.
All of these deletions are wonderful. 🙏🏻
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.
This is great! My only question is whether we need to make modifications to upload our results to coveralls. Do you know if that needs to be modified?
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.
Presuming we're good for coveralls, which it looks like we are, then I'm happy wit the changes. Thanks, @sea-kelp!
@@ -0,0 +1,2 @@ | |||
[pytest] |
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'd like to use a pyproject.toml
file at some point, as we have way too many configuration files lingering in the repo, imo.
Description of Changes
Cherry-picked from OrcaCollective#537_
Switch to Playwright for functional tests. The Playwright API seems easier to use in many ways than Selenium
Notes for Deployment
None! This only applies to tests
Screenshots (if appropriate)
N/A
Testing instructions
Run
just test
Checks
I have rebased my changes on
main
just lint
passesjust test
passes