<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kushang Gajjar on Medium]]></title>
        <description><![CDATA[Stories by Kushang Gajjar on Medium]]></description>
        <link>https://medium.com/@gkushang?source=rss-ce86d58c009------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*09asUHtSkih31ZzSv4Y4jQ.jpeg</url>
            <title>Stories by Kushang Gajjar on Medium</title>
            <link>https://medium.com/@gkushang?source=rss-ce86d58c009------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 06:15:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gkushang/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Salesforce Testing: Codecept & AI]]></title>
            <link>https://gkushang.medium.com/salesforce-testing-codecept-ai-df4ffbff9f1f?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/df4ffbff9f1f</guid>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Fri, 30 May 2025 03:05:31 GMT</pubDate>
            <atom:updated>2025-05-30T03:07:06.538Z</atom:updated>
            <content:encoded><![CDATA[<h4>️<strong><em>an open-source test automation framework</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SMrDWm9Hlaz0K4fPTUtlw.png" /></figure><p>👀 Looking for an open-source tool to automate complex UI and REST APIs in enterprise applications like <strong>Salesforce</strong>? Discover how <strong>Codecept(JS)</strong> streamlines E2E and integration testing for dynamic apps, including <em>Salesforce’s Lightning Components and Shadow DOMs.</em></p><h3>The Challenge 🚨</h3><p>Automating enterprise applications like Salesforce UI presents unique challenges due to advanced technologies like <em>Lightning UI and Shadow DOMs</em>. Locating elements within deeply nested shadow roots often fails with standard WebDriver APIs (Selenium), resulting in brittle and hard-to-maintain scripts.</p><p>✔️ We tackled these issues by adopting Codecept, which provides robust solutions for overcoming these limitations and ensuring scalable, high-quality automation for the ShadowDOM or Lightning DOM Applications!</p><h3>The Choice: CodeceptJS 🌈</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsO6lqFbW_Gq6iy4Z8hZLA.png" /><figcaption>Framework Features: codeceptjs</figcaption></figure><p>After evaluating various open-source frameworks, extensive technical and architectural reviews; <strong>Codecept</strong> stood out as the framework of choice, with Playwright and WebdriverIO as the underlying drivers 🎯</p><blockquote><strong>️️️💁‍♂️ </strong>Why Codecept?</blockquote><blockquote><a href="https://codecept.io/">Codecept</a> is a powerful, open-source test framework for E2E and API automation in dynamic, enterprise-grade applications with exclusive Shadow DOM support.</blockquote><blockquote>Its driver-agnostic design supports platforms like Playwright and WebdriverIO, OpenAI integrations, offering human-readable syntax, reusable components, and advanced UI technology support to tackle automation challenges in apps like Salesforce.</blockquote><blockquote><strong>🚛 Key features include:</strong></blockquote><blockquote><strong>Shadow DOM Support</strong>: Simplifies interactions with elements encapsulated within Shadow DOMs.</blockquote><blockquote><strong>Driver Agnostic</strong>: Unified authoring for Playwright, WebdriverIO, and more.</blockquote><blockquote><strong>Interactive Console</strong>: Accelerates test development and debugging with <em>“pause()”</em> interface</blockquote><blockquote><strong>Gherkin Support</strong>: Enables behavior-driven development (BDD) with plain-English feature files.</blockquote><blockquote><strong>Our Feedback on Codecept so far: </strong>Codecept has proven to be a very stable and reliable framework, authoring tests are even faster with “Interactive Console”, our developer’s tests are mocha-friendly, and E2E are in Gherkin BDD feature files, all tests run in parallel, and Codecept APIs are human-readable, e.g.</blockquote><blockquote>“I.click(‘.any-shadow-lighting-webcomponent’) // runs on both Playwright &amp; weddriverIO”</blockquote><h3>Test Automation Framework Architecture 🏙</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xWHx1eeo658F_5bOaYeOA.png" /><figcaption>Architecture of <a href="https://github.com/salesforce/codeceptjs-bdd">github/salesforce/codeceptjs-bdd</a></figcaption></figure><p><strong>Page Objects</strong>: Encapsulate UI Page Objects with reusable methods.</p><p><strong>Flows</strong>: Implement Screenplay patterns to model user tasks such as searchProduct, addToCart, or checkoutAsGuest, etc., or Headless APIs.</p><p><strong>Gherkin Features</strong>: Capture customer-facing scenarios in plain English for shared understanding across teams. It provides visibility into how the system should behave and creates a shared understanding among different Salesforce Cloud or other Enterprise applications Integrations (BDD).</p><p><a href="https://gkushang.medium.com/bdd-in-3-minutes-c3f8fc022237">More info on BDD</a> 🔗</p><p><strong>REST APIs</strong>: Built-in REST helpers simplify API testing for CRUD operations and session handling.</p><p><strong>Soft Assertions</strong>: Collect multiple test failures in a single run for comprehensive error reporting.</p><h3>Cross-Layer Testing with CodeceptJS 🎨</h3><p>CodeceptJS supports the entire testing pyramid, from unit tests to full-scale E2E scenarios, using drivers like Playwright and WebdriverIO. With a unified approach, developers can re-use page objects and locators across different layers, teams can write one scenario and execute it on either platform, reusing page objects and utilities across layers for consistency and reduced maintenance.</p><blockquote>Write One Scenario <strong>→ </strong>execute on either Playwright or WebdriverIO</blockquote><h3>Execution &amp; Reporting 📊</h3><p>CodeceptJS-powered tests can be executed across various browsers, devices, and headless environments on platforms like Sauce Labs, Selenium Grid or headless Playwright in Jenkins.</p><p>Results are visualized through tools like Kibana, with real-time Slack notifications to streamline triage and collaboration. Allure HTML are integrated for detailed HTML Reporting.</p><h3>🤝 Highlights of Adoption</h3><ul><li>Simplified automation for Shadow DOM-heavy applications like Salesforce UI.</li><li>Unified testing tools across testing layers, enabling collaboration between development and QA teams.</li><li>Scalable test execution with robust reporting, accelerating quality assurance in enterprise ecosystems.</li><li>Testing with AI.</li></ul><h3>Would you like to try it out?</h3><p>The vanilla Codecept framework from <strong>Salesforce</strong> is <strong>open-source</strong>. If you’d like to give it a try, go to <a href="https://github.com/salesforce/codeceptjs-bdd">https://github.com/salesforce/codeceptjs-bdd</a>,</p><p><strong>More info:</strong> <a href="https://medium.com/@gkushang/automation-made-easy-for-web-components-shadow-roots-b23016779ce8">Automation Made Easy with Shadow DOMs</a></p><p><strong>Happy Testing!</strong> Stay curious and keep innovating.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df4ffbff9f1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self-Healing Tests using OpenAI ]]></title>
            <link>https://gkushang.medium.com/self-healing-tests-using-openai-fe9047525ab7?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe9047525ab7</guid>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 20:16:49 GMT</pubDate>
            <atom:updated>2025-01-07T16:25:35.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>an open-source solution</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F0pBFTTboarUoAT7QHmHoA.png" /></figure><p>We’ve all experienced that the UI tests are often fragile, breaking whenever locators or UI structures change. Fixing them can feel like an endless task, and let’s be honest, it’s not the most exciting part of automation.</p><p>Wouldn’t it be amazing if tests could adapt on their own and keep running?</p><blockquote>Well, now they can! With Generative AI, we can make our tests smarter and more resilient — AI takes care of it, letting us focus on what really matters!</blockquote><p>In this post, we’ll explore how OpenAI APIs can help us create <em>self-healing UI tests</em> that adapt to changes seamlessly, saving time, effort, and a lot of frustration.</p><p>The complete code is available on <a href="https://github.com/gkushang/openai-self-healing-tests">GitHub</a> with CodeceptJS framework, and you can watch the demo on <a href="https://www.youtube.com/watch?v=7n2yBFmgHVk">YouTube</a>.</p><h3>Let’s see this in action 🎥</h3><p>To demonstrate the Self-Healing using OpenAI, I am using the simpler <a href="https://github.com/login">Github Login</a> UI Scenario with CodeceptJS framework!</p><h4>🫥 Failure Scenario</h4><p>Imagine a test for the GitHub login page where the locator for the “Sign In” button changes. This would typically cause the test to fail, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTf1g4sv22uEnW7BuuG5XA.png" /><figcaption><strong>Test Failure Report (before OpenAI Self-Healing)</strong></figcaption></figure><h3>🦾 Self-Healing with OpenAI</h3><p>Instead of letting the test fail, let’s leverage <strong><em>OpenAI to self-heal </em></strong>by identifying the correct locator. This ensures the test passes and provides suggestions for updating the automation script.</p><h4>The Idea 💡</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZ6WOXWtP7ISAQeJgExQYA.png" /></figure><h4>1. Test Detects the Failure</h4><p>Test detects the failure that the sign-in locator not found, throws the error. The framework captures the error as shown below,</p><pre>at event.test.fail (codeceptjs event)<br>-- FAILURES:<br>  1) Github Login @github<br>       Fred should be able to login to Github @login_github:<br>     Clickable element &quot;[data-signin-label=&quot;Sign in INVALID&quot;]&quot; was not found by text|CSS|XPath<br>      at new ElementNotFound (node_modules/codeceptjs/lib/helper/errors/ElementNotFound.js:15:11)<br>      at assertElementExists (node_modules/codeceptjs/lib/helper/Playwright.js:3744:11)<br>      at Playwright.proceedClick (node_modules/codeceptjs/lib/helper/Playwright.js:3503:5)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5Lfu3FnP_1U1VzbjlsjyQ.png" /></figure><h4>2. OpenAI Suggests the Correction</h4><p>We send a structured prompt to OpenAI with the error details, framework, and the HTML of the page. OpenAI analyzes this and provides a suggestion for the correct locator along with the updated code snippet.</p><p>The prompt should be like below,</p><blockquote>“I am a test automation engineer. I am automating UI with <strong>{framework} </strong>in the <strong>{language}</strong>. I want to heal the test that fails. I am facing error:<strong> {error}</strong>. Can you suggest me the code-line to fix the error? The code-line should be in this <strong>{format}. </strong>Here is the HTML code of the page where the failure has happened: <strong>{html}”</strong></blockquote><pre> prompt: &#39;As a test automation engineer I am testing web application using CodeceptJS.\n&#39; +<br>      &#39;I want to heal a test that fails. Here is the list of executed steps: I am on page &quot;/login/&quot;, I fill field &quot;[name=&quot;login&quot;]&quot;, &quot;xyz&quot;, I fill field &quot;[name=&quot;password&quot;]&quot;, &quot;****&quot;\n&#39; +<br>      &#39;Propose how to adjust I.click(&quot;[data-signin-label=&quot;Sign in INVALID&quot;]&quot;) step to fix the test.\n&#39; +<br>      &#39;Use locators in order of preference: semantic locator by text, CSS, XPath. Use codeblocks marked with ```\n&#39; +<br>      &#39;Here is the error message: Clickable element &quot;[data-signin-label=&quot;Sign in INVALID&quot;]&quot; was not found by text|CSS|XPath\n&#39; +<br>      &#39;Here is HTML code of a page where the failure has happened: \n&#39; +<br>      &#39;&lt;html&gt;&lt;body&gt;&lt;div class=&quot;logged-out env-production page-responsive session-authentication&quot;&gt;&lt;div class=&quot;position-relative header-wrapper js-header-wrapper&quot;&gt;&lt;a class=&quot;show-on-focus js-skip-to-content&quot;&gt;Skip to content&lt;/a&gt;&lt;div class=&quot;header header-logged-out width-full&quot; role=&quot;banner&quot;&gt;&lt;div class=&quot;container clearfix width-full&quot;&gt;&lt;a class=&quot;header-logo&quot; aria-label=&quot;Homepage&quot;&gt;&lt;svg class=&quot;octicon octicon-mark-github&quot;&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;js-stale-session-flash stale-session-flash flash flash-warn flash-full&quot;&gt;&lt;span class=&quot;js-stale-session-flash-signed-in&quot;&gt;&lt;a class=&quot;Link--inTextBlock&quot;&gt;Reload&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;js-stale-session-flash-signed-out&quot;&gt;&lt;a class=&quot;Link--inTextBlock&quot;&gt;Reload&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;js-stale-session-flash-switched&quot;&gt;&lt;a class=&quot;Link--inTextBlock&quot;&gt;Reload&lt;/a&gt;&lt;/span&gt;&lt;button id=&quot;icon-button-b772ec41-c556-4ddc-b2ea-6ddaf37605d3&quot; aria-labelledby=&quot;tooltip-8f142078-07a5-4d0e-b5e2-9767e2b95bfe&quot; type=&quot;button&quot; class=&quot;Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close&quot;&gt;&lt;svg class=&quot;octicon octicon-x Button-visual&quot;&gt;&lt;/svg&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;application-main&quot;&gt;&lt;main&gt;&lt;div class=&quot;auth-form&quot; id=&quot;login&quot;&gt;&lt;div class=&quot;auth-form-header&quot;&gt;&lt;h1&gt;Sign in to GitHub&lt;/h1&gt;&lt;/div&gt;&lt;div class=&quot;flash js-transform-notice&quot;&gt;&lt;button class=&quot;flash-close js-flash-close&quot; type=&quot;button&quot; aria-label=&quot;Dismiss this message&quot;&gt;&lt;svg aria-label=&quot;Dismiss&quot; role=&quot;img&quot; class=&quot;octicon octicon-x&quot;&gt;&lt;/svg&gt;&lt;/button&gt;&lt;/div&gt;&lt;div class=&quot;auth-form-body&quot;&gt;&lt;form&gt;&lt;label for=&quot;login_field&quot;&gt;Username or email address&lt;/label&gt;&lt;input name=&quot;login&quot; id=&quot;login_field&quot; class=&quot;form-control input-block js-login-field&quot;&gt;&lt;div class=&quot;position-relative&quot;&gt;&lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; class=&quot;form-control form-control input-block js-password-field&quot;&gt;&lt;a class=&quot;label-link position-absolute&quot; id=&quot;forgot-password&quot;&gt;Forgot password?&lt;/a&gt;&lt;input class=&quot;form-control&quot; name=&quot;required_field_ccac&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;commit&quot; value=&quot;Sign in&quot; class=&quot;btn btn-primary btn-block js-sign-in-button&quot;&gt;&lt;/div&gt;&lt;/form&gt;&lt;webauthn-status class=&quot;js-webauthn-login-emu-control&quot;&gt;&lt;form class=&quot;js-conditional-webauthn-placeholder&quot;&gt;&lt;input name=&quot;required_field_b5af&quot; class=&quot;form-control&quot;&gt;&lt;/form&gt;&lt;div class=&quot;js-webauthn-login-section&quot;&gt;&lt;div&gt;&lt;form class=&quot;js-webauthn-form&quot;&gt;&lt;div class=&quot;webauthn-form-body&quot;&gt;&lt;webauthn-get&gt;&lt;button type=&quot;button&quot; class=&quot;js-webauthn-confirm-button btn btn-block Button--secondary Button--medium Button&quot;&gt;&lt;span class=&quot;Button-content&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/webauthn-get&gt;&lt;input name=&quot;required_field_45b3&quot; class=&quot;form-control&quot;&gt;&lt;/div&gt;&lt;/form&gt;&lt;/div&gt;&lt;/div&gt;&lt;/webauthn-status&gt;&lt;/div&gt;&lt;h2 class=&quot;sr-only&quot;&gt;Password login alternatives&lt;/h2&gt;&lt;div class=&quot;login-callout&quot;&gt;&lt;webauthn-subtle class=&quot;js-webauthn-subtle&quot;&gt;&lt;p class=&quot;js-webauthn-subtle-emu-control&quot;&gt;&lt;button type=&quot;button&quot; class=&quot;Button--link Button--medium Button&quot;&gt;&lt;span class=&quot;Button-content&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;&lt;/webauthn-subtle&gt;&lt;p&gt;&lt;a&gt;Create an account&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/main&gt;&lt;/div&gt;&lt;div class=&quot;footer container-lg p-responsive&quot; role=&quot;contentinfo&quot;&gt;&lt;ul class=&quot;list-style-none&quot;&gt;&lt;li&gt;&lt;a class=&quot;Link--secondary Link&quot;&gt;Terms&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;Link--secondary Link&quot;&gt;Privacy&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;Link--secondary Link&quot;&gt;Docs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;Link--secondary Link&quot;&gt;Contact GitHub Support&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;cookie-consent-link&gt;&lt;button type=&quot;button&quot; class=&quot;Link--secondary underline-on-hover&quot;&gt;Manage cookies&lt;/button&gt;&lt;/cookie-consent-link&gt;&lt;/li&gt;&lt;li&gt;&lt;cookie-consent-link&gt;&lt;button type=&quot;button&quot; class=&quot;Link--secondary underline-on-hover&quot;&gt;Do not share my personal information&lt;/button&gt;&lt;/cookie-consent-link&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div id=&quot;ajax-error-message&quot; class=&quot;ajax-error-message flash flash-error&quot;&gt;&lt;button type=&quot;button&quot; class=&quot;flash-close js-ajax-error-dismiss&quot; aria-label=&quot;Dismiss error&quot;&gt;&lt;svg class=&quot;octicon octicon-x&quot;&gt;&lt;/svg&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySoaOE_El076v7SPqsfG2g.png" /><figcaption><strong>Sending PROMPT to OpenAI</strong></figcaption></figure><p>In the example above, I’m leveraging the <a href="https://codecept.io/"><em>CodeceptJS</em></a> Framework, which provides access to both the specific code line and the previously executed steps. Including these details in the prompt significantly improves its accuracy. That said, this approach is framework-agnostic — regardless of the framework used underneath.</p><blockquote>💡<strong>Tip: The more detailed and precise the prompt, the more accurate the suggestions from OpenAI!</strong></blockquote><h4>3. Test Passes with OpenAI Suggestion</h4><p>OpenAI responds with the corrected locator, such as:</p><pre>OpenAI Response:<br><br>Here is the corrected step using a CSS selector:<br>```js<br>I.click(&#39;input[name=&quot;commit&quot;]&#39;); //the CodeceptJS command<br>```</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gp09uvAXT8Mv11sZBhpt7Q.png" /><figcaption><strong>✨ OpenAI Suggestions to Fix the Locators</strong></figcaption></figure><p>✔️ <em>The test executes the updated step, ensuring the scenario now passes.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgbFwU5ezmKPwXtaPc55Hw.png" /><figcaption><strong>Code Snippets were executed by Codecept</strong></figcaption></figure><h4>📊 AI Self-Healing Report</h4><p>Finally, Codecept generates a report detailing where the suggested fix was applied, enabling seamless updates to the locator through automated PRs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zo-2CrybyfY97L9fa-v52Q.png" /><figcaption><strong>Self-Healing Report by Codecept</strong></figcaption></figure><h3>🚀 Where do I find the complete code &amp; demo?</h3><ol><li><strong>Github Repo:</strong> <a href="https://github.com/gkushang/openai-self-healing-tests">https://github.com/gkushang/openai-self-healing-tests</a></li><li><strong>YouTube Demo:</strong> <a href="https://www.youtube.com/watch?v=7n2yBFmgHVk">https://www.youtube.com/watch?v=7n2yBFmgHVk</a></li></ol><p>Thanks for reading! 🙇 Happy Testing and Stay Curious! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe9047525ab7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Playwright: “Failed to launch Browsers” — how to solve?]]></title>
            <link>https://gkushang.medium.com/playwright-failed-to-launch-browsers-how-to-solve-8b01d03fe5b9?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b01d03fe5b9</guid>
            <category><![CDATA[playwright-community]]></category>
            <category><![CDATA[browsers]]></category>
            <category><![CDATA[chromium]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[codeceptjs]]></category>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Sat, 05 Jun 2021 18:13:25 GMT</pubDate>
            <atom:updated>2021-06-05T18:33:20.524Z</atom:updated>
            <content:encoded><![CDATA[<h3>Playwright: “Failed to launch Browsers” — how to solve?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lY6Vr5XXyIKdHputXVHJ9Q.png" /></figure><p>Are you facing issues with launching Playwright’s browsers locally or in your CI? Do you get the below error? If so, you’re at the right spot!</p><blockquote>“Error: Failed to launch chromium because executable doesn’t exist”</blockquote><p>This post explains how to solve the above issue in the CI. We use Playwright with the <a href="https://codecept.io/">CodeceptJS</a> framework, and often saw the above error with Playwright executions in our Jenkins CI and made our builds very <em>flaky 🤯</em></p><p>After googling more about the issue, I came across the Existing Issue on the Playwright and noticed that there are many other folks facing a similar issue.</p><p><strong>🔺 Playwright Issue:</strong> <a href="http://`/">https://github.com/microsoft/playwright/issues/4033</a></p><p>🚫 The issue was closed but unfortunately, there aren’t any solutions that worked for us.</p><h3><strong>⚠️ First, let’s take a look Why this happens?</strong></h3><p>“Each version of Playwright needs specific versions of browser binaries to operate. By default, and if lucky, Playwright downloads Chromium, WebKit, and Firefox browsers into the OS-specific cache folders — But We have seen this failing intermittently in our CI System and makes our CI flaky”</p><h3>🌈 Solution</h3><p>After trying a lot of options, I came across the Playwright’s flag that overrides the Playwright’s default Behaviors with Downloading and Launching browsers. I tried and worked really well.</p><p><strong>Our CI stabilized, finally! 🎯</strong></p><blockquote><em>“</em>🎯 <em>Download the Playwright version-specific Browsers and supply in your CI. And, CI will always have the browsers to launch”</em></blockquote><p><strong>Let’s see how to achieve this</strong> ⬇</p><ol><li>Download <em>version-specific</em> Playwright Browsers</li><li>Have Playwright launch browses from the downloaded location</li><li>(optional) Ask Playwright not to Download browsers by default, improves the package installation speed</li></ol><p><strong>Step 1. Download version-specific Playwright Browsers</strong></p><p>Override the Playwright’s Default behavior of “downloading browsers” through the Environment variable <strong>PLAYWRIGHT_BROWSERS_PATH.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a62eb7a8b415b3ec4c8fbde75f6b328b/href">https://medium.com/media/a62eb7a8b415b3ec4c8fbde75f6b328b/href</a></iframe><blockquote>The above step will download the browsers to location “/usr/lib/playwright”. Well, we dockerize the downloaded browsers for the CI and supply in our Jenkins.</blockquote><p><strong>Step 2. Have Playwright launch browses from the downloaded location</strong></p><p>Set the Browses path through <strong>PLAYWRIGHT_BROWSERS_PATH </strong>while running your tests</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b176ade5f3a068dba77a40b3e44ebee/href">https://medium.com/media/6b176ade5f3a068dba77a40b3e44ebee/href</a></iframe><blockquote>The above step will launch Chromium from the path “/usr/lib/playwright”, and guess what — It always finds the browsers to launch</blockquote><p><strong>Step 3. (recommended) Ask Playwright not to Download browsers by default</strong></p><p>I recommend skipping the default Browser downloads since you already have them available. This improves the speed of the installation and CI.</p><blockquote>Set the below environment variable before running yarn install to skip the default downloads,</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87f6d0ca621a5cb8b0d6c7cebfb22be6/href">https://medium.com/media/87f6d0ca621a5cb8b0d6c7cebfb22be6/href</a></iframe><p>Thanks for reading, I hope you discovered something new and useful. Stay curious, and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b01d03fe5b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automation made easy for Web Components #shadow-roots]]></title>
            <link>https://gkushang.medium.com/automation-made-easy-for-web-components-shadow-roots-b23016779ce8?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/b23016779ce8</guid>
            <category><![CDATA[lightning-web-component]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[salesforce-lightning]]></category>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 16:36:32 GMT</pubDate>
            <atom:updated>2022-09-13T18:10:27.060Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automate Shadow DOM with WebDriver &amp; Playwright</h3><h4>Locate elements in Shadow DOM of Web Components directly through the CSS query engine.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*5VHuFmJwDN9T0MToqh5itA.png" /></figure><p>This document shows how to use the simpler CSS/xPaths that calls through document.querySelector to locate elements within #shadow-root of your <strong>Web Components</strong> or <strong>Salesforce LWC </strong>Applications. This solution can be extended to LitElements, Lighting Fast Templates etc.</p><p>The wish is to locate your #shadow-root elements directly through CSS query engine (whic you cannot do it with current WebDriver implementation) e.g,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/688072c871ac827da34895057bf6731f/href">https://medium.com/media/688072c871ac827da34895057bf6731f/href</a></iframe><p>🔎 If you’re building your app with the Web Components or <a href="https://lwc.dev/">Salesforce’s LWC</a>, and if you try to use document.querySelector (in the console), it will not find anything in the document though you see the element in the Browser DOM. The reason is that the elements of Web Component are not in the <em>Main DOM</em> but rather in the <a href="https://www.webcomponents.org/introduction#shadow-dom">Shadow DOM</a>.</p><blockquote>“The Shadow DOM shield becomes the pain for developers in writing integration/component/E2E automated tests for Web Components.”</blockquote><h3>⚠️ THE PROBLEM</h3><blockquote>Shadow DOM <strong>prevents</strong> your components from easily being e2e tested because normal Selenium commands fail, due to the element actually not being in the main document. Rather, they are encapsulated under Shadow DOM.</blockquote><p>Selenium uses querySelector to find an element; Shadow DOMs prevent this.</p><p>The selector engines like css/xpath do not work on the shadow DOM by default.</p><h4>Example</h4><p>Let’s take a look at chrome://download page. It implements the Shadow DOM. As you see, the #searchInput is a scoped element under #shadow-root (open), and so the document.querySelector <strong>command fails</strong> to locate the #searchInput element,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKv5HvRWV-XetXuPmArQkg.gif" /></figure><p>The below query fails to return the element because #searchInput is encapsulated under Shadow Dom,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ff87622bc29dfc8144da9648c48c0bb/href">https://medium.com/media/1ff87622bc29dfc8144da9648c48c0bb/href</a></iframe><p>and as a result the below <em>Selenium WebDriver Command</em> <strong>will also fail </strong>to find an element ❎</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af4785ce5cb48633e734444fbcfac807/href">https://medium.com/media/af4785ce5cb48633e734444fbcfac807/href</a></iframe><p>So what is needed is a <strong>very complex nested CSS</strong> <strong>[not recommended] </strong>↓</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96b5abde6d915960e9f8180b727f50f6/href">https://medium.com/media/96b5abde6d915960e9f8180b727f50f6/href</a></iframe><p>🤔 now imagine, you add one more element in the nested route. Then, you are unknowingly breaking the automation tests. You will need to track and update all the existing nested CSS — which is a pain!!</p><h4>Can I get the support from WebDriver?</h4><p>Yes. <a href="https://github.com/salesforce/codeceptjs-bdd/tree/develop/examples/webcomponents-playwright-webdriver-example">Codeceptjs-BDD</a> Framework provides out-of-the-box support to locate Shadow DOM elements at ease. Though, there is an existing feature request to have the support in <a href="https://github.com/w3c/webdriver/issues/350">W3C/Webdriver</a>, but thru Codeceptjs-BDD Framework, you can locate elements like, document.query,</p><pre>I.click(&#39;.any-shadow-elements-in-dom&#39;); // no dom hierarchy</pre><blockquote>[..] most end-to-end testing frameworks rely on [..] calls to querySelector through CSS/xPaths. Elements in Shadow DOM are selectable by neither. But, we have a Solution at framework level.</blockquote><h3>🚀 THE SOLUTION</h3><p>The solution is <strong>Codeceptjs-BDD Webdriver implementations </strong>🎉 🎉 🎉<strong>, </strong>which provides automatic support for the Shadow DOM , and Playwright already has in-built support.</p><p>Let’s talk about the real scenarios built with framework <strong>CodeceptJS</strong>!</p><p><a href="https://github.com/salesforce/codeceptjs-bdd">salesforce/codeceptjs-bdd</a></p><p><strong><em>Example: </em></strong><em>As you see in line #6 in below gif, the CSS is pretty simplified in test.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D87eC9yXe4Zm42qqx78mBQ.gif" /></figure><p>✅ As you see in a below example, you would just define a very simple CSS #searchInput . The Playwright driver will find an element(s) for you. No need to mention about any of the hierachy of #shadow-roots!</p><p><strong>🙌 No Nested/Complex CSS required!</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f3eeeb821abf23a84d6614f87725159/href">https://medium.com/media/3f3eeeb821abf23a84d6614f87725159/href</a></iframe><p>Simply inspect the element in DOM, and grab the unique attribute. It is as simple as that with Playwright because Playwright does rest of the plumbing work for us.</p><p><strong>❣️ WebDriver Exclusive Support for Shadow Dom ⬇</strong></p><p><a href="https://github.com/salesforce/codeceptjs-bdd/tree/develop/examples/webcomponents-playwright-webdriver-example">salesforce/codeceptjs-bdd</a></p><h4>✅ The Framework Documentations:<a href="https://gkushang.github.io/"> https://gkushang.github.io/</a></h4><h3>Demo Time</h3><h4>Let’s take a look some real examples with scenarios</h4><p>The examples in this doc are built with <a href="https://github.com/salesforce/codeceptjs-bdd">Codeceptjs-BDD</a> framework with Playwright!</p><p><strong>A Complete Example Test</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*iV7LPLv6yaBifFshcbYbJg.png" /></figure><p>As you see in above example, the #searchInput is a scoped element (#shadow-root) but it does not require you to have nested CSS of #shadowRootsto locate the element but it still finds an element!</p><h4>Salesforce’s LWC Page Object, the <strong>Another Example</strong></h4><p>The Salesforce Lighting Web Components (LWC) is another great example of Shadow DOM elements. <a href="https://recipes.lwc.dev/">LWC Recipes</a> is build with LWC. Below is the Page Object on how to query Shadow DOM elements with simple CSS.</p><p>A complete E2E automation Example of <a href="https://recipes.lwc.dev/">Salesforce’s Lighting Web Components Application</a> is available here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*3OpIYq0-kPYesEiQl_StSA.png" /><figcaption>Page Object for LWC Recipes with simplified CSS</figcaption></figure><p><a href="https://github.com/salesforce/codeceptjs-bdd/tree/develop/packages/salesforce-lwc-codecept-example/salesforce-lwc-e2e-playwright">salesforce/codeceptjs-bdd</a></p><p>🎉 The <a href="https://gkushang.github.io/">Codeceptjs-BDD</a> makes it easy to Automate Web Components in any of the below mentioned automation test layers:</p><ul><li><strong>Component Tests</strong></li><li><strong>Integration Tests</strong></li><li><strong>Functional Tests</strong></li><li><strong>E2E Tests</strong></li></ul><p>⭐️ Don’t forget to checkout more docs on <a href="https://gkushang.github.io/">Codeceptjs-BDD framework WebSite</a> and the CodeceptJS <a href="https://codecept.io/">library</a> for great additional features🌈!</p><p>Thanks for reading, I hope you discovered something new and useful. Stay curious, and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b23016779ce8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BDD in 3 Minutes]]></title>
            <link>https://medium.com/salesforce-engineering/bdd-in-3-minutes-c3f8fc022237?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3f8fc022237</guid>
            <category><![CDATA[uiautomation]]></category>
            <category><![CDATA[bdd]]></category>
            <category><![CDATA[bdd-in-3-minutes]]></category>
            <category><![CDATA[cucumber]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Thu, 12 Oct 2017 14:38:51 GMT</pubDate>
            <atom:updated>2019-04-30T07:24:25.319Z</atom:updated>
            <content:encoded><![CDATA[<p>When I presented <a href="https://hackernoon.com/tagged/bdd">BDD</a> with UI Automation at <a href="http://www.stpcon.com/"><em>STPCon Fall’17</em></a><em>, </em>Washington DC, one of the audience asked for thoughts on how they should use Behavior Driven Development (BDD). Because we were running out of the assigned time slot for the presentation, I didn’t get a chance to describe my views. So, I thought of writing it down instead.</p><p>My thoughts about BDD is pretty simple. As long as you are creating a shared understanding of how the product should behave and create an executable &amp; living documentation on-the-go —<em> you’re doing BDD.</em></p><p>But, the real question was of more like,</p><p><em>how do we do it?</em> It’s as simple as 3 steps,</p><blockquote><strong>1. Discuss the Behavior:</strong> have <em>3-Amigos to discover the unknowns</em></blockquote><blockquote><strong>2. Document the Behavior:</strong> elaborate the discussions in plain-text Gherkin language with concrete examples, e.g. the .<em>feature files — the living documents</em></blockquote><blockquote><strong>3. Execute the Behavior:</strong> run the a<em>utomation &amp; get early feedback</em></blockquote><h3><strong>1. Discuss the Behavior</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WsxWmjKjBQSGplK5tqbYZA.png" /></figure><blockquote>“The team goes wrong when they start assuming the expected behavior to build the system.”</blockquote><p>It’s about to <em>discuss the behavior of a feature and flush out all the acceptance criteria and edge cases.</em></p><p>BDD is a highly collaborative process where discussion happens to derive the expected behavior with concrete examples. One of the ideas of BDD is not to assume that one person has all the answers, and that’s the idea behind 3 Amigos, usually 30 mins of conversations, and it requires three different disciplines to have that conversations to <em>discover unknowns</em> at an early stage.</p><p>Three disciplines from Business, Solution, and Problem have these conversations, where Product Owner represents the “Business” space, Developers represent the “Solution” and “Test Engineer” represents the “Problem” area.</p><p>Business creates an EPIC. EPIC then breaks down to features, and features to user stories; let’s call it Feature Breaking. 3 Amigos happen at the second stage; Feature Breaking, where three disciplines have the thoughtful conversations about,</p><blockquote>How a feature should behave?</blockquote><blockquote>Can you give us more examples?</blockquote><blockquote>Are there any edge cases?</blockquote><blockquote>All these conversations recorded as Bullet Points. The most important outcome of 3-Amigos is, the Edge cases scenarios are identified in an early phase, unlike in Waterfall. It gives the developers a first chance to take a pause, thought about scenarios before coding and prevent bugs rather than fixing at a later stage.</blockquote><h3>2. Document the Behavior</h3><p>Once the team has the conversations about the feature behavior as 3-amigos, now it’s time to explain the conversations with concrete examples. It’s the process of documenting conversations in Plain Text English like <em>Gherkin</em> syntax — <strong><em>Given When Then (GWT)</em></strong>.</p><p>Often called, Feature files in <a href="https://hackernoon.com/tagged/cucumber">Cucumber</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YywVBQz5zYaxPCqsfQSow.png" /></figure><p>Eventually, the feature files become the essential part of the <strong><em>Product Specifications.</em></strong> These specifications are developed &amp; automated using tools such as Cucumber. These specifications are Living Documentation. Since it also become part of regression suite, they <em>never expire.</em></p><p>These are Living &amp; Executable Documentations.</p><blockquote>Usually, in Agile, we don’t work based on documents like in Waterfall, but we expect to create documents as we progress. The tools like Cucumber helps to create such Product Specifications, the .feature files, which are shareable, executable and living.</blockquote><h3>3. Execute the Behavior</h3><p>Now we have documents defined, and team knows exactly what to develop, what to test and what to automate — this stage is to <em>develop the feature</em>.</p><p>The <em>plain-text-english</em> document will be implemented and automated with tools like <strong><em>Cucumber</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*rwxA3PHOwwIdyo7UiVDjIA.png" /></figure><p>Once development &amp; automation is done, the team executes those plain-text-english documents as part of acceptance-tests suite. If the document comes out <em>GREEN</em>, Accept the Story.</p><blockquote>The Documents (feature files) become essential part of the Product as they are executable, living and most importantly — they reflect the product behavior.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3f8fc022237" width="1" height="1" alt=""><hr><p><a href="https://medium.com/salesforce-engineering/bdd-in-3-minutes-c3f8fc022237">BDD in 3 Minutes</a> was originally published in <a href="https://medium.com/salesforce-engineering">Salesforce Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Verify but do not Assert]]></title>
            <link>https://gkushang.medium.com/verify-but-do-not-assert-8003ce7b2d68?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/8003ce7b2d68</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[automation-testing]]></category>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Fri, 26 May 2017 02:15:04 GMT</pubDate>
            <atom:updated>2017-05-26T02:31:29.271Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong><em>Assert Collector: Optimize bug-find rate, Regress Less and Execute Fast</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6htB8WC-cjhfjX4uGiT0w.png" /></figure><p>Do you have late regressions? What if your regression finds more bugs from a single run? Assert Collector does it.</p><p>Checkout <a href="https://github.com/gkushang/assert-collector">https://github.com/gkushang/assert-collector</a>.</p><p>Traditional Assertions exit from your scenario when it finds the first bug, but Assert Collector does not. It finds a bug and continues to find more bugs. The best use cases are the verifications of UI &amp; JSON Objects!</p><p>Assert Collector is built on top of <a href="https://github.com/gkushang/assert-collector/blob/master/%5Bhamcrest-matchers">Hamcrest Matchers</a> interface.</p><p>Please see <a href="https://github.com/gkushang/assert-collector/blob/master/src/test/java/assertcollector/AssertCollectorTest.java#L32-L86">the detailed example test-case</a> for more info.</p><p><strong>Step 1: </strong>Import AssertCollectorto your workspace. Use veirfyThat in-place of assertThat. The rest of the interface is Hamcrest.</p><pre><br>verifyThat( &quot;Firstname is invalid&quot;, something.getFirstname(), is( &quot;validFirstname&quot; ) );<br></pre><p><strong>Step 2:</strong> throwAnyFailures will throw all the failures at once, if there were any. Use it whenever required.</p><pre><br>verifyThat( &quot;Firstname is invalid&quot;, something.getFirstname(), is(       &quot;validFirstname&quot; ) );</pre><pre>verifyThat( &quot;Lastname is invalid&quot;, something.getLastname(), is( &quot;invalidLastname&quot; ) );</pre><pre>verifyThat( &quot;Username is invalid&quot;, something.getUsername(), is( &quot;invalidUsername&quot; ) );<br>    <br>throwAnyFailures(); // will throw two failures from above<br></pre><p><strong>Step 3:</strong> Put throwAnyFailures in @After hook. All remaining failures will be thrown by After hook, if there were any.</p><pre><br>@After<br>public void tearDown()<br>{<br>    ...<br>    ...<br>    <br>    throwAnyFailures();<br>}<br></pre><p>Happy Testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8003ce7b2d68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speed up your Cucumber.js acceptance tests]]></title>
            <link>https://gkushang.medium.com/speed-up-your-cucumber-js-acceptance-tests-85f6ef704857?source=rss-ce86d58c009------2</link>
            <guid isPermaLink="false">https://medium.com/p/85f6ef704857</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[cucumber]]></category>
            <dc:creator><![CDATA[Kushang Gajjar]]></dc:creator>
            <pubDate>Mon, 06 Mar 2017 02:49:02 GMT</pubDate>
            <atom:updated>2017-03-06T02:56:55.767Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>At PayPal, long-running cucumber.js scenarios prevented our team from adopting the Continuous Integration/Deployments (CI/CD) pipeline model. Our release took a whole day. There weren’t any module available to run cucumber.js scenarios in parallel until published the cucumber-parallel module which optimized the execution time by 80%.</blockquote><p>After we moved from Java to NodeJs at PayPal, we did not have full capabilities of test automation as in Java. We have been working with Cucumber at PayPal for five years, and we lost the Maven Surefire capability of running Cucumber tests in Parallel when we moved to Node. There were some reasons why it was not fully capable. One of the reasons was an early phase of CucumberJs. It was still evolving in 2015, and there weren’t any module that runs CucumberJs scenarios in parallel.</p><p>Our regression suite had approximately 100 UI facing Cucumber scenarios. It took three hours to complete the execution in serial. We could bring down the execution time to approximately ten minutes, the longest running scenario, if we can run them in parallel.</p><p>At PayPal, we were moving towards Continous Integration/Deployments (CI/CD). Long-running acceptance tests prevented our team from adopting the CI/CD pipeline model. Our release took a whole day. To decrease the execution time, I wrote the <a href="https://www.npmjs.com/package/cucumber-parallel">cucumber-parallel</a> module to run CucumberJs Scenarios in parallel.</p><p>Before I started writing the module, I had to become familiar with the internals of Cucumber.js to understand how it filters and runs the scenarios. I found an option to run a scenario through <em>feature:lineNumber</em> which can be passed to each concurrent threads. After a few days of work, I was able to run cucumber scenarios in parallel.</p><p>But wait.. the results were not as expected. Each thread produces it’s own JSON result because it runs each independent scenario; therefore 50 scenarios would produce 50 single result files. I wanted consolidated results at the end of the execution. After some thought, one solution was to throw JSON results from each thread to the main console and read the console at the end to generate one JSON result — which finally produced one single JSON result file!</p><p>Finally, I had a Cucumber-Parallel module which was first published in Feb 2016. It reduced our execution time from ~3 hours to only ~10 minutes and unblocked our CI/CD initiative.</p><p>More details on how to use the cucumber-parallel module are available <a href="https://www.npmjs.com/package/cucumber-parallel">here</a>.</p><p>Ref: <a href="https://www.npmjs.com/package/cucumber-parallel">https://www.npmjs.com/package/cucumber-parallel</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85f6ef704857" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>