From c1d2d9c07bd85ccf4417238beb0c4fa4d378d896 Mon Sep 17 00:00:00 2001 From: Johnny Bouder Date: Tue, 31 Oct 2023 16:43:49 -0400 Subject: [PATCH] Updates to unlighthouse config. Add workflow action. --- .github/workflows/accessibility-testing.yaml | 19 ++++++++++++++ unlighthouse.config.ts | 27 +++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/accessibility-testing.yaml diff --git a/.github/workflows/accessibility-testing.yaml b/.github/workflows/accessibility-testing.yaml new file mode 100644 index 00000000..f29fcf99 --- /dev/null +++ b/.github/workflows/accessibility-testing.yaml @@ -0,0 +1,19 @@ +name: Run Accessibility Testing + +on: + pull_request: + branches: [main] + +jobs: + demo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install Dependencies + run: npm add -g @unlighthouse/cli puppeteer + + - name: Run Tests + run: unlighthouse-ci --config unlighthouse.config.ts --build-static --reporter jsonExpanded diff --git a/unlighthouse.config.ts b/unlighthouse.config.ts index d0053cb0..e4bf9c0c 100644 --- a/unlighthouse.config.ts +++ b/unlighthouse.config.ts @@ -1,10 +1,6 @@ import { defineConfig } from 'unlighthouse'; export default defineConfig({ - // auth: { - // username: '', - // password: '', - // }, ci: { budget: { performance: 90, @@ -14,14 +10,31 @@ export default defineConfig({ }, }, debug: true, - routerPrefix: '/comet-starter', + // hooks: { + // async authenticate(page) { + // // login to the page + // await page.goto('http://some-auth-provider'); + // const emailInput = await page.$('input[type="text"]'); + // await emailInput?.type('some-user'); + // const passwordInput = await page.$('input[type="password"]'); + // await passwordInput?.type('some-password'); + // await Promise.all([ + // // eslint-disable-next-line @typescript-eslint/no-explicit-any + // page.$eval('#login-form', (form: any) => form.submit()), + // page.waitForNavigation(), + // ]); + // }, + // }, puppeteerClusterOptions: { maxConcurrency: 1, }, + puppeteerOptions: { + // headless: false, + // slowMo: 50, + }, scanner: { device: 'desktop', skipJavascript: false, }, - site: 'http://localhost:8080', - // urls: ['/', '/signin', '/dashboard'], + site: 'https://metrostar.github.io/comet-starter/', });