Skip to content

[Feasibility] add an 'evaluate' method to run console scripts #424

Open
@mastrzyz

Description

@mastrzyz

More advanced tests can be made calling Test hooks in the product via console.

examples:

  • create a fake "call"
  • Run a memory leak evaluation

Schema?

  {
    name: "evaluate",
    description: `USE VERY SPARINGLY !Run a JavaScript function in the context of the web page and retrieve results back to the Playwright environment`,
    parameters: {
      type: "object",
      properties: {
        ...intentProperty,
        script: {
          type: "string",
          description: "JavaScript function to execute in the page context",
        },
      },
      required: ["intent", "script"],
    },
  },
  if (toolName === "evaluate") {
    await page.evaluate(params.script as string);
    code.push(`await page.evaluate(\`${params.script}\`)`);
    return;
  }

I can help with implementation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions