feat: add wordmark navigation feature test (issue #24)

- Add wordmark-navigation.feature with 3 scenarios
- Add step definitions for clicking wordmark and page assertions
- Test unauthenticated, player, and admin navigation paths
This commit is contained in:
2026-04-25 21:13:35 -07:00
committed by david
parent c3090236dd
commit b4dd40da27
2 changed files with 47 additions and 0 deletions
@@ -139,6 +139,13 @@ When('I click the {string} link', async function (linkText: string) {
await world.page.click(selector);
});
When('I click the {string} wordmark', async function (wordmarkText: string) {
const selector = `a:has-text("${wordmarkText}")`;
console.log(`🌍 Clicking wordmark: ${wordmarkText}`);
await world.page.click(selector);
await world.page.waitForLoadState('networkidle');
});
When('I click the {string} element', async function (elementText: string) {
const selector = `text=${elementText}`;
console.log(`🌍 Clicking element: ${elementText}`);
@@ -202,6 +209,20 @@ Then('I should be on the login page', async function () {
expect(currentUrl).toContain('/auth/login');
});
Then('I should be on the admin page', async function () {
const currentUrl = world.page.url();
console.log(`🌍 Checking current URL: ${currentUrl}`);
expect(currentUrl).toContain('/admin');
});
Then('I should be on the home page', async function () {
const currentUrl = world.page.url();
console.log(`🌍 Checking current URL: ${currentUrl}`);
expect(currentUrl).toContain('/');
});
Then('I should be redirected to {string}', async function (path: string) {
await world.page.waitForLoadState('networkidle');
const currentUrl = world.page.url();