<?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 Anujay Kumar on Medium]]></title>
        <description><![CDATA[Stories by Anujay Kumar on Medium]]></description>
        <link>https://medium.com/@kumaranujay?source=rss-294b78a3df23------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*KJud6DSjnf3pW0R4BdMiqQ.png</url>
            <title>Stories by Anujay Kumar on Medium</title>
            <link>https://medium.com/@kumaranujay?source=rss-294b78a3df23------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:07:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kumaranujay/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[CodeCove CI, the cover for your  app]]></title>
            <link>https://medium.com/@kumaranujay/codecove-ci-the-cover-for-your-app-bb4f3a2b7911?source=rss-294b78a3df23------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb4f3a2b7911</guid>
            <category><![CDATA[codecov]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Anujay Kumar]]></dc:creator>
            <pubDate>Tue, 07 Jul 2020 12:27:21 GMT</pubDate>
            <atom:updated>2020-07-08T05:48:46.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KoVCpPm7uO2dVEfNLBYhOw.png" /></figure><h3>What is Codecove CI and how to configure it with the node environment?</h3><p>I was looking for something to read and learn more about the configuration of <a href="https://codecov.io/">codecov</a> for my <a href="https://reactjs.org/">react</a> based app which runs on node env. But I could not find anything good to start. I read the <a href="https://docs.codecov.io/docs">codecov doc</a> and then realized why the open-source community is actively adopting it.</p><p>Here I will try to describe the focusing points that codecov brought in my project.</p><p>On a High level. Codecov is a configuration based measurement, which monitors all the test suits and publishes the coverage reports (like <a href="https://istanbul.js.org/">Istanbul</a> does for us) for the dashboard.</p><p>Since its total configuration based, so you can prepare your <strong><em>yml</em></strong> file to instruct the GitHub checks to bring the codecov in the role to read it and perform the instructions to pass the checks such as:-</p><ul><li>How much drop is allowed in push</li><li>Range to mark the health</li><li>Monitor the delta</li><li>Since it has support for <a href="https://docs.codecov.io/docs/supported-languages">other languages </a>so it can be configured to run the test for dependent projects (alias FE/ BE / Python) in parallel</li></ul><p>It&#39;s a great tool to monitor or manage our shared services /components. If we are on microservices or micro frontends then it can be really valuable to keep watch on our services and components. It keeps a watch on your every push (configurable), push/merge, and publishes report to its dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*fz6POAVZ9NeyMhcjSiAlgg.png" /></figure><h4>It will prepare an insights for file/line based report.</h4><h4>My Use Case</h4><p>I have an application which works on 3 layer</p><ol><li><strong>Front End</strong>: Designed in a micro frontend way Written on react and typescript.</li></ol><p>2. <strong>Implementation Layer</strong>: REST API on python, which consumes the BE services and serves as a data source for FE</p><p>3. <strong>BE Microservices</strong>: Microservices has written in python,</p><p>FE (components and business component-based) and BE are heavily shared across other implementation layers of the same and different projects. So touching one part can also make an unwanted impact on another part of the applications or other projects.</p><p>To manage the above use case the best possible way is to write <strong><em>as much unit test as we can</em></strong> to cover the expected behavior for the chunks, and that can be done by adopting any of the testing utility from our testing ecosystem. But the challenge is to monitor and control its version when either our application is too large and distributed or we have too many contributors. Now here codecov can play the role for version control and for the monitoring.</p><p>With every PUSH/PR/ build, it gets invoked and starts scanning all the scripts for the written test cases. (on all the project at once to provide concise reports on the dashboard).</p><h4>Configuring CodeCov in my project.</h4><p>Here I am configuring my codecov to run as a GitHub checks.</p><p>prepare <strong>.codecov.yml</strong> in the root of your codebase eg. <a href="https://github.com/amoebageek/circleci-test">code </a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b893048b75a7f1816b384a3ee0cff3a/href">https://medium.com/media/0b893048b75a7f1816b384a3ee0cff3a/href</a></iframe><p>here I have prepared my script to run only for 1 project with a target to have a minimum of 70% coverage, which can allow a 30% drop (compared to base branch can be configured) to pass the checks. You can provide more <a href="https://docs.codecov.io/docs/codecov-yaml">sets of configurations</a>.</p><p><em>The most import part which I found to make the changes reflect for your project, </em><strong><em>make sure your </em></strong><a href="https://docs.codecov.io/docs/codecov-yaml#validate-your-repository-yaml"><strong><em>YML is a valid one</em></strong></a><em>, else your changes will not be included (You can also validate your YAML through </em><a href="https://www.postman.com/"><em>postman</em></a><em>)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JDY8RVud3Y3q1BTZgsLpNg.png" /></figure><p>and that&#39;s it, push your code to GitHub and GitHub will take care of rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*DATBqdh7J66_fTvURw_LLA.png" /></figure><p>Check the higher-level report on Github checks runner details.</p><p>You can also <strong>strict merging</strong> by disabling the merge button.</p><p><em>settings &gt; branchs&gt; branch</em>, and enable checks for the scrips you want it required for the merge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*zETGFS8ks0sRWeQisBI-aA.png" /></figure><p>Codecov is getting adopted so widely, and it also has integration support with other CI tools eg. <a href="https://travis-ci.org/">tarvis</a>, <a href="https://circleci.com/">circle</a>, etc.</p><p>That was all about onboarding codecov in our project, as simple way as it can be.</p><p>For me not only for open source projects but also for enterprise projects codecov can play a very important role in terms of monitoring and validating distributed components of our application.</p><p>Github repo for above code: <a href="https://github.com/amoebageek/circleci-test">https://github.com/amoebageek/circleci-test</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb4f3a2b7911" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write E2E testing with cypress]]></title>
            <link>https://medium.com/@kumaranujay/how-to-write-e2e-testing-with-cypress-2f4a792bdc57?source=rss-294b78a3df23------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f4a792bdc57</guid>
            <category><![CDATA[e2e-testing]]></category>
            <category><![CDATA[regression-testing]]></category>
            <category><![CDATA[cypress]]></category>
            <dc:creator><![CDATA[Anujay Kumar]]></dc:creator>
            <pubDate>Sat, 18 Jan 2020 19:10:16 GMT</pubDate>
            <atom:updated>2020-01-18T19:28:10.213Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*4uxtMazec-lxj49RzdL6AQ.jpeg" /></figure><h3>Why cypress?</h3><p>Define instruction for cypress and just watch it working on your behalf, yes that&#39;s correct. Now you must be thinking what&#39;s new in this? This is expected and how other E2E frameworks work.</p><p>Actually, as a javascript, jQuery, UT writer, I never knew something like this exists which is that simple which needs</p><ol><li>0 configurations</li><li>0 prerequisites to start</li><li>Keep watch on the network call and callback()</li><li>It can wait for a network call to end before executing the next test case. (No more assumed delay or wait)</li><li>Give the privilege to write UT (written on top of mocha ) as well.</li><li>Run-on actual test environment without being dependent on mock.</li><li>API testing</li><li>Test API and functionality parallelly (no more API mocking is required).</li><li>Powerfull support for capturing videos and snapshots.</li><li>… and many more to explore and try.</li></ol><p>Here I will explain to you how to start with cypress and <strong><em>how to write your first E2E test suit</em></strong>.</p><p>Configuring cypress in your work machine.</p><blockquote>npm init</blockquote><p>prepare package.json</p><blockquote>npm i cypress --save</blockquote><p><a href="https://github.com/amoebageek/e2e-testing-cypress/blob/21cdb0dda6f2ac969e8f9c902bf04cd0a01b5d46/package.json#L8">configure script</a> to run your cypress and open in chrome headless</p><blockquote>cypress open</blockquote><p>That’s it, yes! Rest cypress will it self help you to proceed ahead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*2sE3848p5SWiROq4Prfrhw.png" /></figure><p>cypress will seed all possible things that you may need in writing your test cases.</p><p>Refer the file whatever case you need to cover eg. API testing, API.spec, etc.</p><h3><strong>Example Test Case</strong></h3><p><strong>Given</strong>: Visit given URL, authenticate (basic auth), wait for the login page to appear, do a login request and on Authenticate redirect on the home page and wait for all the locales (country locale) list to be fetched from API.</p><blockquote>Stub your test data in <a href="https://github.com/amoebageek/e2e-testing-cypress/tree/master/cypress/fixtures">fixture directory</a></blockquote><p>Get the stub data to the context of your suit.</p><blockquote>cy.fixture(“fileNameInFixtureDirectory”).as(“alias”)</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/edfc92ac0276180894a37e8f215b70ef/href">https://medium.com/media/edfc92ac0276180894a37e8f215b70ef/href</a></iframe><p>Visit the given URL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d3e08b87b065f5ac8fd6b9455707196/href">https://medium.com/media/3d3e08b87b065f5ac8fd6b9455707196/href</a></iframe><p>Find the element and do login</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4991fae0e6a400552ece3ae36264ea27/href">https://medium.com/media/4991fae0e6a400552ece3ae36264ea27/href</a></iframe><p>Watch for the triggered login API and wait for its final state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/655bb0e4dee79748f2d92423f53eeba1/href">https://medium.com/media/655bb0e4dee79748f2d92423f53eeba1/href</a></iframe><p>On login done, check for the expected redirected page</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89c170f1793ebd288afebc42ff5073a6/href">https://medium.com/media/89c170f1793ebd288afebc42ff5073a6/href</a></iframe><p>Watch for the triggered API to fetch locales list</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc366b692a02c7c1c2d40288dee4a6d0/href">https://medium.com/media/cc366b692a02c7c1c2d40288dee4a6d0/href</a></iframe><p>Consume the shared state and validate the API response vs expected elements behaviour</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d40420afde64c9b92553fbacb6ec593/href">https://medium.com/media/9d40420afde64c9b92553fbacb6ec593/href</a></iframe><p>And this is done !!</p><p>Cypress is a <a href="https://docs.cypress.io/guides/references/bundled-tools.html#Mocha">bundle of tools</a>, which makes it very powerful and one-stop for all.</p><p><em>I personally think, because of its power to test flow with actual data from API response (without mock), it makes the regression results more accurate and realistic.</em></p><p><a href="https://github.com/amoebageek/e2e-testing-cypress"><strong>Source Code</strong></a></p><h3>Reference :</h3><p><a href="https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell">Cypress official documentation </a>is very much clear to understand for the beginners and parallel you already have the working example seeded in your workspace by cypress.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f4a792bdc57" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>