From cf5919748a123515207ecf91d4b828288825bb94 Mon Sep 17 00:00:00 2001 From: priy-tech Date: Thu, 9 Apr 2026 00:15:05 +0530 Subject: [PATCH 1/3] Created base_page for common reusable methods for Playwright framework --- src/pages/base_page.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/pages/base_page.py diff --git a/src/pages/base_page.py b/src/pages/base_page.py new file mode 100644 index 000000000..89e5ad1c3 --- /dev/null +++ b/src/pages/base_page.py @@ -0,0 +1,39 @@ +from playwright.sync_api import Page, expect + + +class BasePage: + """ + BasePage provides common Playwright actions + that can be reused across all Page Objects. + """ + + def __init__(self, page: Page): + self.page = page + + def open(self, url: str) -> None: + """Navigate to a given URL""" + self.page.goto(url) + + def click(self, locator: str) -> None: + """Click on a web element""" + self.page.locator(locator).click() + + def fill(self, locator: str, value: str) -> None: + """Fill input field with value""" + self.page.locator(locator).fill(value) + + def get_text(self, locator: str) -> str: + """Return text of an element""" + return self.page.locator(locator).inner_text() + + def is_visible(self, locator: str) -> bool: + """Check if element is visible""" + return self.page.locator(locator).is_visible() + + def wait_for(self, locator: str) -> None: + """Wait until element is visible""" + self.page.locator(locator).wait_for() + + def assert_text(self, locator: str, expected_text: str) -> None: + """Assert exact text of an element""" + expect(self.page.locator(locator)).to_have_text(expected_text) \ No newline at end of file From 756cd81f6827060473d1510bd6c668608eb3346e Mon Sep 17 00:00:00 2001 From: priy-tech Date: Thu, 9 Apr 2026 00:27:59 +0530 Subject: [PATCH 2/3] Created base_page for common reusable methods for Playwright framework --- src/pages/base_page.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/base_page.py b/src/pages/base_page.py index 89e5ad1c3..3aafa8e14 100644 --- a/src/pages/base_page.py +++ b/src/pages/base_page.py @@ -1,3 +1,5 @@ +# BasePage for Playwright reusable actions + from playwright.sync_api import Page, expect From cc40b9c7c8a4699c877a3b97f0741f9a6e9ade36 Mon Sep 17 00:00:00 2001 From: Priyadarshini Pradhan <153224258+priy-tech@users.noreply.github.com> Date: Thu, 9 Apr 2026 00:48:00 +0530 Subject: [PATCH 3/3] Updated README with framework enhancements --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 08995a79b..11af54157 100644 --- a/README.md +++ b/README.md @@ -155,4 +155,11 @@ If this architecture helped you solve a problem or save time, consider supportin [Visit TestShift.com for more Architectural Insights](https://www.test-shift.com) - \ No newline at end of file + + + +## Enhancements by Me + +- Added a `BasePage` to centralize reusable Playwright browser actions such as click and fill. +- Improved framework maintainability by following the Page Object Model design pattern. +- Extended the framework structure to support scalable test development.