Blog Integration Guides

QA Touch Playwright Integration

Premnath M Premnath M | Last updated: July 23, 2024 |

Playwright Integration – QA Touch Reporter

The day is finally here. After months of undeterred work, we are pleased to announce to our community that QA Touch is now integrated with Playwright Integration  in Test Case Management.

What is PlayWright?

Playwright is an open-source automation tool developed by Microsoft that allows developers to automate the testing of web applications across different browsers (such as Chromium, WebKit, and Firefox) and platforms (including Windows, macOS, and Linux). Playwright enables developers to write reliable and maintainable tests for web applications by automating user interactions such as clicking buttons, filling forms, navigating pages, and validating UI elements.

Step 1 : Playwright Installation – Local Setup

npm init playwright@latest

Playwright Integration

Step 2 : Running the Example Test

npx playwright test

How to check Version

npx playwright –version

System requirements

Node.js 18+

QA Touch & Playwright Integration Process

  1. Login in QA Touch.
  2. Click My profile – Generate API key.
  3. You can refer QA Touch API from https://doc.qatouch.com/#qa-touch-api
  4. Access the Package URL https://www.npmjs.com/package/playwright-qatouch-reporter
  5. Install the package in Playwright root directory by executing the below command from your automation environment from the command line.

Playwright Integration

Installation – QA Touch plugin

npm i playwright-qatouch-reporter

Prerequisites

To use QA Touch Reporter, you will need to set up the following environment variables:

Ensure that your QA Touch API is enabled and generate your API keys. See https://doc.qatouch.com/#qa-touch-api

Add .env file to playwright project root folder with the following keys:

QATOUCH_DOMAIN=your-domain

QATOUCH_API_TOKEN=your-api-token

QATOUCH_PROJECT_KEY=Project-Key

QATOUCH_TESTRUN_ID=Test-Run-Id

Playwright Integration Usage

Please open playwright.config.js file, replace below code

 reporter: [[“html”],[“playwright-qatouch-reporter”]],

Playwright Integration Go to tests/example.spec.js Open

In order to use reporter, you should add meta information to your tests. Meta key should be TRXXX (TestRun Code in qatouch), e.g.:

Replace below code

const { test, expect } = require(‘@playwright/test’);

test(‘TR0030 has title’, async ({ page }) => {

  await page.goto(‘https://qatouch.com’);

  // Expect a title “to contain” a substring.

  await expect(page).toHaveTitle(/End to End Test Management Tool | Software Test Management tool | QA Touch/);

});

Playwright Integration
Running Playwright Command

npx playwright test

Playwright Integration

QA Touch Test Result Sync – Successfully

Please see the below screenshot 

Playwright Integration

This integration is just the beginning of a lot more platforms with which we plan to collaborate in the near future to make testing accessible for all.

Register here and be the master of your application testing.

Leave a Reply