import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to Department of Justice website
await page.goto('https://www.justice.gov/forms');
// Start new identity certification
await page.click('[data-testid="new-request"]');
await page.click('[data-testid="form-361"]');
await page.selectOption('[name="request_type"]', 'privacy_act_request');
// Full name of requester
await page.fill('[name="requester_last_name"]', 'Thompson');
await page.fill('[name="requester_first_name"]', 'Rebecca');
await page.fill('[name="requester_middle_name"]', 'Anne');
await page.fill('[name="requester_suffix"]', '');
// Citizenship status
await page.selectOption('[name="citizenship_status"]', 'us_citizen');
// Social Security Number (optional but recommended)
await page.fill('[name="ssn"]', '123-45-6789');
// Current address
await page.fill('[name="address_line_1"]', '456 Constitution Avenue');
await page.fill('[name="address_line_2"]', 'Apt 12B');
await page.fill('[name="city"]', 'Washington');
await page.selectOption('[name="state"]', 'DC');
await page.fill('[name="zip"]', '20001');
// Date of birth
await page.fill('[name="date_of_birth"]', '06/14/1982');
// Place of birth
await page.fill('[name="place_of_birth_city"]', 'Philadelphia');
await page.selectOption('[name="place_of_birth_state"]', 'PA');
await page.selectOption('[name="place_of_birth_country"]', 'USA');
// Contact information
await page.fill('[name="phone"]', '202-555-0156');
await page.fill('[name="email"]', 'rthompson@email.com');
// Records being requested
await page.fill('[name="records_description"]', 'All records relating to employment with the Federal Bureau of Investigation from 2005 to 2015, including personnel files, training records, and performance evaluations.');
// Time period for records
await page.fill('[name="date_range_start"]', '01/01/2005');
await page.fill('[name="date_range_end"]', '12/31/2015');
// DOJ component
await page.selectOption('[name="doj_component"]', 'fbi');
// Optional: Authorization to release information to another person
await page.check('[name="authorize_release_to_another"]');
// Authorized person information
await page.fill('[name="authorized_person_name"]', 'David Thompson');
await page.fill('[name="authorized_relationship"]', 'Spouse');
await page.fill('[name="authorized_address"]', '456 Constitution Avenue, Apt 12B');
await page.fill('[name="authorized_city"]', 'Washington');
await page.selectOption('[name="authorized_state"]', 'DC');
await page.fill('[name="authorized_zip"]', '20001');
await page.fill('[name="authorized_phone"]', '202-555-0157');
await page.fill('[name="authorized_email"]', 'dthompson@email.com');
// Purpose of authorization
await page.fill('[name="authorization_purpose"]', 'Authorized to receive and review records on my behalf for legal proceedings.');
// Previous names (if applicable)
await page.check('[name="has_previous_names"]');
await page.fill('[name="previous_name"]', 'Rebecca Miller');
await page.fill('[name="name_change_date"]', '08/2010');
// Previous addresses (if relevant to records)
await page.check('[name="has_previous_addresses"]');
await page.fill('[name="previous_address"]', '789 Market Street, Philadelphia, PA 19107');
await page.fill('[name="previous_address_dates"]', '2005-2010');
// Employment information (if relevant)
await page.fill('[name="employer_during_period"]', 'Federal Bureau of Investigation');
await page.fill('[name="job_title"]', 'Special Agent');
await page.fill('[name="employee_id"]', 'FBI-SA-12345');
await page.fill('[name="employment_dates"]', '2005-2015');
// Identity verification documents
await page.click('[data-testid="upload-id-front"]');
await page.setInputFiles('[name="identification_front"]', './documents/drivers_license_front.pdf');
await page.click('[data-testid="upload-id-back"]');
await page.setInputFiles('[name="identification_back"]', './documents/drivers_license_back.pdf');
// Supporting documentation
await page.click('[data-testid="upload-supporting-docs"]');
await page.setInputFiles('[name="supporting_documents"]', './documents/birth_certificate.pdf');
// Notarization (if required)
await page.check('[name="notarized"]');
await page.fill('[name="notary_name"]', 'John Notary Public');
await page.fill('[name="notary_commission_number"]', 'DC-12345');
await page.fill('[name="notary_expiration"]', '12/31/2026');
await page.fill('[name="notarization_date"]', '03/15/2025');
// Fee waiver request (if applicable)
await page.selectOption('[name="fee_waiver_requested"]', 'no');
// Expedited processing request
await page.selectOption('[name="expedited_processing"]', 'yes');
await page.fill('[name="expedited_justification"]', 'Records needed for pending litigation with court-imposed deadline.');
// Certification under penalty of perjury
await page.check('[name="certify_true_and_correct"]');
await page.check('[name="certify_identity"]');
await page.check('[name="understand_penalties_false_statement"]');
await page.check('[name="understand_penalties_false_pretenses"]');
// Privacy Act acknowledgment
await page.check('[name="acknowledge_privacy_act"]');
await page.check('[name="consent_to_disclosure"]');
// Request delivery preference
await page.selectOption('[name="delivery_method"]', 'electronic');
await page.check('[name="email_notification"]');
// Declaration statement
await page.fill('[name="declaration_text"]', 'I declare under penalty of perjury under the laws of the United States of America that the foregoing is true and correct, and that I am the person named above.');
// Signature
await page.fill('[name="signature_name"]', 'Rebecca Anne Thompson');
await page.fill('[name="signature_date"]', '03/15/2025');
// Digital signature or attestation
await page.check('[name="electronic_signature_consent"]');
await page.fill('[name="electronic_signature']', 'Rebecca Anne Thompson');
// Authorized representative signature (if applicable)
await page.fill('[name="authorized_signature"]', 'David Thompson');
await page.fill('[name="authorized_signature_date"]', '03/15/2025');
// Request tracking preferences
await page.check('[name="track_request_online"]');
await page.check('[name="sms_notifications"]');
await page.fill('[name="mobile_number"]', '202-555-0156');
await page.click('[data-testid="submit-certification"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();