TPS is a test automation framework for Firefox Sync. See
https://developer.mozilla.org/en/TPS for documentation.

Quick Start (Recommended)
==========================

The easiest way to run TPS tests is using the `./mach tps-test` command with
automatic account creation:

  ./mach tps-test --testfile services/sync/tests/tps/test_sync.js \
                  --auto-account

This command:
- Automatically creates and verifies a test account via restmail.net
- Builds the TPS extension automatically
- Works directly with your Firefox build
- Automates OAuth authentication with real FxA credentials
- Tests real Sync functionality between multiple profiles
- Uses FxA staging server by default

Options:
  --testfile        Path to test file (e.g., services/sync/tests/tps/test_sync.js)
  --auto-account    Automatically create test account (recommended)
  --username        Firefox Account username (alternative to --auto-account)
  --password        Firefox Account password (required with --username)
  --fxa-staging     Use FxA staging server (default with --auto-account)
  --fxa-production  Use FxA production server (not recommended)
  --binary          Path to Firefox binary (default: uses your build)
  --logfile         Path to log file (default: tps.log)
  --debug           Enable debug logging

Run in headless mode with:
  MOZ_HEADLESS=1 ./mach tps-test --testfile ... --auto-account

Setting Up (FxA) Test Accounts
========================

Automatic Account Creation (Recommended)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The simplest way to run TPS tests is with automatic account creation:

  ./mach tps-test --testfile services/sync/tests/tps/test_sync.js \
                  --auto-account

TPS will automatically:
1. Generate test credentials (random restmail.net address and password)
2. Create the account via FxA API inside Firefox
3. Verify the account via restmail.net (FxA requires email verification before
   sign-in; the staging server does not support skipping this step)
4. Start an OAuth flow with the FxA server
5. Open the login page in a browser window
6. Fill in the credentials programmatically
7. Complete the OAuth handshake
8. Set up real Sync connections between test profiles

No manual account creation or verification needed.

Manual Account Setup (Alternative)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you prefer to use an existing account:

  ./mach tps-test --testfile services/sync/tests/tps/test_sync.js \
                  --username your-test@restmail.net \
                  --password your-password

Note: The account must already exist. You can create accounts manually at
https://accounts.stage.mozaws.net (for staging).

Note: The staging server approach is recommended for testing to avoid using
production infrastructure. Accounts must be verified before TPS can use them.
