feat: add tournament schedule feature test (issue #7)

- Add tournament-schedule.feature with 4 scenarios
- Add step definitions for tournament schedule navigation
- Tests viewing schedule, generating round-robin, bye rounds, and matchup navigation
- Note: Some @wip scenarios require data setup (tournament creation, team addition)
This commit is contained in:
2026-04-25 21:15:54 -07:00
parent b96932270b
commit 1bece10df2
4 changed files with 80 additions and 1 deletions
+34 -1
View File
@@ -264,7 +264,7 @@ Then('my user account should exist', async function () {
});
/**
* Schedule steps
* Schedule steps (player)
*/
When('I go to my schedule page', async function () {
console.log('🌍 Going to schedule page');
@@ -287,3 +287,36 @@ Given('I have upcoming matches in my schedule', async function () {
// For now, this is a placeholder that indicates data setup is needed
// In a real test run, this data would already exist in the dev database
});
/**
* Tournament schedule steps
*/
Given('a tournament exists with {int} teams', async function (teamCount: number) {
console.log(`🌍 Note: Tournament with ${teamCount} teams requires data setup`);
console.log('🌍 For acceptance tests, this would be created via UI or API');
// In a real test run, this would either:
// 1. Create a tournament via the UI (slower but more realistic)
// 2. Use API to create tournament and add teams (faster)
// 3. Pre-existing test data in dev database
// Store the team count in world context for later steps
world.tournamentTeamCount = teamCount;
});
When('I go to the tournament schedule page', async function () {
console.log('🌍 Going to tournament schedule page');
// Navigate to a tournament schedule page
// This would typically be /admin/tournaments/{id}/schedule
// For testing, we'll go to the first tournament's schedule
await world.page.goto(`${world.baseURL}/admin/tournaments/1/schedule`);
await world.page.waitForLoadState('networkidle');
});
Given('a tournament has a generated schedule', async function () {
console.log('🌍 Note: Tournament schedule requires generation via API or UI');
console.log('🌍 For acceptance tests, this would be created before running the test');
// In a real test run, we would:
// 1. Create a tournament
// 2. Add teams/participants
// 3. Generate schedule via API or UI
});