<?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: Vibhanshu Jain</title>
    <description>The latest articles on DEV Community by Vibhanshu Jain (@vibhanshujain).</description>
    <link>https://dev.to/vibhanshujain</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%2F768050%2F3fbc3815-cbdd-4666-85bf-1428b43ef451.jpeg</url>
      <title>DEV Community: Vibhanshu Jain</title>
      <link>https://dev.to/vibhanshujain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vibhanshujain"/>
    <language>en</language>
    <item>
      <title>Eye-catching features of the Playwright</title>
      <dc:creator>Vibhanshu Jain</dc:creator>
      <pubDate>Sat, 19 Aug 2023 05:24:14 +0000</pubDate>
      <link>https://dev.to/vibhanshujain/eye-catching-features-of-the-playwright-3lb9</link>
      <guid>https://dev.to/vibhanshujain/eye-catching-features-of-the-playwright-3lb9</guid>
      <description>&lt;p&gt;I was amazed by trending Automation tool Playwright and wanted to share some eye-catching features of the Playwright:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;API support on the fly&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No need to depend on third-party library to automate API&lt;/li&gt;
&lt;li&gt;API can be added along with UI test cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;In the below snip, I am using API response after the click event on the UI effortlessly:&lt;/u&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hQkfmQce--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9lm076is9hoqbqurd7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hQkfmQce--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9lm076is9hoqbqurd7h.png" alt="Playwright Code snip" width="656" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;In-built support of the detailed reports&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inbuilt descriptive support&lt;/li&gt;
&lt;li&gt;Support of the test screenshots,  videos, and logs on the go&lt;/li&gt;
&lt;li&gt;Easy to debug at any point of the test case via timelines or the test steps&lt;/li&gt;
&lt;li&gt;Point out the flaky test cases which help us to catch intermittent failures &lt;/li&gt;
&lt;li&gt;Network logs recorded for each test step&lt;/li&gt;
&lt;li&gt;Pick locator, Selectors for the web page directly from the report&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Below is the snip of the in-built report&lt;/u&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q1Aw8lue--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2zyqrs9vp037id7l74i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q1Aw8lue--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2zyqrs9vp037id7l74i.png" alt="Report Snip" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Assert based on Visual Comparisons&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Playwright allows you to assert a test case totally based on the screenshot pixels &lt;/li&gt;
&lt;li&gt;Validate test cases based on the screenshot of the page as well as the single component e.g toggle button&lt;/li&gt;
&lt;li&gt;Helps in catching user experience issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Here test case got failed due to image comparison &lt;/u&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8uwDM3-y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsf1o1amwl0ban69u41f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8uwDM3-y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsf1o1amwl0ban69u41f.png" alt="Image description" width="770" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Easy to handle Download streams&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Easy to perform operations on the downloaded files&lt;br&gt;
here is a good read(&lt;a href="https://playwright.dev/docs/api/class-download"&gt;https://playwright.dev/docs/api/class-download&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Auto-wait mechanism&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No need to break your head why it is not clicked and not filled, it handles wait automatically for each action&lt;/li&gt;
&lt;li&gt;It will run all the possible wait scenarios before performing an action
Here is an example of the click action done by the playwright:
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--byFWxj65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vos1dpm1m167eyxxev0d.png" alt="Image description" width="800" height="804"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do let me know the feature which amazed you and wanted to explore the Playwright more &lt;/p&gt;

</description>
      <category>playwright</category>
      <category>automation</category>
      <category>testing</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Playwright Awesome Selectors</title>
      <dc:creator>Vibhanshu Jain</dc:creator>
      <pubDate>Sat, 19 Nov 2022 07:48:52 +0000</pubDate>
      <link>https://dev.to/vibhanshujain/playwright-awesome-selectors-198m</link>
      <guid>https://dev.to/vibhanshujain/playwright-awesome-selectors-198m</guid>
      <description>&lt;p&gt;Check out my &lt;a href="https://medium.com/@vibhanshu_jain/playwright-awesome-selectors-6b5460e8d207" rel="noopener noreferrer"&gt;short post&lt;/a&gt; on Playwright Awesome Selectors&lt;/p&gt;

&lt;p&gt;My personal favourite is &lt;code&gt;page.getByRole(role, options)&lt;/code&gt;&lt;br&gt;
eg:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await page.getByRole('button', { name: 'Sign in' }).click();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do tell me yours...😀&lt;/p&gt;

</description>
      <category>ai</category>
      <category>discuss</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Playwright ?</title>
      <dc:creator>Vibhanshu Jain</dc:creator>
      <pubDate>Fri, 28 Oct 2022 15:26:35 +0000</pubDate>
      <link>https://dev.to/vibhanshujain/playwright--2b0a</link>
      <guid>https://dev.to/vibhanshujain/playwright--2b0a</guid>
      <description>&lt;p&gt;I want to share about the trending tool Playwright, which I came across recently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Playwright ?
&lt;/h2&gt;

&lt;p&gt;Playwright is an End-to-End Testing framework, which comes with a lot of inbuilt features that you will require in any automation tool. Playwright tests anything that runs in a web browser. All of the architecture surroundings, It is built to handle modern JavaScript frameworks like React, Angular, Vue, Elm, etc.&lt;br&gt;
In a nutshell, Playwright is a trending next generation front end testing tool built for the modern web&lt;/p&gt;

&lt;h2&gt;
  
  
  Playwright is all in one
&lt;/h2&gt;

&lt;p&gt;When we say all in one, we don't need any other 3rd party tool to achieve our automation tasks/framework.&lt;br&gt;
Unlike other tools, where we have to maintain and integrate multiple libraries to support automation framework, increasing the effort and cost required to maintain those libraries.&lt;br&gt;
With Playwright, we don’t have to worry about any of these things, since most of the things which are required come along with Playwright itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features of Playwright
&lt;/h2&gt;

&lt;p&gt;There is multiple uniqueness, which makes Playwright one of the choices for Web automation. A few of them are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Any browser • Any platform • One API&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cross-browser.&lt;br&gt;
Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cross-platform. &lt;br&gt;
Test on Windows, Linux, and macOS, locally or on CI, headless or headed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cross-language.&lt;br&gt;
Use the Playwright API in TypeScript, JavaScript, Python, .NET, Java.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test Mobile Web.&lt;br&gt;
Native mobile emulation of Google Chrome for Android and Mobile Safari. The same rendering engine works on your Desktop and in the Cloud.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Resilient • No flaky tests&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Auto-wait.&lt;br&gt;
Playwright waits for elements to be actionable prior to performing actions. It also has a rich set of introspection events. The combination of the two eliminates the need for artificial timeouts - the primary cause of flaky tests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web-first assertions.&lt;br&gt;
Playwright assertions are created specifically for the dynamic web. Checks are automatically retried until the necessary conditions are met.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tracing.&lt;br&gt;
Configure test retry strategy, capture execution trace, videos and screenshots to eliminate flakes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;No trade-offs • No limits&lt;/strong&gt;&lt;br&gt;
Browsers run web content belonging to different origins in different processes. Playwright is aligned with the modern browsers architecture and runs tests out-of-process. This makes Playwright free of the typical in-process test runner limitations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Multiple everything.&lt;br&gt;
Test scenarios that span multiple tabs, multiple origins and multiple users. Create scenarios with different contexts for different users and run them against your server, all in one test.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trusted events.&lt;br&gt;
Hover elements, interact with dynamic controls, produce trusted events. Playwright uses real browser input pipeline indistinguishable from the real user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test frames, pierce Shadow DOM.&lt;br&gt;
Playwright selectors pierce shadow DOM and allow entering frames seamlessly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Full isolation • Fast execution&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Browser contexts.&lt;br&gt;
Playwright creates a browser context for each test. Browser context is equivalent to a brand new browser profile. This delivers full test isolation with zero overhead. Creating a new browser context only takes a handful of milliseconds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Log in once. &lt;br&gt;
Save the authentication state of the context and reuse it in all the tests. This bypasses repetitive log-in operations in each test, yet delivers full isolation of independent tests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Powerful Tooling&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Codegen.&lt;br&gt;
Generate tests by recording your actions. Save them into any language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Playwright inspector.&lt;br&gt;
Inspect the page, generate selectors, step through the test execution, see click points, and explore execution logs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trace Viewer.&lt;br&gt;
Capture all the information to investigate the test failure. Playwright trace contains test execution screencast, live DOM snapshots, action explorer, test source, and many more.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have not covered coding and architecture as it will confuse the new readers.&lt;br&gt;
Thanks for the read let me know what things you are interested in about this tool and what you want to know more.&lt;/p&gt;

&lt;p&gt;Official Playwright link: &lt;a href="https://playwright.dev/docs/intro"&gt;https://playwright.dev/docs/intro&lt;/a&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>testing</category>
    </item>
    <item>
      <title>Cypress?</title>
      <dc:creator>Vibhanshu Jain</dc:creator>
      <pubDate>Mon, 06 Dec 2021 06:51:46 +0000</pubDate>
      <link>https://dev.to/vibhanshujain/cypress-4go5</link>
      <guid>https://dev.to/vibhanshujain/cypress-4go5</guid>
      <description>&lt;p&gt;I want share about the trending tool Cypress, which I came across recently.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cypress?
&lt;/h1&gt;

&lt;p&gt;Cypress is an End-to-End Testing framework, which comes with a lot of inbuilt features that you will require in any automation tool.Cypress tests anything that runs in a web browser. All of the architecture surrounding, It is built to handle modern JavaScript frameworks like React, Angular, Vue, Elm, etc.&lt;br&gt;
In a nutshell Cypress is a next generation front end testing tool built for the modern web&lt;/p&gt;

&lt;h1&gt;
  
  
  Cypress is all in one
&lt;/h1&gt;

&lt;p&gt;When we say all in one means we don't need any other 3rd party tool to achieve our automation framework.&lt;br&gt;
Unlike other tools, where we have to maintain and integrate multiple libraries to support automation framework, increasing the effort and cost required to maintain those libraries. &lt;br&gt;
With Cypress, we don’t have to worry about any of these things, since most of the things which are required come along with Cypress itself.&lt;/p&gt;

&lt;h1&gt;
  
  
  Features of Cypress
&lt;/h1&gt;

&lt;p&gt;There is multiple uniqueness, which makes Cypress one of the choices for Web automation. Few of them are:&lt;br&gt;
&lt;strong&gt;Fast&lt;/strong&gt; - Run on the fly.&lt;br&gt;
&lt;strong&gt;Flake Resistant&lt;/strong&gt; - Cypress automatically waits for commands and assertions before moving on. No more async issues.&lt;br&gt;
&lt;strong&gt;Ability to test API’s&lt;/strong&gt; cases by mocking the server response. (Network Requests)&lt;br&gt;
&lt;strong&gt;Debuggability&lt;/strong&gt; -We can hover over each command in the Command Log to accurately see what happened at each step.&lt;br&gt;
View videos of the execution of your entire tests when running from the Cypress Dashboard.&lt;br&gt;
&lt;strong&gt;Viewport Sizing&lt;/strong&gt; - set your app viewport size to test responsive layouts.&lt;/p&gt;

&lt;p&gt;I have not covered the coding part and architecture as it will be confusing to the new readers.&lt;br&gt;
Thanks for the read let me know what are the things you are interested about this tool and what you want to know more.&lt;/p&gt;

&lt;p&gt;Official cypress link: &lt;a href="https://www.cypress.io/"&gt;https://www.cypress.io/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>testing</category>
      <category>discuss</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
