Skip to content

Conversation

@sea-kelp
Copy link
Collaborator

@sea-kelp sea-kelp commented Mar 2, 2025

Description of Changes

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 passes

  • just test passes

@sea-kelp
Copy link
Collaborator Author

sea-kelp commented Mar 2, 2025

That's not a good first sign... 😢

Comment on lines +30 to +34
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: build/test-results/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exceptionally cool - do you mind documenting it somewhere in the repo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added documentation!

$('#current-uii').text(deptUiidLabel);
$('#uii-question').show();
} else {
$('#unique_internal_identifier').text('');
Copy link
Collaborator Author

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

- ./poetry.lock:/usr/src/app/poetry.lock
- ./pyproject.toml:/usr/src/app/pyproject.toml
- ./OpenOversight:/usr/src/app/OpenOversight
- ./build/test-results:/test-results
Copy link
Collaborator Author

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

poetry install --only main --no-root; \
else \
poetry install --no-root; \
playwright install --with-deps chromium; \
Copy link
Collaborator Author

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

Copy link
Collaborator

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic! What a simplification! I'm glad we could also get the pytest.ini settings into the pyproject.toml 😄

Comment on lines +30 to +34
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: build/test-results/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exceptionally cool - do you mind documenting it somewhere in the repo?

Dockerfile Outdated
# Install packages depending on ENV arg from docker-compose
ARG BASE_PACKAGES="gcc libpq-dev libjpeg62-turbo-dev libsqlite3-0 zlib1g-dev"
ARG DEV_PACKAGES="firefox-esr"
ARG DEV_PACKAGES=""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're dropping that package, I think we can remove all of the differentiation between packages to install per environment in the Dockerfile!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed extra Dockerfile logic!

@sea-kelp sea-kelp merged commit 87c7de2 into main Mar 4, 2025
2 checks passed
@sea-kelp sea-kelp deleted the playwright-testing branch March 4, 2025 08:33
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Orca Collective Task Tracker Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants