This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
forked from HHS/simpler-grants-gov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rylew/73-pa11y-sitemap
- Loading branch information
Showing
14 changed files
with
5,052 additions
and
4,520 deletions.
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,62 @@ | ||
name: pa11y tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- frontend/** | ||
- .github/workflows/ci-frontend-a11y.yml | ||
|
||
jobs: | ||
build: | ||
name: Pa11y-ci tests | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
LOCKFILE_PATH: ./frontend/package-lock.json | ||
PACKAGE_MANAGER: npm | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache-dependency-path: ${{ env.LOCKFILE_PATH }} | ||
cache: ${{ env.PACKAGE_MANAGER }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Create screenshots directory | ||
run: mkdir -p screenshots-output | ||
|
||
- name: Build project | ||
run: npm run build | ||
|
||
- name: Start server and log output | ||
run: npm run start & | ||
|
||
- name: Wait for frontend to be ready | ||
run: | | ||
# Ensure the server wait script is executable | ||
chmod +x ./bin/wait-for-frontend.sh | ||
./bin/wait-for-frontend.sh | ||
- name: Run pa11y-ci | ||
run: | | ||
set -e # Ensure the script fails if any command fails | ||
npm run test:pa11y | ||
echo "pa11y-ci tests finished." | ||
- name: Upload screenshots to artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: screenshots | ||
path: ./frontend/screenshots-output |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,4 @@ | ||
POSTGRES_NAME = "app" | ||
POSTGRES_HOST = "0.0.0.0" | ||
POSTGRES_USER = "app" | ||
POSTGRES_PORT = 5432 |
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
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
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,29 @@ | ||
# pylint: disable=invalid-name, line-too-long | ||
"""Get a connection to the database using a SQLAlchemy engine object.""" | ||
|
||
from sqlalchemy import Engine, create_engine | ||
|
||
from config import settings | ||
|
||
|
||
# The variables used in the connection url are set in settings.toml and | ||
# .secrets.toml. These can be overridden with the custom prefix defined in config.py: "ANALYTICS". | ||
# e.g. `export ANALYTICS_POSTGRES_USER=new_usr`. | ||
# Docs: https://www.dynaconf.com/envvars/ | ||
def get_db() -> Engine: | ||
""" | ||
Get a connection to the database using a SQLAlchemy engine object. | ||
This function retrieves the database connection URL from the configuration | ||
and creates a SQLAlchemy engine object. | ||
Yields | ||
------ | ||
sqlalchemy.engine.Engine | ||
A SQLAlchemy engine object representing the connection to the database. | ||
""" | ||
return create_engine( | ||
f"postgresql+psycopg://{settings.postgres_user}:{settings.postgres_password}@{settings.postgres_host}:{settings.postgres_port}", | ||
pool_pre_ping=True, | ||
hide_parameters=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
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,100 @@ | ||
{ | ||
"defaults": { | ||
"timeout": 240000, | ||
"runners": ["axe"], | ||
"ignore": ["color-contrast"], | ||
"concurrency": 1, | ||
"chromeLaunchConfig": { | ||
"ignoreHTTPSErrors": true, | ||
"args": ["--disable-dev-shm-usage", "--no-sandbox"] | ||
} | ||
}, | ||
"urls": [ | ||
{ | ||
"url": "http://localhost:3000", | ||
"viewport": { "width": 320, "height": 480 }, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/mobile-main-view.png", | ||
"click element .usa-navbar button", | ||
"screen capture screenshots-output/mobile-expand-menu.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000", | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/desktop-main-view-home.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/search?status=forecasted,posted", | ||
"viewport": { "width": 320, "height": 480 }, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/mobile-main-view-search.png", | ||
"click element .usa-navbar button", | ||
"screen capture screenshots-output/mobile-expand-menu-search.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/search?status=forecasted,posted", | ||
"viewport": { "width": 320, "height": 480 }, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/desktop-main-view-search.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/process", | ||
"viewport": { "width": 320, "height": 480 }, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/mobile-main-view-process.png", | ||
"click element .usa-navbar button", | ||
"screen capture screenshots-output/mobile-expand-menu-process.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/process", | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/desktop-main-view-process.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/research", | ||
"viewport": { "width": 320, "height": 480 }, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/mobile-main-view-research.png", | ||
"click element .usa-navbar button", | ||
"screen capture screenshots-output/mobile-expand-menu-research.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/research", | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/desktop-main-view-research.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/newsletter", | ||
"viewport": { "width": 320, "height": 480 }, | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/mobile-main-view-newsletter.png", | ||
"click element .usa-navbar button", | ||
"screen capture screenshots-output/mobile-expand-menu-newsletter.png" | ||
] | ||
}, | ||
{ | ||
"url": "http://localhost:3000/newsletter", | ||
"actions": [ | ||
"wait for element #main-content to be visible", | ||
"screen capture screenshots-output/desktop-main-view-newsletter.png" | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.