Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1- Playwright Execution using NodeJS API

Here's an example of how to can create a Playwright execution microservice using the Node.js API:

https://github.com/asadzakir/playwright-execution-api

Here's how the microservice works:

  1. The microservice uses the Express.js framework to create a web server.

  2. It defines a single endpoint /api/pw/exe that accepts a POST request with a playwright_test_steps property in the request body.

  3. Inside the /api/pw/exe endpoint, the microservice:

    • Launches a new Chromium browser instance using chromium.launch().

    • Creates a new browser context using context.newPage().

    • Executes the provided Playwright script using the eval() function.

    • Closes the browser instance using browser.close().

API Endpoint

http://localhost:5000/api/pw/exe

...

2- Playwright Local Execution with in GTP Recorder using the playwright CRX library

here's another way to execute Playwright scripts locally using the Playwright CRX library with in the GTP Recorder:

  1. Install the Playwright CRX library:

    • Run the following command to install the Playwright CRX library:

      Code Block
      npm install @playwright/crx

...