diff --git a/e2e/cucumber/features/player-schedule.feature b/e2e/cucumber/features/player-schedule.feature new file mode 100644 index 0000000..164e7bb --- /dev/null +++ b/e2e/cucumber/features/player-schedule.feature @@ -0,0 +1,28 @@ +Feature: Player Schedule + As a player + I want to see my upcoming matches + So that I can prepare for and attend my games + + @happy-path @player-features @issue-9 + Scenario: Player views empty schedule when no matches + Given I am logged in as a player + When I go to my schedule page + Then I should see "No upcoming matches" + + @happy-path @player-features @issue-9 @wip + Scenario: Player views schedule with upcoming matches + Given I am logged in as a player + And I have upcoming matches in my schedule + When I go to my schedule page + Then I should see "Upcoming Matches" + And I should see the match date + And I should see my opponent's name + And I should see the tournament name + + @happy-path @player-features @issue-9 @wip + Scenario: Player can navigate to match details from schedule + Given I am logged in as a player + And I have upcoming matches in my schedule + When I go to my schedule page + And I click on a match + Then I should be on the match detail page diff --git a/e2e/cucumber/step-definitions/auth-steps.ts b/e2e/cucumber/step-definitions/auth-steps.ts index bc35da0..e227bed 100644 --- a/e2e/cucumber/step-definitions/auth-steps.ts +++ b/e2e/cucumber/step-definitions/auth-steps.ts @@ -262,3 +262,28 @@ Then('my user account should exist', async function () { await expect(world.page.locator('text=Welcome')).toBeVisible(); console.log('🌍 Verified user account was created successfully'); }); + +/** + * Schedule steps + */ +When('I go to my schedule page', async function () { + console.log('🌍 Going to schedule page'); + // Navigate to the schedule page + // The URL pattern would be /players/{playerId}/schedule + // We'll navigate to /players/schedule which should redirect or work + await world.page.goto(`${world.baseURL}/players/schedule`); + await world.page.waitForLoadState('networkidle'); +}); + +Given('I have upcoming matches in my schedule', async function () { + console.log('🌍 Note: This step requires database setup via API or UI'); + console.log('🌍 For acceptance tests, this would be set up before running the test'); + // For true acceptance testing, we would: + // 1. Create a tournament + // 2. Add the player as a participant + // 3. Generate a schedule + // 4. The match would then appear in the player's schedule + + // 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 +});