<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: PIPULPANT</title>
    <description>The latest articles on DEV Community by PIPULPANT (@pipulpant).</description>
    <link>https://dev.to/pipulpant</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1325874%2Fbf5a3d50-946e-4162-9cba-b201c98dba38.jpeg</url>
      <title>DEV Community: PIPULPANT</title>
      <link>https://dev.to/pipulpant</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pipulpant"/>
    <language>en</language>
    <item>
      <title>🚀 Integrating Zephyr Scale with Playwright: A Step-by-Step Guide 🧩</title>
      <dc:creator>PIPULPANT</dc:creator>
      <pubDate>Fri, 31 Jan 2025 16:18:18 +0000</pubDate>
      <link>https://dev.to/pipulpant/integrating-zephyr-scale-with-playwright-a-step-by-step-guide-4e89</link>
      <guid>https://dev.to/pipulpant/integrating-zephyr-scale-with-playwright-a-step-by-step-guide-4e89</guid>
      <description>&lt;p&gt;Playwright is a popular open-source framework for end-to-end testing, while Zephyr Scale (or Squad) is a powerful test management tool that integrates seamlessly with Jira. Combining the two can supercharge your testing workflows by enabling automated test results to sync with your test cases in Zephyr Scale. This blog will guide you through the process with easy-to-follow steps and code examples. 🎉&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🎯 Why Integrate Playwright with Zephyr Scale?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Centralized Test Management: Keep all your manual and automated test cases in one place.&lt;/li&gt;
&lt;li&gt;Enhanced Reporting: Sync Playwright test results directly with your Zephyr Scale dashboard.&lt;/li&gt;
&lt;li&gt;Seamless Collaboration: Enable QA and development teams to collaborate more effectively.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;🛠️ Prerequisites&lt;/strong&gt;&lt;br&gt;
Before we start, ensure you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Jira Access: A Jira project integrated with Zephyr Scale or Squad.&lt;/li&gt;
&lt;li&gt;API Token: A Zephyr Scale API token for authentication.&lt;/li&gt;
&lt;li&gt;Playwright Setup: A working Playwright project.&lt;/li&gt;
&lt;li&gt;Node.js Installed: Required for Playwright and npm packages.&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;&lt;strong&gt;📝 Step 1: Install the Playwright-Zephyr Reporter&lt;/strong&gt;&lt;br&gt;
Start by installing the playwright-zephyr reporter package:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -D playwright-zephyr&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🔧 Step 2: Configure Playwright to Use Zephyr Scale&lt;/strong&gt;&lt;br&gt;
Edit your playwright.config.ts file to include the Zephyr reporter. Here's an example configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
  reporter: [
    ['playwright-zephyr/lib/src/cloud', {
      projectKey: 'QA', // Replace 'QA' with your Zephyr project key
      authorizationToken: process.env.ZEPHYR_AUTH_TOKEN, // Set this in your environment
      autoCreateTestCases: true, // Automatically create test cases if they don't exist
    }],
  ],
  // Add your Playwright test settings below
};
export default config;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🛠️ Key Points:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;projectKey: Found in your Jira project URL (e.g., &lt;a href="https://yourdomain.atlassian.net/jira/software/projects/QA/boards/654" rel="noopener noreferrer"&gt;https://yourdomain.atlassian.net/jira/software/projects/QA/boards/654&lt;/a&gt; where QA is the project key).&lt;/li&gt;
&lt;li&gt;authorizationToken: Use your Zephyr Scale API token here.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;📝 Step 3: Annotate Your Tests with Test Case IDs 🏷️&lt;/strong&gt;&lt;br&gt;
Zephyr Scale maps Playwright test results to test cases using test case IDs. Add these IDs to your test titles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { test, expect } from '@playwright/test';
test('[QA-123] Verify login functionality', async ({ page }) =&amp;gt; {
  await page.goto('https://example.com/login');
  await page.fill('#username', 'testuser');
  await page.fill('#password', 'password123');
  await page.click('#loginButton');
  expect(await page.title()).toBe('Dashboard');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;🎬 Step 4: Run Your Tests and Sync Results&lt;/strong&gt;&lt;br&gt;
Run your Playwright tests using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx playwright test&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The reporter will automatically publish the results to Zephyr Scale. 🚀&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🛠️ Step 5: Verify Test Results in Zephyr Scale&lt;/strong&gt;&lt;br&gt;
Log in to your Zephyr Scale dashboard.&lt;br&gt;
Navigate to your project.&lt;br&gt;
Check the test cases for updated execution results. ✅&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🔍 Troubleshooting Common Issues 🐛&lt;/strong&gt;&lt;br&gt;
Error: projectKey must match "([A-Z][A-Z_0-9]+)"&lt;/p&gt;

&lt;p&gt;Ensure your projectKey follows the correct format: uppercase letters, underscores, and digits only.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Test Results Not Syncing&lt;br&gt;
Check the logs for errors.&lt;br&gt;
Verify your API token and project key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authentication Issues&lt;br&gt;
Ensure your ZEPHYR_AUTH_TOKEN is set as an environment variable.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;🧩 Sample Code Repository&lt;/strong&gt;&lt;br&gt;
Here's a simplified structure of your Playwright project with Zephyr integration:&lt;br&gt;
├── tests/&lt;br&gt;
│   ├── login.spec.ts&lt;br&gt;
├── playwright.config.ts&lt;br&gt;
├── package.json&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🚀 Wrapping Up&lt;/strong&gt;&lt;br&gt;
Integrating Playwright with Zephyr Scale bridges the gap between automated testing and test management. It helps teams centralize testing workflows, streamline reporting, and collaborate effectively. By following this guide, you'll have a seamless integration that enhances your QA process. 💻✨&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Pro Tip: Always keep your Zephyr test cases updated and well-documented to avoid inconsistencies in mapping.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Do you have any questions or need more help? Drop your queries below! 💬&lt;br&gt;
Happy Testing! 🧪🚀&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
