|
|
@@ -157,8 +157,8 @@ export class ActivityManagementPage {
|
|
|
const activityRow = await this.getActivityByName(name);
|
|
|
if (!activityRow) throw new Error(`Activity ${name} not found`);
|
|
|
|
|
|
- // 编辑按钮是图标按钮
|
|
|
- const editButton = activityRow.locator('button').first();
|
|
|
+ // 使用data-testid定位编辑按钮
|
|
|
+ const editButton = activityRow.locator('[data-testid^="edit-activity-"]');
|
|
|
await editButton.waitFor({ state: 'visible', timeout: 10000 });
|
|
|
await editButton.click();
|
|
|
|
|
|
@@ -195,8 +195,8 @@ export class ActivityManagementPage {
|
|
|
const activityRow = await this.getActivityByName(name);
|
|
|
if (!activityRow) throw new Error(`Activity ${name} not found`);
|
|
|
|
|
|
- // 删除按钮是图标按钮(第二个按钮是删除)
|
|
|
- const deleteButton = activityRow.locator('button').nth(1);
|
|
|
+ // 使用data-testid定位删除按钮
|
|
|
+ const deleteButton = activityRow.locator('[data-testid^="delete-activity-"]');
|
|
|
await deleteButton.waitFor({ state: 'visible', timeout: 10000 });
|
|
|
await deleteButton.click();
|
|
|
|