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:
@@ -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
|
||||
});
|
||||
|
||||
@@ -230,6 +230,12 @@ Then('I should be on the password reset page', async function () {
|
||||
expect(currentUrl).toContain('/auth/password-reset');
|
||||
});
|
||||
|
||||
Then('I should see the {string} button', async function (buttonText: string) {
|
||||
const button = world.page.locator(`button:has-text("${buttonText}")`);
|
||||
await expect(button).toBeVisible();
|
||||
console.log(`🌍 Verified button is visible: ${buttonText}`);
|
||||
});
|
||||
|
||||
Then('I should be redirected to {string}', async function (path: string) {
|
||||
await world.page.waitForLoadState('networkidle');
|
||||
const currentUrl = world.page.url();
|
||||
|
||||
Reference in New Issue
Block a user