Skip to content

Commit

Permalink
Merge branch 'main' into mgwalker/1151-daily-tab-skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-does-weather authored May 8, 2024
2 parents 0db8e13 + cce4b84 commit d302bd7
Show file tree
Hide file tree
Showing 65 changed files with 1,836 additions and 1,245 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ module.exports = {
},
},
{
files: ["tests/**/*.js", "spatial-data/**/*.js", "web/**/tests/**/*.js"],
files: [
"tests/**/*.js",
"spatial-data/**/*.js",
"web/**/tests/**/*.js",
"playwright.config.js",
],
extends: ["airbnb-base", "prettier", "plugin:cypress/recommended"],
env: {
es6: true,
Expand Down
45 changes: 26 additions & 19 deletions .github/workflows/code-standards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,15 @@ jobs:
filename: clover.xml
metric: statements

end-to-end-tests:
name: end-to-end tests
accessibility-tests:
name: accessibility tests
runs-on: ubuntu-latest
needs: [populate-database, should-test]

steps:
- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-edge@v1

- name: checkout
if: needs.should-test.outputs.yes == 'true'
uses: actions/checkout@v4
Expand All @@ -279,31 +282,28 @@ jobs:
if: needs.should-test.outputs.yes == 'true'
uses: ./.github/actions/setup-site

- name: Cypress run
if: needs.should-test.outputs.yes == 'true'
uses: cypress-io/github-action@v6
- uses: actions/setup-node@v4
with:
project: tests/e2e
cache-key: cypress-e2e-${{ hashFiles('package-lock.json') }}
node-version: 18

- name: save screenshots
if: needs.should-test.outputs.yes == 'true'
uses: actions/upload-artifact@v4
with:
name: screenshots
path: tests/e2e/cypress/screenshots/screenshots.cy.js/
- name: install dependencies
run: npm ci

accessibility-tests:
name: accessibility tests
- name: install browsers
run: npx playwright install --with-deps

- name: run tests
run: npx playwright test a11y

end-to-end-tests:
name: end-to-end tests
runs-on: ubuntu-latest
needs: [populate-database, should-test]

steps:
- name: checkout
if: needs.should-test.outputs.yes == 'true'
uses: actions/checkout@v4
with:
lfs: true

- name: setup site
if: needs.should-test.outputs.yes == 'true'
Expand All @@ -313,8 +313,15 @@ jobs:
if: needs.should-test.outputs.yes == 'true'
uses: cypress-io/github-action@v6
with:
project: tests/a11y
cache-key: cypress-a11y-${{ hashFiles('package-lock.json') }}
project: tests/e2e
cache-key: cypress-e2e-${{ hashFiles('package-lock.json') }}

- name: save screenshots
if: needs.should-test.outputs.yes == 'true'
uses: actions/upload-artifact@v4
with:
name: screenshots
path: tests/e2e/cypress/screenshots/screenshots.cy.js/

page-load-time-tests:
name: page load time tests
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ spatial-data/*.shx
spatial-data/*.shp
spatial-data/*.txt
!spatial-data/us.cities500.txt.zip
/.gitattributes
/.gitattributes
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ help:
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

pause:
sleep 10
sleep 15

### Drupal management
cc: clear-cache
Expand Down Expand Up @@ -80,6 +80,11 @@ zap-containers:
docker compose stop
docker compose rm -f

scorched-earth:
docker stop $$(docker ps -a -q)
docker rm $$(docker ps -a -q)
docker system prune -f

### CSS
build-css: # Build CSS
cd web/themes/new_weather_theme && npx gulp compile
Expand All @@ -91,7 +96,7 @@ load-spatial: # Load spatial data into the database
### Testing
a11y: accessibility-test
accessibility-test: ## Run accessibility tests (alias a11y)
npx cypress run --project tests/a11y
npx playwright test a11y

be: backend-test
backend-test: ## Run all backend tests. (alias be)
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"drupal/core-project-message": "^10.2",
"drupal/core-recommended": "^10.2",
"drupal/key_asymmetric": "^1.1",
"drupal/log_stdout": "^1.5",
"drupal/new_relic_rpm": "^2.1",
"drupal/s3fs": "^3.1",
"drupal/samlauth": "^3.9",
Expand Down
Loading

0 comments on commit d302bd7

Please sign in to comment.