From 9d9880abb2cede3804ceca2f9572d3c58cfbf67a Mon Sep 17 00:00:00 2001 From: Jeff Croyle Date: Mon, 8 Apr 2024 10:58:58 -0400 Subject: [PATCH 1/2] try running swimlanes test with actions --- .github/workflows/swimlanes_test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/swimlanes_test.yml diff --git a/.github/workflows/swimlanes_test.yml b/.github/workflows/swimlanes_test.yml new file mode 100644 index 00000000..575edd6a --- /dev/null +++ b/.github/workflows/swimlanes_test.yml @@ -0,0 +1,20 @@ +name: Run Swimlanes Test + +on: + schedule: + - cron: '*/10 * * * *' + +jobs: + run_swimlanes_test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm install + + - name: Run Puppeteer script + run: npm run homepageImageloadingTest + From 3ae096ee32b7d88a7a189a4252a5874a39b7ba0a Mon Sep 17 00:00:00 2001 From: Jeff Croyle Date: Mon, 8 Apr 2024 13:20:53 -0400 Subject: [PATCH 2/2] few modifications --- .github/workflows/swimlanes_test.yml | 2 +- CHANGELOG.md | 1 + README.md | 4 ++-- package.json | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/swimlanes_test.yml b/.github/workflows/swimlanes_test.yml index 575edd6a..20b55d1a 100644 --- a/.github/workflows/swimlanes_test.yml +++ b/.github/workflows/swimlanes_test.yml @@ -16,5 +16,5 @@ jobs: run: npm install - name: Run Puppeteer script - run: npm run homepageImageloadingTest + run: npm run homepageImageloadingTestProd diff --git a/CHANGELOG.md b/CHANGELOG.md index f9981e2e..9570c05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - update links to legacy dc in qa to point to https://digitalcollections.nypl.org (DR-2858) - Reenable underline hover state on 'Explore further' card titles (DR-2834) - Use Repo API v2/items/counts endpoint in DC Facelift (DR-2824) +- Enable GitHub Actions to run homepage swimlanes test automatically (DR-2912) ### Removed diff --git a/README.md b/README.md index e29967c7..968446f9 100644 --- a/README.md +++ b/README.md @@ -158,13 +158,13 @@ npm run test To run the homepage swimlane image loading test script against the qa environment, run ``` -npm run hompageImageLoadingTest +npm run hompageImageLoadingTestQa ``` (requires accessination with nypl-dams-dev) To run the same test script against the production environment, run ``` -npm run hompageImageLoadingTest --prod +npm run hompageImageLoadingTestProd ``` The test waits for the 24 swim lane images to load, including the 12 that load after scrolling, and has succeeded if it does not time out. It simulates a single user loading the homepage one time. diff --git a/package.json b/package.json index 305a8ad7..004f9ff6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test": "jest", "test:ci": "jest --ci --config=jest.config.ts", "prepare": "husky install", - "hompageImageLoadingTest": "node test/homepageImageLoadingTest.js" + "hompageImageLoadingTestQa": "node test/homepageImageLoadingTest.js", + "hompageImageLoadingTestProd": "node test/homepageImageLoadingTest.js --prod" }, "lint-staged": { "*.{js,jsx,ts,tsx}": [