[ACS-8064] Migrate actions-favorites tests to Playwright (#3871)

* ACS-8064 Migrate actions-favorites tests to Playwright
This commit is contained in:
Katarzyna Kita
2024-06-13 11:16:25 +02:00
committed by GitHub
parent baeba22e8f
commit a6c929a958
12 changed files with 335 additions and 204 deletions

View File

@@ -115,4 +115,16 @@ export class FavoritesPageApi {
return await Utils.retryCall(favoriteFiles);
} catch {}
}
async removeFavoritesByIds(username: string, ids: string[]): Promise<void> {
try {
if (ids && ids.length > 0) {
for (const id of ids) {
await this.apiService.favorites.deleteFavorite(username, id);
}
}
} catch (error) {
console.error('FavoritesApi: removeFavoritesByIds failed ', error);
}
}
}

View File

@@ -103,4 +103,12 @@ export class PersonalFilesPage extends BasePage {
await this.contentNodeSelector.selectDestination(destinationName);
await this.contentNodeSelector.actionButton.click();
}
async selectItemsAndToggleFavorite(item: string[], action: 'Favorite' | 'Remove Favorite') {
for (const itemToSelect of item) {
await this.dataTable.selectItem(itemToSelect);
}
await this.acaHeader.clickMoreActions();
await this.matMenu.clickMenuItem(action);
}
}