codeant-ai-for-open-source[bot] commented on code in PR #38377:
URL: https://github.com/apache/superset/pull/38377#discussion_r2881353697


##########
superset-frontend/playwright/pages/DashboardListPage.ts:
##########
@@ -0,0 +1,139 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Page, Locator } from '@playwright/test';
+import { Button, Table } from '../components/core';
+import { BulkSelect } from '../components/ListView';
+import { URL } from '../utils/urls';
+
+/**
+ * Dashboard List Page object.
+ */
+export class DashboardListPage {
+  private readonly page: Page;
+  private readonly table: Table;
+  readonly bulkSelect: BulkSelect;
+
+  /**
+   * Action button names for getByRole('button', { name })
+   * DashboardList uses Icons.DeleteOutlined, Icons.UploadOutlined, 
Icons.EditOutlined
+   */
+  private static readonly ACTION_BUTTONS = {
+    DELETE: 'delete',
+    EDIT: 'edit',
+    EXPORT: 'upload',
+  } as const;

Review Comment:
   **Suggestion:** The row-level export action button is selected using the 
accessible name `'upload'`, but in the Dashboard list UI the export button is 
labeled as an export action (e.g., "Export"), so `getByRole('button', { name: 
'upload' })` is unlikely to match any button and will cause the 
single-dashboard export test to fail by timing out when trying to click a 
non-existent locator. [possible bug]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Dashboard single-export E2E test fails locating button.
   - ⚠️ Dashboard export behavior lacks reliable end-to-end coverage.
   - ⚠️ CI Playwright run may show persistent failures for dashboards.
   ```
   </details>
   
   ```suggestion
     private static readonly ACTION_BUTTONS = {
       DELETE: 'delete',
       EDIT: 'edit',
       EXPORT: 'Export',
     } as const;
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Run the new Playwright spec
   
`superset-frontend/playwright/tests/experimental/dashboard/dashboard-list.spec.ts`
 (file
   found via Grep) using the command from the PR description: 
`INCLUDE_EXPERIMENTAL=true npx
   playwright test tests/experimental/dashboard/dashboard-list.spec.ts 
--project=chromium`.
   
   2. In that spec, the Dashboard list tests construct a `DashboardListPage` 
from
   `superset-frontend/playwright/pages/DashboardListPage.ts` and navigate via 
`goto()` before
   exercising the single-dashboard export flow (file presence and usage 
confirmed via Grep).
   
   3. The test calls `DashboardListPage.clickExportAction(dashboardName)`, 
which resolves to
   the implementation at 
`superset-frontend/playwright/pages/DashboardListPage.ts:103-107`,
   where the row locator calls `.getByRole('button', { name:
   DashboardListPage.ACTION_BUTTONS.EXPORT })`.
   
   4. Because `ACTION_BUTTONS.EXPORT` is defined as `'upload'` at
   `superset-frontend/playwright/pages/DashboardListPage.ts:37-41`, Playwright 
searches for a
   button whose accessible name is `"upload"`. In the actual Dashboard list UI
   (`superset-frontend/src/pages/DashboardList/index.tsx`, identified via Grep 
as using
   `UploadOutlined` for the export action), the export action is labeled as an 
"Export"
   button (tooltip/aria-label), so no button with name `"upload"` exists. The 
locator never
   resolves, causing the single-dashboard export test to time out or fail with 
a "locator not
   found" error when trying to click the non-existent button.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/playwright/pages/DashboardListPage.ts
   **Line:** 37:41
   **Comment:**
        *Possible Bug: The row-level export action button is selected using the 
accessible name `'upload'`, but in the Dashboard list UI the export button is 
labeled as an export action (e.g., "Export"), so `getByRole('button', { name: 
'upload' })` is unlikely to match any button and will cause the 
single-dashboard export test to fail by timing out when trying to click a 
non-existent locator.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38377&comment_hash=d39cef278c68d1c78be8040545866ff2fcb943ae8541bd277df9d5e153504f19&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38377&comment_hash=d39cef278c68d1c78be8040545866ff2fcb943ae8541bd277df9d5e153504f19&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to