|
|
@@ -54,11 +54,12 @@ export class ActivityManagementPage {
|
|
|
|
|
|
async searchActivities(keyword: string) {
|
|
|
await this.searchInput.fill(keyword);
|
|
|
- await this.searchButton.click();
|
|
|
+ // 等待防抖搜索完成(300ms + 网络请求时间)
|
|
|
+ await this.page.waitForTimeout(500);
|
|
|
await this.page.waitForLoadState('networkidle');
|
|
|
}
|
|
|
|
|
|
- async filterByType(type: '去程活动' | '返程活动') {
|
|
|
+ async filterByType(type: '去程' | '返程') {
|
|
|
await this.typeFilter.click();
|
|
|
await this.page.getByRole('option', { name: type }).click();
|
|
|
await this.page.waitForLoadState('networkidle');
|
|
|
@@ -121,6 +122,13 @@ export class ActivityManagementPage {
|
|
|
|
|
|
async getActivityCount(): Promise<number> {
|
|
|
const rows = await this.activityTable.locator('tbody tr').count();
|
|
|
+ // 如果只有一行且显示"暂无活动数据",则返回0
|
|
|
+ if (rows === 1) {
|
|
|
+ const firstRowText = await this.activityTable.locator('tbody tr').first().textContent();
|
|
|
+ if (firstRowText?.includes('暂无活动数据')) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
return rows;
|
|
|
}
|
|
|
|