THURSDAY, JULY 9, 2026VOL. I NO. 1

THE PLAYWRIGHTPAD JOURNAL

Intelligent Automation News

Playwright Testing for French Public Services and FranceConnect SSO

Test FranceConnect OAuth authentication, French public administration forms, and DNUM digital identity verification in French government apps.

PE
PlaywrightPad Editorial
2026-07-116 min read
Authentication Architecture Matrix

playwright-v1-49-matrix

Advertisement

Playwright Testing for French Public Services and FranceConnect SSO

Region Focus: This guide includes examples specifically relevant to France-based applications.

Test FranceConnect OAuth authentication, French public administration forms, and DNUM digital identity verification in French government apps. This guide provides step-by-step Playwright patterns to handle this scenario reliably.

Introduction

Robust automation requires handling domain-specific patterns effectively. This article covers playwright testing for french public services and franceconnect sso with production-ready Playwright code.

Architecture Overview

MERMAID
graph TD
    Service["French Gov Service"] --> FC["FranceConnect"]
    FC --> IdP["impots.gouv / ameli"]
    IdP --> Token["JWT Token"]
    Token --> Data["Pre-filled Data"]

Implementation Guide

TYPESCRIPT
test('FranceConnect authentication flow works', async ({ page }) => {
  await page.goto('/login');
  await page.getByRole('button', { name: 'Se connecter avec FranceConnect' }).click();
  await page.route('/api.franceconnect.gouv.fr/', route =>
    route.fulfill({ status: 302, headers: { location: '/callback?code=FC_CODE' } })
  );
  await expect(page.getByText('Connecté via FranceConnect')).toBeVisible();
});

Run Your Tests

BASH
npx playwright test --grep "Playwright Testing for"
npx playwright test --ui

Reference Table

FranceConnect IdPData ProvidedAuthentication
impots.gouv.frTax dataUsername/Password
ameli.frHealth dataCard + Code
info-retraite.frPension dataUsername/Password

Best Practices

💡 TIP
Always use getByRole() and getByLabel() for resilient locators that survive UI changes.
  • Mock all external dependencies to ensure test isolation and repeatability
  • Clean up test data in fixture teardown to prevent test pollution
  • Use await expect(locator).toBeVisible() instead of waitForTimeout()
  • Test both happy path and error/edge cases for complete coverage
  • Common Mistakes

    ⚠️ WARNING
    Never depend on test order. Each test must set up its own state independently.
    Anti-PatternSolution
    Hardcoded wait timesUse auto-waiting assertions
    Shared mutable test dataCreate unique data per test
    Testing 3rd party UIs directlyMock external services

    Frequently Asked Questions

    How to test FranceConnect in staging?

    Use FranceConnect's sandbox environment at fca.integ01.dev-franceconnect.fr with test credentials.

    How to test French administrative form validation?

    Test NIR (French social security number) format validation: 13 digits + 2 control digits.

    Can Playwright test RGPD (French GDPR) consent?

    Yes, test the CNIL-compliant consent banner and verify refusal doesn't block page access.

    How to test French address format?

    Verify address input accepts N° Rue, Lieu-dit, Code Postal, Commune format.

    How to test impots.gouv.fr tax return pre-fill?

    Mock the tax API and verify that income and employer details pre-populate the tax form.

    Summary

    Test FranceConnect OAuth authentication, French public administration forms, and DNUM digital identity verification in French government apps. Apply these patterns to build a reliable, maintainable automation suite for your specific use case.

    Related Articles

  • Playwright Installation Complete Tutorial Guide
  • Mastering Playwright Locators & Selectors
  • Playwright CI/CD with GitHub Actions
  • Playwright Assertions: Complete Reference Guide
  • #france#franceconnect#sso#government
    Advertisement

    About The Author

    PlaywrightPad Editorial

    PlaywrightPad Editorial reports on Chromium engines, E2E test optimizations, and AI integration specifications.

    Newsletter

    Get weekly browser reports sent directly to your inbox.

    Advertisement