online icon indicating copy to clipboard operation
online copied to clipboard

Add Lighthouse accessibility tests for Calc, Draw, Impress, and Writer

Open rparth07 opened this issue 2 months ago • 4 comments

  • Created new Cypress test files for Lighthouse accessibility audits in the Calc, Draw, Impress, and Writer
  • Each test file sets up the respective document and performs a Lighthouse audit with an accessibility score target of 100
  • "@cypress-audit/lighthouse" is being used to write this accessibility tests

To run individually: ~~1. Writer: make -C cypress_test/ check-desktop spec=writer/lighthouse_accessibility_spec.js CYPRESS_BROWSER="chrome" 2. Calc: make -C cypress_test/ check-desktop spec=calc/lighthouse_accessibility_spec.js CYPRESS_BROWSER="chrome" 3. Impress: make -C cypress_test/ check-desktop spec=impress/lighthouse_accessibility_spec.js CYPRESS_BROWSER="chrome" 4. Draw: make -C cypress_test/ check-desktop spec=draw/lighthouse_accessibility_spec.js CYPRESS_BROWSER="chrome"~~

Now, we can run all by just executing make check-lighthouse

Change-Id: I83cba659056cc43f804cf512c0f93abf923fa5c3

Checklist

  • [ ] I have run make prettier-write and formatted the code.
  • [ ] All commits have Change-Id
  • [ ] I have run tests with make check
  • [ ] I have issued make run and manually verified that everything looks okay
  • [ ] Documentation (manuals or wiki) has been updated or is not required

rparth07 avatar Oct 06 '25 13:10 rparth07

Love this; OTOH - do you know that we will create empty files from zero length files based on the extension - always nice to keep the repository as empty as possible; could you zero those out ?

Is there some way we can share even more code from those duplicated tests ?

But overall - this is a really great win - good stuff :-)

mmeeks avatar Oct 06 '25 19:10 mmeeks

cc: @mohit-marathe , so you are aware there is new kind of tests :)

eszkadev avatar Oct 08 '25 06:10 eszkadev

For me it doesn't do any check as "custom chromium is not supported", tests pass... So not sure if it works here on CI as we don't see any logs. Let's verify.

Can we trigger some fail in one of these tests? so it will print logs :)

lighthouse_accessibility_spec.js.mp4

Thanks @eszkadev for pointing out this :)

It seems cypress-audit/lighthouse has very limited browser support. currently, it is working expected for chrome and since we also want that we can add checks to only run for chrome browser and directly fail early otherwise.

I pushed the latest changes. Let's wait for CI 🙏🏻

rparth07 avatar Oct 23 '25 07:10 rparth07

@rparth07 writer/sidebar_spec.js and calc/cell_cursor_spec.js have been fixed now. can you please rebase?

mohit-marathe avatar Nov 25 '25 06:11 mohit-marathe