What is Playwright in automation? Playwright is a Node. js library to automate Chromium, Firefox, and WebKit with a single API
Playwright can
Cross-browser. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox.
Cross-platform. Test on Windows, Linux, and macOS, locally or on CI, headless or headed.
Cross-language. Use the Playwright API in TypeScript, JavaScript, Python, .NET, Java.
Test Mobile Web. Native mobile emulation of Google Chrome for Android and Mobile Safari. The same rendering engine works on your Desktop and in the Cloud.
Auto-wait. Playwright waits for elements to be actionable prior to performing actions. It also has a rich set of introspection events. The combination of the two eliminates the need for artificial timeouts - the primary cause of flaky tests.
Web-first assertions. Playwright assertions are created specifically for the dynamic web. Checks are automatically retried until the necessary conditions are met.
Tracing. Configure test retry strategy, capture execution trace, videos, screenshots to eliminate flakes.
Also
Playwright comes with HTML report below
Tools I used in this project
Playwright
IDE: Visual Studio Code.
Progreammin Language: Java Script.
Automation Framework: Page object model.
About The project
The single-window system or single-window concept is a trade facilitation concept which allows an international (cross-border)trader to submit information to a single agency, rather than having to deal with multiple agencies in multiple locations to obtain the necessary papers, permits, and clearances to complete their import or export processes. There is an obvious time saving benefit to the single window system. The concept is recognised by organisations such as the United Nations Economic Commission for Europe (UNECE) and its Centre for Trade Facilitation and Electronic Business, World Customs Organization (WCO), the United Nations Network of Experts for Paperless Trade and Transport in Asia and the Pacific and the Association of Southeast Asian Nations (ASEAN).
Visual Testig
Part of the project there will be visual testing, below are the full definistion of it
What is Visual Testing? Visual testing, a method of software testing, evaluates the visual fidelity of your user interface (UI) or graphical user interface (GUI). Visual tests tackle the look of your application and help you capture defects that other types of tests might miss.
Why I implement visual testing
Visual testing captures defects that other types of UI tests cannot, for example there are limitation of functional are:
• Pixel-by-pixel differences
• Alignment shifts
• Page layout
• Rendering problems
• Element overlap
• Responsive layout
• Font differences
• Color differences
Visual comparisons In Playwright
Playwright Test includes the ability to produce and visually compare screenshots using await expect(page).toHaveScreenshot(). On first execution, Playwright test will generate reference screenshots. Subsequent runs will compare against the reference.
How Visual testing or visual regression testing works
• Drive the application under test (AUT) and take a screenshot
• Compare the screenshot with an initial “baseline” image
• Report the differences
• Update the baseline as needed
My opinion
There is a limitation in the Playwright dealing with UI controls specifically in case of multi layers application for instance, my application Angular integrated with IBM portal some of the UI element get clicked for first time . and second time it will not even if you increase the wait time, this issue I never faced with Selenium. The unique feature of the Playwright tool is the speed of execution compare to others.