This test suite automates key functionalities of the EpicBet platform using Playwright. It ensures the reliability of search and betting functionalities across multiple environments.
You need playwright installed. To do this, use
npm install --save-dev @playwright/test
npx playwright test
Ensure matches displayed on the homepage can be accurately searched and validated.
- Fetch match data using the
getMatcheshelper function. - Open the search modal and input match names.
- Validate that search results contain relevant matches.
- Close the search modal.
getMatches(page, limit, logger)testSearchTerm(page, term, logger)
- Inconsistencies in search results for specific matches (e.g., minor leagues).
Ensure league names displayed on the homepage appear correctly in search results.
- Fetch league names using the
getLeagueshelper function. - Open the search modal and input league names.
- Validate search results against expected leagues.
- Close the search modal.
getLeagues(page, limit, logger)testSearchTerm(page, term, logger)
- Certain leagues (e.g., NBA, Ligue 1, and La Liga) do not appear due to platform bugs.
Ensure invalid search terms (e.g., special characters, SQL injections) do not return any results.
- Open the search modal.
- Input invalid search terms (e.g.,
DROP TABLE USERS, excessively long strings). - Validate that no results are returned.
- Close the search modal.
testSearchTerm(page, term, logger)
Validate betting functionality for spotlight matches and combobets.
- Navigate to the main page.
- Select spotlight matches or create a combobet.
- Validate the betting input fields and betslip visibility.
- Validate the appearance of the authentication modal.
betWithSpotlight(page, logger)handleQuickBet(page, logger, amount)handleMultipleBets(page, logger, term)removeComboBet(page, logger, terms)
A custom logger is used for debugging and tracking test execution flow:
- Log Levels:
error,warn,info, anddebug. - Default:
info(configurable inLoggerconstructor). - Usage: Logs are used extensively to debug search inconsistencies and validate test flow.
- This is especially useful when looking at the report in XML format as the logs are written there per test basis in a linear manner compared to the terminal.
-
League Results Missing:
- Popular leagues like NBA and La Liga occasionally fail to appear in search results.
-
Location Restrictions:
- Tests may fail to run in CI/CD due to geographical restrictions on the EpicBet platform, but the workflow itself works. See the picture below.
- Chromium: Best performance and stability.
- WebKit: Increased rendering times; tests configured with longer timeouts.
- Mozilla: Moderate performance but functional.
- Installs all dependencies, including browsers.
- Detects changes and runs tests only for modified files.
- Uploads detailed test results (JUnit, JSON, CTRF formats).
- Notifies committers about test outcomes and adds comments to commits.
- Generates workflow reports for debugging.
- Future enhancements could include tests for authenticated user workflows and advanced betting scenarios.
- Browser-specific testing configurations are available but currently limited to Chromium for simplicity.
