From Meetup to Mastering Playwright: My Takeaways from Sri Lanka Developer Forum – July Meetup at TIQRI 🚀

 

Last Thursday, I had the amazing opportunity to attend the Sri Lanka Developer Forum (SLDF) – July Meetup hosted at the stunning TIQRI office. As someone who’s been following SLDF for a while, this was my first time attending in person, and it truly exceeded expectations! 🙌

This blog post isn’t just about the event. it’s also about the super cool tool I discovered for the first time: Playwright.


🌟 Event Highlights

The meetup brought together developers from across the country for an evening full of knowledge sharing, tech discussions, and inspiration. Huge appreciation to the SLDF organizing team:

👉 Abishek HaththakageFiqri Ismail, Nikila Fernando, Milinda Shehan, Samiru Hemaka, Minuli Samaraweera, and Sachini Ariyarathne you all did a phenomenal job!

🎤 Session Takeaways



The event featured insightful sessions from:

  • Thilina Gunarathna
  • Devendri Sarathchandra
  • Isuri Nakandala

Each talk had something valuable, but what really stuck with me was the session that introduced Playwright, a modern end-to-end testing framework that changed how I see browser automation. 🤯


🧪 What is Playwright?

Playwright is an open-source end-to-end testing framework developed by Microsoft that allows developers to automate browser actions for testing web apps.

It supports:
Multiple browsers: Chromium, Firefox, and WebKit
Multiple languages: JavaScript, TypeScript, Python, C#, and Java
Headless & headful modes
✅ Mobile and desktop browser emulation
✅ Auto-waiting, screenshots, videos, and more!


🆚 Playwright vs Selenium

FeaturePlaywrightSelenium
Browser SupportChromium, Firefox, WebKit (built-in)Chrome, Firefox, Safari, Edge
Language SupportJS, TS, Python, C#, JavaAll major languages
Auto-Waiting✅ Built-in❌ Manual waits often needed
Headless Mode✅ Yes✅ Yes
Mobile Emulation✅ Yes⚠️ Requires setup
Parallel Execution✅ Built-in with test runner⚠️ Requires extra setup
Test Recorder✅ Built-in GUI recorder❌ Limited or external tools
Installation Ease✅ One-liner❌ Often complex

Conclusion: If you’re starting a new project or want a faster, modern testing setup, Playwright is a game-changer.

💻 How to Install Playwright

Getting started is super simple. You’ll need Node.js installed on your system.

npm init -y npm install -D playwright npx playwright install


You can also install the Playwright Test runner:

npm install -D @playwright/test


🚀 Getting Started with a Simple Test

Here's a basic test that opens a browser, navigates to a page, and checks the title:

// example.spec.js
const { test, expect } = require('@playwright/test'); test('basic page title test', async ({ page }) => { await page.goto('https://example.com'); await expect(page).toHaveTitle(/Example Domain/); });


Run it using:

npx playwright test


It automatically launches the browser, runs your script, and gives test results. You can also run it in headed (visible) mode using:

npx playwright test --headed


🔍 Cool Capabilities of Playwright

Here’s why Playwright stands out:

✅ Auto-Waiting

No more sleep() or waiting for elements—Playwright waits for actions to complete.

📸 Screenshots & Video

Capture screenshots or record test sessions for debugging:

await page.screenshot({ path: 'screenshot.png' });


🔐 Authentication State

Save login sessions to reuse across tests.

📲 Mobile Emulation

Simulate mobile devices like iPhone 13 with:

const { devices } = require('@playwright/test');
const iPhone = devices['iPhone 13'];


🧪 Component Testing

Playwright can now test individual UI components (like React components) in isolation.

🧬 API Testing

You can even test APIs along with your UI tests!

const response = await page.request.post('/api/login', { data: { user, pass } });


⚙️ Advanced Use Cases

  1. Parallel testing with isolated workers
  2. CI/CD integrations with GitHub Actions, Azure DevOps, etc.
  3. Test retries and smart reporting
  4. Custom reporters, like HTML or Allure
  5. Codegen tool: Record your actions into Playwright code via:
npx playwright codegen https://example.com


It generates code as you click through the site. extremely helpful for beginners!

💡 Final Thoughts

Discovering Playwright during the SLDF July Meetup completely changed how I think about testing in modern web development. It’s fast, reliable, and just fun to use.

Events like this remind me why being part of the Sri Lankan developer community is so rewarding. you walk in expecting a meetup, and walk out with powerful new skills and inspiration.

So, if you haven’t yet, give Playwright a try  and definitely join the next SLDF event. You never know what you might learn. 🔥

👉 Have any questions or want a full Playwright setup tutorial? Let me know in the comments or message me! 😊

Induwara Uthsara

Post a Comment

Previous Post Next Post