<?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: Vansh Vardhan Singh</title>
    <description>The latest articles on DEV Community by Vansh Vardhan Singh (@vanshvsingh).</description>
    <link>https://dev.to/vanshvsingh</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%2F2197345%2Fa5a41c23-04e7-402a-8903-9450f48e1286.png</url>
      <title>DEV Community: Vansh Vardhan Singh</title>
      <link>https://dev.to/vanshvsingh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vanshvsingh"/>
    <language>en</language>
    <item>
      <title>Learn how to accelerate your Playwright test suite with Microsoft Playwright Testing service</title>
      <dc:creator>Vansh Vardhan Singh</dc:creator>
      <pubDate>Tue, 10 Dec 2024 19:06:15 +0000</pubDate>
      <link>https://dev.to/vanshvsingh/-59fh</link>
      <guid>https://dev.to/vanshvsingh/-59fh</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/playwright" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6222%2F2467899f-c222-4218-9f92-b3e3d6c1f4f5.png" alt="Playwright end to end Testing" width="400" height="400"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2197345%2Fa5a41c23-04e7-402a-8903-9450f48e1286.png" alt="" width="210" height="226"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/playwright/accelerate-your-playwright-test-suite-with-microsoft-playwright-testing-3kj4" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Accelerate Your Playwright Test Suite with Microsoft Playwright Testing&lt;/h2&gt;
      &lt;h3&gt;Vansh Vardhan Singh for Playwright end to end Testing ・ Nov 12&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#testing&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#scaling&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#playwright&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webapp&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Accelerate your Playwright test suite with Microsoft Playwright Testing</title>
      <dc:creator>Vansh Vardhan Singh</dc:creator>
      <pubDate>Tue, 12 Nov 2024 18:10:27 +0000</pubDate>
      <link>https://dev.to/playwright/accelerate-your-playwright-test-suite-with-microsoft-playwright-testing-3kj4</link>
      <guid>https://dev.to/playwright/accelerate-your-playwright-test-suite-with-microsoft-playwright-testing-3kj4</guid>
      <description>&lt;p&gt;Are you tired of waiting for your Playwright test suite to finish? Do you want to run tests across multiple operating systems and browsers without the hassle of managing complex infrastructure? With Microsoft Playwright Testing, you can speed up your test runs and improve test coverage by seamlessly executing tests across various OS-browser combinations.&lt;/p&gt;

&lt;p&gt;In this post, we’ll dive into the cloud-hosted browsers feature offered by the service, explore how it works, and learn how to integrate it with your existing Playwright test suite.&lt;/p&gt;

&lt;h2&gt;
  
  
  Microsoft Playwright Testing service
&lt;/h2&gt;

&lt;p&gt;Microsoft Playwright Testing is a managed service that leverages the cloud to allow much higher test parallelization across different OS-browser combinations. This means faster test runs with broader coverage, enabling quicker feature delivery without compromising quality.&lt;/p&gt;

&lt;p&gt;As your web application grows, your test suite expands, leading to longer execution times that can bottleneck your CI pipeline and delay feature delivery. Modern web apps must work flawlessly across various browsers and operating systems, adding to test duration. Microsoft Playwright Testing eliminates these limitations by running your tests on cloud-hosted browsers, allowing you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expedite test runs&lt;/strong&gt;: Run more tests in parallel without worrying about local resource constraints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improve test coverage&lt;/strong&gt;: Easily test across different browsers and operating systems, with infrastructure management handled by the service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test with confidence&lt;/strong&gt;: Rely on a managed infrastructure for consistent results, reducing test flakiness with no additional overhead.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How does the service work?
&lt;/h2&gt;

&lt;p&gt;The Playwright Testing service utilizes Playwright OSS’s native ability to run multiple tests in parallel. When you trigger a test run, Playwright spins up multiple worker processes, each responsible for launching its own browser instance.&lt;/p&gt;

&lt;p&gt;When running tests on your dev machine, the number of browsers you can launch is restricted by your system's resources. This limitation becomes even more pronounced in CI pipelines, where large test suites need to be executed, often causing delays as teams wait for results to move forward. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikms0d74ktvw8v3k5bxp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikms0d74ktvw8v3k5bxp.png" alt="Running Playwright tests without the service" width="602" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Microsoft Playwright Testing, however, the browsers are hosted and managed in the cloud. This eliminates local resource constraints, enabling you to run many more tests in parallel. Additionally, you can choose the operating system where the browsers are hosted, improving test coverage without increasing complexity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwqkqgxkv90p3wg7m9y8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwqkqgxkv90p3wg7m9y8.png" alt="Running Playwright tests using Microsoft Playwright Testing service" width="602" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Integrate Your Test Suite with Microsoft Playwright Testing
&lt;/h2&gt;

&lt;p&gt;To get started with Microsoft Playwright Testing, follow these steps:&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;A functioning Playwright test suite in JS/TS using the Playwright Test Runner. If you don't have one, create it by using the &lt;a href="https://playwright.dev/docs/intro" rel="noopener noreferrer"&gt;Playwright getting started documentation&lt;/a&gt; or use our &lt;a href="https://github.com/microsoft/playwright-testing-service/tree/main/samples/get-started" rel="noopener noreferrer"&gt;Microsoft Playwright Testing sample project&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;An Azure account with an active subscription. If you don't have an Azure subscription, &lt;a href="https://azure.microsoft.com/free/?WT.mc_id=A261C142F" rel="noopener noreferrer"&gt;create a free account before you begin&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Azure CLI installed &lt;a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli" rel="noopener noreferrer"&gt;download it here&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Steps to integrate
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a Playwright Testing workspace&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign in to &lt;a href="https://playwright.microsoft.com" rel="noopener noreferrer"&gt;service portal&lt;/a&gt; using your Azure credentials.&lt;/li&gt;
&lt;li&gt;Select your subscription, click &lt;strong&gt;New Workspace&lt;/strong&gt;, and provide the following information:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Workspace name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Enter a unique name to identify your workspace. The name can only consist of alphanumerical characters and must be between 3 and 64 characters long.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Azure subscription&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Select the Azure subscription that you want to use for this Microsoft Playwright Testing workspace.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Region&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Select a geographic location to host your workspace. This is the location where the test run data is stored for the workspace.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3tmf5916oq8ysat26cf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3tmf5916oq8ysat26cf.png" alt="Create workspace from service portal" width="752" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Create workspace&lt;/strong&gt; to create it within your subscription. Once the workspace is created, you will be taken to a page with instructions to get started. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install the service package in your Playwright project&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;In your IDE, navigate to Playwright project and run the following command. This will create a &lt;code&gt;playwright.service.config.ts&lt;/code&gt; file alongside your Playwright config file, enabling tests to run on the service.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init @azure/microsoft-playwright-testing
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set up Authentication&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Microsoft Entra ID is the default and recommended authentication for the service. Run this command to sign in:&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Before running this command, make sure you have &lt;a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli" rel="noopener noreferrer"&gt;Azure CLI&lt;/a&gt; installed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; az login
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure region endpoint&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Copy the region endpoint from &lt;a href="https://playwright.microsoft.com" rel="noopener noreferrer"&gt;service portal&lt;/a&gt; and set it as 'PLAYWRIGHT_SERVICE_URL' environment variable in your test setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flppqkgbhonl9lyuvmw6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flppqkgbhonl9lyuvmw6u.png" alt="Copy workspace url" width="752" height="140"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run the tests on the service&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Run the following command. This will create 20 workers, each executing a test on the browsers hosted on the service.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;playwright.service.config.ts &lt;span class="nt"&gt;--workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;20
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Next steps
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run tests across different operating systems&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modify the &lt;code&gt;playwright.service.config.ts&lt;/code&gt; file to change the operating system. &lt;a href="https://learn.microsoft.com/en-us/azure/playwright-testing/how-to-use-service-config-file#settings-in-playwrightserviceconfigts-file" rel="noopener noreferrer"&gt;Learn more here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test locally hosted applications&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To test locally hosted or private applications, set the &lt;code&gt;exposeNetwork&lt;/code&gt; field in &lt;code&gt;playwright.service.config.ts&lt;/code&gt;. &lt;a href="https://learn.microsoft.com/en-us/azure/playwright-testing/how-to-test-local-applicationsm" rel="noopener noreferrer"&gt;Learn more here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Integrate MPT with CI pipelines to expedite test execution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrating the service in CI pipelines is easy. &lt;a href="https://learn.microsoft.com/en-us/azure/playwright-testing/quickstart-automate-end-to-end-testing?tabs=github" rel="noopener noreferrer"&gt;Here’s the documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Microsoft Playwright Testing streamlines your testing workflows, allowing you to run tests across multiple operating systems and browsers without the complexity of managing infrastructure. By integrating cloud-hosted browsers into your existing Playwright test suite, you can significantly reduce test execution times, improve test coverage, and enhance overall efficiency—leading to faster feature delivery and smoother releases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn more
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aka.ms/mpt/docs" rel="noopener noreferrer"&gt;Get started with Microsoft Playwright Testing&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aka.ms/mpt/about" rel="noopener noreferrer"&gt;Explore Playwright Testing features&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aka.ms/mpt/pricing" rel="noopener noreferrer"&gt;Check out the pricing&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Join the &lt;strong&gt;mpt-service&lt;/strong&gt; channel on our &lt;a href="https://discord.gg/playwright" rel="noopener noreferrer"&gt;Discord community&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/@Playwrightdev" rel="noopener noreferrer"&gt;Playwright on YouTube&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>testing</category>
      <category>scaling</category>
      <category>playwright</category>
      <category>webapp</category>
    </item>
  </channel>
</rss>
