diff --git a/.github/workflows/swimlanes_test.yml b/.github/workflows/swimlanes_test.yml new file mode 100644 index 00000000..20b55d1a --- /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 homepageImageloadingTestProd + diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fc0a1dc..d980bb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,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}": [