Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ jobs:
just build
just up
just test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: build/test-results/
Comment on lines +30 to +34
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!

11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ ENV PYTHONUNBUFFERED=1
WORKDIR /usr/src/app

# 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"
RUN if [ "$IS_PROD" = "true" ]; then \
PACKAGES_TO_INSTALL="$BASE_PACKAGES"; \
else \
PACKAGES_TO_INSTALL="$BASE_PACKAGES $DEV_PACKAGES"; \
fi && \
apt-get update && \
ARG PACKAGES_TO_INSTALL="gcc libpq-dev libjpeg62-turbo-dev libsqlite3-0 zlib1g-dev"
RUN apt-get update && \
apt-get install -y -qq --no-install-recommends $PACKAGES_TO_INSTALL && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -28,6 +22,7 @@ RUN if [ "$IS_PROD" = "true" ]; then \
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

fi

# Setup application
Expand Down
1 change: 1 addition & 0 deletions OpenOversight/app/static/js/find_officer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $(document).ready(function() {
$('#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

$('#uii-question').hide();
}
});
Expand Down
2 changes: 1 addition & 1 deletion OpenOversight/app/templates/submit_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h3 class="mt-4">High security submissions?</h3>
dept_id = $("#department").val();
});

const getURL = (file) => "/upload/department/" + dept_id;
const getURL = (file) => "/upload/departments/" + dept_id;
init_dropzone("#my-cop-dropzone", getURL, csrf_token);
</script>
</div>
Expand Down
6 changes: 0 additions & 6 deletions OpenOversight/pytest.ini

This file was deleted.

24 changes: 4 additions & 20 deletions OpenOversight/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
from faker import Faker
from flask import current_app
from PIL import Image as Pimage
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.firefox.service import Service as FirefoxService
from selenium.webdriver.firefox.webdriver import WebDriver as Firefox
from playwright.sync_api import Page
from sqlalchemy.orm import scoped_session, sessionmaker
from webdriver_manager.firefox import GeckoDriverManager

from OpenOversight.app import create_app
from OpenOversight.app.models.database import (
Expand Down Expand Up @@ -900,19 +897,6 @@ def server(app, server_port):
).start()


@pytest.fixture(scope="session")
def browser(app, server):
options = FirefoxOptions()
options.add_argument("--headless")
options.add_argument("--width=1024")
options.add_argument("--height=768")

service = FirefoxService(
executable_path=GeckoDriverManager().install(), log_path="/tmp/geckodriver.log"
)
driver = Firefox(options=options, service=service)

yield driver

# shutdown headless webdriver
driver.quit()
@pytest.fixture
def page(app, server, page: Page):
yield page
Loading
Loading