Skip to content

Proof-of-concept for web app testing using Playwright in TypeScript & Python, showcasing CI integration and parameterized testing of multiple locales. 使用 TypeScript 與 Python 的 Playwright 進行網頁應用測試的概念驗證,展示 CI 整合和多語系參數化測試。

Notifications You must be signed in to change notification settings

koynoyno/funnow-ci-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playwright Tests (TypeScript) Playwright Tests (Python)

English | 繁體中文

FunNow Playwright Automation Proof-of-Concept

Description

This proof-of-concept uses Playwright to test the happy path of the booking flow (TypeScript, Python) for every available locale on the FunNow website. It automatically runs on GitHub Actions for each commit and Pull Request (CI/CD) and automatically uploads testing results to a TestRail instance using trcli.

Technologies Used

Getting Started

⚠️ Important to note

To make the system-under-test (SUT) more testable, it is HIGHLY SUGGESTED to implement data-testid attributes. Because the SUT doesn't use data-testid, locators are brittle and unreadable. This makes the automation process unnecessarily complex.

Issues & Tradeoffs

Why Page Objects use assertions?

Although it's not recommended to use assertions inside Page Objects, the behavior of the system-under-test (SUT) can sometimes be unpredictable. Therefore, this proof-of-concept uses assertions inside Page Objects for the sake of simplicity.

Why are booking flow tests flaky?

There's an issue where if a user makes too many bookings using the same time, they will be suddenly redirected to the time selection page instead of the payment page (see screenshot below). In such cases, the website doesn't handle the error that's coming from the API.

image

API error as follows:

{
	"code": 42,
	"message": "This Product Has Been Sold Out."
}

This issue might be resolved with proper teardown, where bookings made are removed from the database. However, I didn't have access to the database while implementing this proof-of-concept.

Several issues were found during testing.

Some of them are easily verifiable, so they were implemented in the bugs.spec.ts / test_bugs.py files. These tests are expected to fail unless the related bugs are fixed.

trcli explanation

After each CI run, test results are automatically uploaded to TestRail. You can find the related workflow step here.

Example of a successful test run:

image

Example of an unsuccessful test run, with error descriptions and screenshots attached to the test run results:

image

Example of test cases that are automatically created by trcli. Note that test cases can be sorted using the Automation type field:

image

About

Proof-of-concept for web app testing using Playwright in TypeScript & Python, showcasing CI integration and parameterized testing of multiple locales. 使用 TypeScript 與 Python 的 Playwright 進行網頁應用測試的概念驗證,展示 CI 整合和多語系參數化測試。

Topics

Resources

Stars

Watchers

Forks