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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user