Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress tests for service worker #12589

Merged
merged 8 commits into from
Apr 7, 2025
Merged

Conversation

karinathomasbbc
Copy link
Contributor

@karinathomasbbc karinathomasbbc commented Apr 1, 2025

Summary

Cypress tests to test service worker caching functionality

Code changes

  • Re-enable caching for local assets via the service worker
  • Add service worker tests to specialFeatures suite

Developer Checklist - N/A

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local
    • Test
    • Preview
    • Live
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

Ensure that the service worker tests pass when run against different environments

  1. Test: CYPRESS_APP_ENV=test yarn cypress run --spec './cypress/e2e/specialFeatures/serviceWorker/index.cy.js'
  2. Live: CYPRESS_APP_ENV=live yarn cypress run --spec './cypress/e2e/specialFeatures/serviceWorker/index.cy.js'

Useful Links

@karinathomasbbc karinathomasbbc self-assigned this Apr 1, 2025

const testSuites = [
{
path: '/pidgin/articles/czje40pxkypo?renderer_env=live',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need more examples of other page types / services?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it likely to work on one page/ service and not other pages/services?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work the same for all of them. I think I might add a couple of serbian examples lat + cyr - just to make sure the routing works as expected? We could focus on articles first, but it should work for other page types too, which use the cached libraries.

Also, because these tests live in the Express app, there are no tests for live (or any other NextJS rendered) pages - but this can perhaps come later?

@karinathomasbbc karinathomasbbc marked this pull request as ready for review April 1, 2025 15:42
@karinathomasbbc karinathomasbbc merged commit b8896d5 into latest Apr 7, 2025
11 checks passed
@karinathomasbbc karinathomasbbc deleted the service-worker-cypress-tests branch April 7, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants