import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to CBP website
await page.goto('https://www.cbp.gov/document/forms/form-7501-entry-summary-continuation-sheets');
// Start new entry filing
await page.click('[data-testid="new-entry"]');
await page.selectOption('[name="entry_type"]', 'consumption');
// Entry summary information
await page.fill('[name="entry_number"]', '12345678901');
await page.selectOption('[name="port_of_entry"]', '2704'); // Port of Los Angeles
await page.fill('[name="entry_date"]', '12/15/2024');
await page.fill('[name="import_date"]', '12/14/2024');
// Importer information
await page.fill('[name="importer_name"]', 'Global Trade Solutions Inc');
await page.fill('[name="importer_address"]', '456 Commerce St');
await page.fill('[name="importer_city"]', 'Los Angeles');
await page.selectOption('[name="importer_state"]', 'CA');
await page.fill('[name="importer_zip"]', '90210');
await page.fill('[name="importer_ein"]', '12-3456789');
// Transportation details
await page.fill('[name="vessel_name"]', 'MSC MAYA');
await page.fill('[name="voyage_number"]', '024W');
await page.fill('[name="bill_of_lading"]', 'MSCU1234567890');
await page.selectOption('[name="country_of_origin"]', 'CN');
// Merchandise line items
await page.click('[data-testid="add-line-item"]');
await page.fill('[name="line_number"]', '1');
await page.fill('[name="hts_number"]', '6204.62.4040');
await page.fill('[name="merchandise_description"]', 'Women cotton trousers');
await page.fill('[name="quantity"]', '500');
await page.selectOption('[name="unit_of_measure"]', 'DZ'); // Dozen
await page.fill('[name="entered_value"]', '12500.00');
// Duty and fee calculations
await page.fill('[name="duty_rate"]', '16.6');
await page.click('[data-testid="calculate-duties"]');
await page.waitForSelector('[data-testid="duty-amount"]');
// Broker certification
await page.fill('[name="broker_name"]', 'ABC Customs Brokerage');
await page.fill('[name="broker_license"]', '12345');
await page.check('[name="certify_accuracy"]');
// Submit entry
await page.click('[data-testid="submit-entry"]');
await page.waitForSelector('[data-testid="entry-confirmation"]');
// Download entry summary
await page.click('[data-testid="download-summary"]');
await browser.close();