English | 繁體中文
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
.
- Playwright (TypeScript + Python) + POM design pattern + parameterized tests + fixtures
- GitHub Actions + caching + secrets
- trcli (to automatically upload screenshots of failed tests to a TestRail instance)
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.
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.
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.
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.
What is the bugs.spec.ts (TS) / test_bugs.py (Python) file?
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.
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:
Example of an unsuccessful test run, with error descriptions and screenshots attached to the test run results:
Example of test cases that are automatically created by trcli
. Note that test cases can be sorted using the Automation type field: