or run

npx @tessl/cli init
Log in

Version

Files

docs

browser-contexts.mdbrowser-management.mdelement-handling.mdindex.mdinput-simulation.mdlocators-selectors.mdnetwork-management.mdpage-interaction.md
tile.json

rubric.jsonevals/scenario-8/

{
  "context": "This criteria evaluates how effectively the engineer uses puppeteer-core's PDF generation API to convert web pages to PDF documents with custom formatting options. The focus is on proper browser lifecycle management, page navigation with appropriate wait conditions, and correct usage of PDF generation options.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Browser Launch",
      "description": "Uses puppeteer.launch() to create a browser instance with headless mode enabled (headless: true or 'new')",
      "max_score": 15
    },
    {
      "name": "Page Creation",
      "description": "Creates a new page using browser.newPage() or similar method to navigate to the target URL",
      "max_score": 10
    },
    {
      "name": "Navigation with Wait",
      "description": "Uses page.goto() with appropriate waitUntil option (e.g., 'networkidle0' or 'networkidle2') to ensure the page is fully loaded before PDF generation",
      "max_score": 15
    },
    {
      "name": "PDF Method Usage",
      "description": "Calls page.pdf() method to generate the PDF document",
      "max_score": 20
    },
    {
      "name": "Page Format Option",
      "description": "Correctly sets the format option in page.pdf() to support A4, Letter, and Legal page sizes",
      "max_score": 10
    },
    {
      "name": "Landscape Orientation",
      "description": "Correctly implements the landscape option in page.pdf() to control page orientation (portrait vs landscape)",
      "max_score": 10
    },
    {
      "name": "Custom Margins",
      "description": "Correctly configures the margin option in page.pdf() with top, right, bottom, and left properties to set custom margins",
      "max_score": 10
    },
    {
      "name": "Print Background",
      "description": "Sets printBackground option to true in page.pdf() to include backgrounds and graphics in the PDF output",
      "max_score": 5
    },
    {
      "name": "Browser Cleanup",
      "description": "Properly closes the browser instance using browser.close() after PDF generation to prevent resource leaks",
      "max_score": 5
    }
  ]
}