<?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 godwinsaji-j on Medium]]></title>
        <description><![CDATA[Stories by godwinsaji-j on Medium]]></description>
        <link>https://medium.com/@godwinsaji.j?source=rss-ef4697d0df91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TWVRPf3qLluJe4vw</url>
            <title>Stories by godwinsaji-j on Medium</title>
            <link>https://medium.com/@godwinsaji.j?source=rss-ef4697d0df91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 04:19:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@godwinsaji.j/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[Playwright Series [Node.JS] [1](Setup & First Run)]]></title>
            <link>https://medium.com/@godwinsaji.j/playwright-series-node-js-setup-first-run-ef94c27e6de6?source=rss-ef4697d0df91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef94c27e6de6</guid>
            <category><![CDATA[playwright-test]]></category>
            <dc:creator><![CDATA[godwinsaji-j]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 06:35:40 GMT</pubDate>
            <atom:updated>2025-11-15T06:36:14.940Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pre-requisites</h3><ol><li><em>Node.JS</em></li><li><em>VS Code</em></li></ol><h3>Installation</h3><p>Run the below command to start playwright installation. You will get a couple of questions</p><pre>#https://playwright.dev/docs/intro<br>npm init playwright@latest</pre><h4>Question 1</h4><p>Choose your base language. I am going with JS</p><pre>? Do you want to use TypeScript or JavaScript? ...<br>  TypeScript<br>&gt; JavaScript</pre><h4><strong>Question 2</strong></h4><p>√ Where to put your end-to-end tests? · tests (this creates a sample spec or test file under tests folder</p><pre>√ Where to put your end-to-end tests? · tests</pre><h4>Question 3</h4><p>? Add a GitHub Actions workflow? (Y/n) » true (enable if you want to do ci/cd with GitHub.</p><pre>? Add a GitHub Actions workflow? (Y/n) » true</pre><h4>Question 4</h4><p>Answer Y if you opt to download and use playwright’s browser collection. I’m opting out because I’m planning to use the existing chrome on my machine</p><pre>√ Install Playwright browsers (can be done manually via &#39;npx playwright install&#39;)? (Y/n) · false</pre><p>once successfully installed, you will see the commonly used playwright commands displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*RImEXYRi-vQKrXu_QVBARA.png" /></figure><pre>Inside that directory, you can run several commands:<br><br>  npx playwright test<br>    Runs the end-to-end tests.<br><br>  npx playwright test --ui<br>    Starts the interactive UI mode.<br><br>  npx playwright test --project=chromium<br>    Runs the tests only on Desktop Chrome.<br><br>  npx playwright test example<br>    Runs the tests in a specific file.<br><br>  npx playwright test --debug<br>    Runs the tests in debug mode.<br><br>  npx playwright codegen<br>    Auto generate tests with Codegen.<br><br>We suggest that you begin by typing:<br><br>    npx playwright test<br><br>And check out the following files:<br>  - .\tests\example.spec.js - Example end-to-end test<br>  - .\playwright.config.js - Playwright Test configuration<br><br>Visit https://playwright.dev/docs/intro for more information. ✨<br><br>Happy hacking! 🎭</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*JT0KOSS0DlTjTW-C856RAg.png" /><figcaption>Folder View Post Successful Installation</figcaption></figure><h4>Final Step</h4><ol><li>Open playwright.config.js</li><li>Set headless to false (by default its true)</li><li>Navigate to projects section and add channel:”chrome” (this is to point your test run to local /pre-installed chrome instead of using playwright provided one.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*cFvchiFG7e5dWvdQ7D9B0A.png" /><figcaption>editing config (headless:false and channel:chrom</figcaption></figure><h3>Run Your First Test</h3><p>This runs the default test case under tests folder. You should see it navigating to playwright.dev.</p><pre>npx playwright test</pre><h4>Running in interactive mode</h4><p>rathe than using cmd , playwright provides a user interface, you can launh it by typing “npx playwright test — ui” (2 hyphens). This Opens a window as show below.</p><pre> npx playwright test --ui</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tL-Jm2YD4NWqxR59YPEtA.png" /><figcaption>Playwright interactive mode</figcaption></figure><p>This captures timeline, network logs, code and much more</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MhuaV--0LWe9ZHqpS9VOuQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef94c27e6de6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing VPS with cloudflare — Part 1]]></title>
            <link>https://medium.com/@godwinsaji.j/securing-vps-with-cloudflare-part-1-9fc15d7be3af?source=rss-ef4697d0df91------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fc15d7be3af</guid>
            <category><![CDATA[vps]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[godwinsaji-j]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 18:38:03 GMT</pubDate>
            <atom:updated>2026-01-25T14:52:01.906Z</atom:updated>
            <content:encoded><![CDATA[<h3>Securing VPS with cloudflare — Part 1</h3><h3>Phase -1</h3><h4>Update to latest patch</h4><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><h4>Lets upgrade ssh from rsa to ed25519</h4><p>Lets first check if existing key is rsa based, execute the below command and if key starts with ssh-rsa means its in rsa.</p><pre>cat ~/.ssh/authorized_keys</pre><p>rsa is now considered legacy and we have to new standard ed25519. if your old key is ssh, lets get it upgraded to ed25519 by generating a new key like (-C is comments).</p><pre>ssh-keygen -t ed25519 -C &quot;godwin@ed25519&quot;</pre><p>It will also ask for location, by default save will doanload it to users\.ssh\id_ed25519 in windows or ~/.ssh/id_ed25519 in Linux. if required you can provide a default path with file name. in my case i used the same name and now i can see 2 files id_ed25519(private key) and id_ed25519.pub (public key) in the chosen location.</p><ol><li>Open the new .pub file(public key) with notepad and copy the contents.</li><li>SSH into the VPS with old ssh key and execute the below command</li><li>echo “new key contents pasted here……. godwin@ed25519” (godwin@ed25519 is also part of key u copied) &gt;&gt; ~/.ssh/authorized_keys</li><li>This will replace the ssh key file content with new key</li><li>Leave the existing ssh session open just incase something goes wrong.</li><li>Test it by opening a new connection ssh -i new_private_key_file user@ipv4 address //new file means (id_ed25519) not the id_ed25519.pub</li><li>If you are are allowed in without password then ssh is successful.</li></ol><h4>Restrict unwanted access to ssh folder</h4><p>You don’t want anyone else snooping around your .ssh folder — it contains sensitive files like private keys and config.</p><p>.ssh folder -&gt; 700 means user( [i.e you] read+write+execute) groups &amp; others -&gt; no acccess</p><p>authorized_keys file -&gt; 600 means user( [i.e you] read+write) groups &amp; others -&gt; no acccess</p><pre>chmod 700 ~/.ssh<br>chmod 600 ~/.ssh/authorized_keys</pre><h4>Installing UFW (Uncomplicated Firewall)</h4><pre>sudo apt install ufw</pre><h4>Lets allow only SSH</h4><pre>ubuntu@xyz:~$ sudo ufw allow ssh<br>Rules updated<br>Rules updated (v6)<br>ubuntu@xyz:~$</pre><h4>Enable Firewall</h4><pre>ubuntu@xyz:~$ sudo ufw enable<br>Command may disrupt existing ssh connections. Proceed with operation (y|n)? y<br>Firewall is active and enabled on system startup<br>ubuntu@xyz:~$</pre><p>If you know exact port and your public IP Address, you can restrict even better by providing the below command. Then use enable command.</p><pre>sudo ufw allow from YOUR.IP.ADDRESS to any port 22</pre><p>If you are seeing the below message, it means:</p><p><strong>✅ </strong>UFW is active</p><p>✅ Incoming traffic is denied by default</p><p>✅ Outgoing traffic is allowed</p><p>✅ SSH (port 22) is explicitly allowed for both IPv4 and IPv6</p><p>This means your VPS is currently <strong>only accessible via SSH</strong>, and nothing else is exposed to the internet. That’s exactly the posture we want before hardening further.</p><pre>ubuntu@xyz:~$ sudo ufw status verbose<br>Status: active<br>Logging: on (low)<br>Default: deny (incoming), allow (outgoing), disabled (routed)<br>New profiles: skip<br><br>To                         Action      From<br>--                         ------      ----<br>22/tcp                     ALLOW IN    Anywhere<br>22/tcp (v6)                ALLOW IN    Anywhere (v6)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fc15d7be3af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Selenium Test Framework with pytest (PART 1 — UI Automation)]]></title>
            <link>https://medium.com/@godwinsaji.j/python-selenium-test-framework-with-pytest-part-1-ui-automation-b029a34f5dca?source=rss-ef4697d0df91------2</link>
            <guid isPermaLink="false">https://medium.com/p/b029a34f5dca</guid>
            <category><![CDATA[pytest]]></category>
            <category><![CDATA[python-selenium]]></category>
            <category><![CDATA[test-automation-framework]]></category>
            <category><![CDATA[unit-test-framework]]></category>
            <dc:creator><![CDATA[godwinsaji-j]]></dc:creator>
            <pubDate>Sat, 07 Jun 2025 12:05:31 GMT</pubDate>
            <atom:updated>2025-06-07T12:05:31.466Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Selenium Test Framework with pytest</h3><h3>Setting up local env</h3><ol><li>Install Python</li><li>lets install selenium &amp; pytest</li></ol><p>we can install it either by the below command or store in a file called dependencies.txt</p><pre>#to install directly/globally<br>pip install selenium pytest<br>#if using dependencies install it by command<br>pip install -r dependencies.txt<br>#to install to a specific folder for project use the below command<br>pip install --target ./python_modules -r dependencies.txt<br>#if using specific folder as shown above use the below to add it to env variables before run<br>$env:PYTHONPATH=&quot;C:\Users\Dell\Documents\Code\selenium-pytest\python_modules&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7Rd2-GQoKaIw8StD_kyZQ.png" /><figcaption>result of pip install — target ./python_modules -r dependencies.txt</figcaption></figure><p>Lets structure our framework to validate all aspects of the application Api, Dbs &amp; UI. We will end up creating a structure similar to this. src contains test source code and test folder contains spec files that manage/group tests.</p><p>When using vscode for better intellisense for modules installed in specific directory, add the directory path to config(.vscode/settings.json).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WB21b-vwtU38XCUQIx_eg.png" /></figure><h3>Adding pytest config file</h3><p>create a file called <strong>conftest.py</strong> to configute pytest hooks &amp; fixtures</p><pre>#import custom installed modules/packages once<br>import sys<br>sys.path.append(&quot;./python_modules&quot;)<br>from selenium import webdriver<br>from selenium.webdriver.chrome.service import Service<br>import pytest<br><br>def pytest_sessionstart(session):<br>    print(&quot;Starting test session...&quot;)<br>    <br>    <br>def pytest_sessionfinish(session, exitstatus):<br>    print(&quot;Test session completed.&quot;)<br><br>@pytest.fixture(scope=&quot;session&quot;)<br>def driver(request):<br>    print(&quot;inside driver:&quot;,request.param)<br>    if(request.param == &quot;chrome&quot;):<br>        print(&quot;Setting up WebDriver...&quot;)<br>        service = Service(&quot;./drivers/chromedriver.exe&quot;)<br>        driver = webdriver.Chrome(executable_path=&quot;./drivers/chromedriver.exe&quot;)<br>        yield driver  # Provide the driver to tests and waits till test completion<br>        print(&quot;Closing WebDriver...&quot;) #after test run the control reaches here<br>        driver.quit()</pre><p><a href="http://twitter.com/pytest">@pytest</a>.fixture(scope=”session”)<br>def driver(request): <br>this is provided to call the driver in spec file</p><p>Lets create a file for home page under <strong>src/ui</strong> and call it <strong>home_page.py</strong> and inside write code to launch homepage</p><pre>import pytest<br>from selenium import webdriver<br>from selenium.webdriver.common.by import By<br>from selenium.webdriver.support.ui import WebDriverWait<br>from selenium.webdriver.support import expected_conditions as EC<br><br>def launchHome(driver):<br>    try:<br>        driver.get(&quot;https://www.goindigo.in/&quot;)<br>        driver.maximize_window()<br>        wait = WebDriverWait(driver, timeout=30, poll_frequency=0.5) #max timeout 10secs and checks every 500ms<br>        wait.until(EC.visibility_of_element_located((By.XPATH,&#39;//a[@title=&quot;Indigo Logo Image&quot;]&#39;)))<br>        driver.save_screenshot(&quot;./test-results/screenshots/01-home-page-loaded.png&quot;)<br>    except Exception as e:<br>        print(f&quot;An exception occurred: {e}&quot;)<br>        <br>def login(driver):<br>    try:<br>        print(&quot;validating login&quot;)<br>        driver.find_element(By.CSS_SELECTOR, &quot;#usernameFirstLetter&quot;).click()<br>        driver.save_screenshot(&quot;./test-results/screenshots/02-login-clicked.png&quot;)<br>    except Exception as e:<br>        print(f&quot;An exception occurred: {e}&quot;)</pre><p>Now lets create a spec file (flow file) which calls all the steps in sequence. This file will call all methods in sequence like launchHome, login,…</p><p>Under test folder create a file called spec.py</p><pre>import pytest<br>from src.ui import home_page<br><br>@pytest.mark.parametrize(&quot;driver&quot;, [&quot;chrome&quot;], indirect=True)  # Pass browser type here<br>def test(driver):<br>    home_page.launchHome(driver)<br>    home_page.login(driver)</pre><p>Also add pytest.ini to add few configration on loglevel,…</p><pre>[pytest]<br>log_cli = true<br>log_cli_level = ERROR</pre><p>We should now have a folder structure like shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lh0Mtzi1oh2eY6o8I0bcHQ.png" /></figure><h3>Let’s execute it</h3><pre>#set or point the modules folder<br>$env:PYTHONPATH=&quot;C:\Users\Dell\Documents\Code\selenium-pytest\python_modules&quot;<br>#to execute it type the below command<br>python -m pytest .\test\spec.py -v</pre><h4>Screenshots</h4><p>01-home-page-loaded.png</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETmsGAoeEDubX74aZ_IlPg.png" /></figure><p>02-login-clicked.png</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3EuiLVeKApaxv6toYE6Tng.png" /></figure><h4>Terminal</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*ZPnROM-cmPlwnKQ7OLm2fw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b029a34f5dca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>