Skip to content

Add "Auto-Snapshot" on Navigation #246

@codeCraft-Ritik

Description

@codeCraft-Ritik

Issue :

Currently, after running playwright-cli open or playwright-cli goto, the user must manually run playwright-cli snapshot to see the element references (like e1, e2). Improvement: Automatically trigger and display a snapshot summary whenever a navigation event completes. This reduces the number of commands a user has to type.

File Path : playwright-cli.js (or within the program logic in the core package).

Proposed Logic : In the goto and open command handlers, add a call to the snapshot function after the page.goto or page.waitForLoadState call.

Code Snippet Concept :

// Inside the goto command handler
await page.goto(url);
await page.waitForLoadState('networkidle');
const snapshot = await takeSnapshot(page); // Existing snapshot logic
console.log(snapshot.summary);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions