<?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>Forem: Giannis Avgeros</title>
    <description>The latest articles on Forem by Giannis Avgeros (@gavgeros).</description>
    <link>https://forem.com/gavgeros</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%2F3240006%2Fbe0e15cb-4189-419b-b676-3528cd279fa3.jpg</url>
      <title>Forem: Giannis Avgeros</title>
      <link>https://forem.com/gavgeros</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gavgeros"/>
    <language>en</language>
    <item>
      <title>How to Build a Reusable E2E Playwright Framework with TypeScript – Fast Setup + Real User Flow</title>
      <dc:creator>Giannis Avgeros</dc:creator>
      <pubDate>Mon, 02 Jun 2025 20:04:47 +0000</pubDate>
      <link>https://forem.com/gavgeros/how-to-build-a-reusable-e2e-playwright-framework-with-typescript-fast-setup-real-user-flow-1o4m</link>
      <guid>https://forem.com/gavgeros/how-to-build-a-reusable-e2e-playwright-framework-with-typescript-fast-setup-real-user-flow-1o4m</guid>
      <description>&lt;p&gt;As a QA Automation Engineer, I’ve worked with different frameworks and tools, but Playwright quickly became one of my favorites — especially when paired with TypeScript. So I decided to build a reusable Playwright Automation Starter Kit that new testers and developers can pick up and run with immediately.&lt;/p&gt;

&lt;p&gt;This article shares the structure, tools, and logic behind the framework. At the end, you’ll also find a link to a complete, ready-to-run version for anyone who wants to skip setup and go straight into testing.&lt;/p&gt;

&lt;p&gt;🏠 Project Goal&lt;br&gt;
Create a minimal, clean and modular Playwright framework that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Covers a full E2E user flow: Sign Up → Login → Profile Update&lt;/li&gt;
&lt;li&gt;Uses TypeScript + Playwright Test Runner&lt;/li&gt;
&lt;li&gt;Implements the Page Object Model (POM) structure&lt;/li&gt;
&lt;li&gt;Records test videos and produces HTML + JSON reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔧 Technologies Used&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Playwright&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;@playwright/test&lt;/li&gt;
&lt;li&gt;Page Object Model pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔮 BasePage Utility&lt;br&gt;
All common methods like clickElement, typeText, verifyElementVisible, selectDropdownByValue, etc. are inside BasePage.ts.&lt;br&gt;
This makes every page class clean and focused only on selectors.&lt;/p&gt;

&lt;p&gt;✅ What the Test Covers&lt;br&gt;
The main test file user-flow.spec.ts simulates a full user journey:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign Up&lt;/li&gt;
&lt;li&gt;Login&lt;/li&gt;
&lt;li&gt;Update Profile&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each step includes proper assertions and uses Header navigation and User model data.&lt;/p&gt;

&lt;p&gt;🎞️ Sample Code Snippet&lt;br&gt;
// user-flow.spec.ts&lt;br&gt;
await header.goToSignup();&lt;br&gt;
await signupPage.fillAndSubmitSignupForm(user);&lt;br&gt;
await signupPage.verifySignupSuccess();&lt;/p&gt;

&lt;p&gt;await loginPage.login(user);&lt;br&gt;
await loginPage.verifyLoginSuccess();&lt;/p&gt;

&lt;p&gt;await header.goToProfile();&lt;br&gt;
await profilePage.updateProfile(updatedUser);&lt;br&gt;
await profilePage.verifyProfileUpdateSuccess();&lt;/p&gt;

&lt;p&gt;🎥 Bonus: Test Reports + Video&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML report: npx playwright show-report&lt;/li&gt;
&lt;li&gt;Video recording for each run: stored in test-results folder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🎯 Who It’s For&lt;br&gt;
This is perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Junior QA Engineers&lt;/li&gt;
&lt;li&gt;Bootcamp grads&lt;/li&gt;
&lt;li&gt;Developers who want to explore automation without boilerplate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💸 Want to Skip Setup?&lt;br&gt;
If you want a plug-and-play version with everything ready:&lt;br&gt;
✨ Download the full Playwright Starter Kit here:&lt;a href="https://gavgeros.gumroad.com/l/mqxkzx" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It includes the working code, reusable utilities, config files, test video, and HTML report.&lt;/p&gt;

&lt;p&gt;🚀 Just unzip → install → run tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;npm install playwright&lt;/li&gt;
&lt;li&gt;npm install @playwright/test --save-dev&lt;/li&gt;
&lt;li&gt;npx playwright install&lt;/li&gt;
&lt;li&gt;npm install typescript ts-node @types/node --save-dev&lt;/li&gt;
&lt;li&gt;npx playwright test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add --headed if you want to see the UI during execution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;npx playwright test --headed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to fork, improve, or ask questions below. Hope it helps others jumpstart their automation journey!&lt;/p&gt;

</description>
      <category>learning</category>
      <category>typescript</category>
      <category>automation</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
