Integrate your Playwright project with Testreport.io
TestReport.io
Last Update 5 bulan yang lalu
Welcome to this tutorial on integrating Playwright with TestReport.io.
In just a few steps, you'll learn how to set up and upload your test reports effortlessly.
Step 1: Access the Playwright Plugin Setup
After logging in to TestReport.io, navigate to the profile section. In the Playwright plugin, you'll find all the steps required to set up the integration.
Step 2: Create the Configuration File
First, create a configuration file named testreport.config.js in your Playwright project. Ensure this file is located in the root directory.
Code Snippet:
Paste this code into the file to define your project access key, base URL, target directory, and screenshots directory.
Step 3: Specify Paths in the Configuration File
In the configuration file:
-
Set targetDir:
"Specify the path where the index.html test report file is generated.
'targetDir: 'playwright-report'
i.e.Set screenshotsDir:
-
"Point this to the directory where failed test screenshots are stored. For example, use the data folder in your project."
Step 4: Install the TestReport.io Dependency
Next, install the TestReport.io dependency by running the following command in your terminal:
This package enables seamless integration between Playwright and TestReport.io.
Step 5: Add the Upload Script
Add the following script to your package.json file to enable uploading your test reports:
This script simplifies the process of uploading your test results to TestReport.io.
Step 6: Run the Upload Command
Finally, run the following command in your terminal:
This uploads your test report and screenshots to TestReport.io, making them available for analysis and sharing with your team.
Congratulations! You've successfully integrated Playwright with TestReport.io.