♻️ refactor: change the /community/assistant to /agent routes (#11606)

* refactor: change the /community/assistant to /agent routes

* fix: slove the group detail page go back error

* fix: update the e2e test
This commit is contained in:
Shinji-Li
2026-01-19 15:41:20 +08:00
committed by GitHub
parent 37e59245d0
commit 7f004c5baf
61 changed files with 92 additions and 74 deletions

View File

@@ -90,7 +90,7 @@ Feature: Community Smoke Tests
@COMMUNITY-SMOKE-001 @P0
Scenario: Load community assistant list page
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
Then the page should load without errors
And I should see the page body
And I should see the search bar

View File

@@ -11,7 +11,7 @@ Feature: Discover Detail Pages
@COMMUNITY-DETAIL-001 @P1
Scenario: Load assistant detail page and verify content
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
And I wait for the page to fully load
When I click on the first assistant card
Then I should be on an assistant detail page
@@ -22,7 +22,7 @@ Feature: Discover Detail Pages
@COMMUNITY-DETAIL-002 @P1
Scenario: Navigate back from assistant detail page
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
And I wait for the page to fully load
And I click on the first assistant card
When I click the back button

View File

@@ -11,14 +11,14 @@ Feature: Discover Interactions
@COMMUNITY-INTERACT-001 @P1
Scenario: Search for assistants
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
When I type "developer" in the search bar
And I wait for the search results to load
Then I should see filtered assistant cards
@COMMUNITY-INTERACT-002 @P1
Scenario: Filter assistants by category
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
When I click on a category in the category menu
And I wait for the filtered results to load
Then I should see assistant cards filtered by the selected category
@@ -26,7 +26,7 @@ Feature: Discover Interactions
@COMMUNITY-INTERACT-003 @P1
Scenario: Navigate to next page of assistants
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
When I click the next page button
And I wait for the next page to load
Then I should see different assistant cards
@@ -34,7 +34,7 @@ Feature: Discover Interactions
@COMMUNITY-INTERACT-004 @P1
Scenario: Navigate to assistant detail page
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
When I click on the first assistant card
Then I should be navigated to the assistant detail page
And I should see the assistant detail content
@@ -95,7 +95,7 @@ Feature: Discover Interactions
Scenario: Navigate from home to assistant list
Given I navigate to "/community"
When I click on the "more" link in the featured assistants section
Then I should be navigated to "/community/assistant"
Then I should be navigated to "/community/agent"
And I should see the page body
@COMMUNITY-INTERACT-011 @P1

View File

@@ -12,7 +12,7 @@ Feature: Community Smoke Tests
@COMMUNITY-SMOKE-002 @P0
Scenario: Load Assistant List Page
Given I navigate to "/community/assistant"
Given I navigate to "/community/agent"
Then the page should load without errors
And I should see the page body
And I should see the search bar

View File

@@ -8,7 +8,7 @@ import { CustomWorld } from '../../support/world';
// ============================================
Given('I wait for the page to fully load', async function (this: CustomWorld) {
// Use domcontentloaded instead of networkidle to avoid hanging on persistent connections
// Use domcontentloaded instead of networkidle to avoid hanging on persistent connections
await this.page.waitForLoadState('domcontentloaded', { timeout: 10_000 });
// Short wait for React hydration
await this.page.waitForTimeout(1000);
@@ -135,9 +135,9 @@ Then('I should be on the assistant list page', async function (this: CustomWorld
const currentUrl = this.page.url();
// Check if URL is assistant list (not detail page) or community home
// After back navigation, URL should be /community/assistant or /community
// After back navigation, URL should be /community/agent or /community
const isListPage =
(currentUrl.includes('/community/assistant') &&
(currentUrl.includes('/community/agent') &&
!/\/community\/assistant\/[\dA-Za-z-]+$/.test(currentUrl)) ||
currentUrl.endsWith('/community') ||
currentUrl.includes('/community#');
@@ -176,7 +176,9 @@ Then('I should see the model description', async function (this: CustomWorld) {
// Model detail page shows description below the title, it might be a placeholder like "model.description"
// or actual content. Just verify the page structure is correct.
const descriptionArea = this.page.locator('main, article, [class*="detail"], [class*="content"]').first();
const descriptionArea = this.page
.locator('main, article, [class*="detail"], [class*="content"]')
.first();
const isVisible = await descriptionArea.isVisible().catch(() => false);
// Pass if any content area is visible - the description might be a placeholder

View File

@@ -376,11 +376,11 @@ Then('the URL should contain the category parameter', async function (this: Cust
console.log(` 📍 Selected category: ${this.testContext.selectedCategory}`);
// Check if URL contains a category-related parameter
// The URL format is: /community/assistant?category=xxx
// The URL format is: /community/agent?category=xxx
const hasCategory =
currentUrl.includes('category=') ||
currentUrl.includes('tag=') ||
// For path-based routing like /community/assistant/category-name
// For path-based routing like /community/agent/category-name
/\/community\/assistant\/[^/?]+/.test(currentUrl);
expect(
@@ -418,7 +418,7 @@ Then('the URL should contain the page parameter', async function (this: CustomWo
if (this.testContext.usedInfiniteScroll) {
console.log(' 📍 Used infinite scroll, page parameter not expected');
// Just verify we're still on the assistant page
expect(currentUrl.includes('/community/assistant')).toBeTruthy();
expect(currentUrl.includes('/community/agent')).toBeTruthy();
return;
}