msyavuz commented on code in PR #36684:
URL: https://github.com/apache/superset/pull/36684#discussion_r2726982872
##########
superset-frontend/playwright/pages/DatasetListPage.ts:
##########
@@ -85,31 +94,132 @@ export class DatasetListPage {
* @param datasetName - The name of the dataset to delete
*/
async clickDeleteAction(datasetName: string): Promise<void> {
- await this.table.clickRowAction(
- datasetName,
- DatasetListPage.SELECTORS.DELETE_ACTION,
- );
+ const row = this.table.getRow(datasetName);
+ await row
+ .getByRole('button', { name: DatasetListPage.ACTION_BUTTONS.DELETE })
+ .click();
+ }
+
+ /**
+ * Clicks the edit action button for a dataset
+ * @param datasetName - The name of the dataset to edit
+ */
+ async clickEditAction(datasetName: string): Promise<void> {
+ const row = this.table.getRow(datasetName);
+ await row
+ .getByRole('button', { name: DatasetListPage.ACTION_BUTTONS.EDIT })
+ .click();
}
/**
* Clicks the export action button for a dataset
* @param datasetName - The name of the dataset to export
*/
async clickExportAction(datasetName: string): Promise<void> {
- await this.table.clickRowAction(
- datasetName,
- DatasetListPage.SELECTORS.EXPORT_ACTION,
- );
+ const row = this.table.getRow(datasetName);
+ await row
+ .getByRole('button', { name: DatasetListPage.ACTION_BUTTONS.EXPORT })
+ .click();
}
/**
* Clicks the duplicate action button for a dataset (virtual datasets only)
* @param datasetName - The name of the dataset to duplicate
*/
async clickDuplicateAction(datasetName: string): Promise<void> {
- await this.table.clickRowAction(
- datasetName,
- DatasetListPage.SELECTORS.DUPLICATE_ACTION,
+ const row = this.table.getRow(datasetName);
+ await row
+ .getByRole('button', { name: DatasetListPage.ACTION_BUTTONS.DUPLICATE })
+ .click();
+ }
+
+ /**
+ * Gets the "Bulk select" button
+ */
+ getBulkSelectButton(): Button {
+ return new Button(
+ this.page,
+ this.page.getByRole('button', { name: 'Bulk select' }),
);
}
Review Comment:
This method would exist on all crud pages right? Should there be a component
class for this?
--
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]