Spike: Playwright Implementation Web App.

1. POC

A POC carried out to execute playwright test on Lambdatest and following are the outcomes

2. Approach

Cloud Execution

GTP Extension will record and provide playwright executable script and in Web App a new column will be created in DB script table to store playwright script.

In a web application, a Playwright executable script template will be created by getting the recorded script from database and adding required dependencies to execute test on cloud. The dependencies include Playwright imports, Lambdatest capabilities and a command to call Lambda test endpoint.

Local Execution

For local execution, the Playwright script template will be created without cloud dependencies, and the user may have the option to run the script on extension and download the script and execute it locally.

3. Playwright Test Execution on Local Selenium Grid

To run Playwright tests on a local Selenium Grid running in Docker, ensure that the Playwright tests are configured to connect to the Selenium Grid. Below are the steps to set this up:

  • Docker desktop installed on the deployment server.

  • Pull the latest Selenium Grid Docker images

    • docker pull selenium/hub

    • docker pull selenium/node-chrome

    • docker pull selenium/node-firefox

  • Install Playwright and Dependencies

    • npm install playwright

    • npm install selenium-webdriver

4. GoTestPro Architecture Diagram

GTPSYSArch.drawio(1)-20240823-152512.png

Â