Skip to content

Integration tests: WordPress and Next.js frontends with Testcontainers #398

@aram356

Description

@aram356

Description

Add integration tests using Testcontainers that verify the trusted server
operates correctly against real frontend applications.

WordPress frontend

  • Spin up a WordPress container with a minimal theme
  • Configure the trusted server to proxy/inject into the WordPress site
  • Verify:
    • HTML response contains injected <script> tags
    • /static/tsjs= endpoint serves concatenated JS bundles
    • Integration-specific attributes are rewritten in ad markup
    • GDPR consent signals propagate correctly

Next.js frontend

  • Spin up a Next.js container with a minimal app
  • Configure the trusted server to proxy/inject into the Next.js site
  • Verify:
    • Server-side rendered pages receive script injection
    • Client-side navigation does not break after injection
    • Deferred script tags load correctly on route transitions
    • /static/tsjs= endpoint serves valid JS

Shared concerns

  • Tests should be runnable locally and in CI
  • Each test suite should start, exercise, and tear down containers
    automatically
  • Use Testcontainers lifecycle management for setup and teardown
  • Document any required Docker images or build steps in the test README

Done when

Running CI pipeline

Affected area

CI / Tooling

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions