Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions frontend/e2e/pages/helm-details-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import type { Locator } from '@playwright/test';

import BasePage from './base-page';

export class HelmDetailsPage extends BasePage {
private readonly sectionHeading = this.page.getByTestId('details-page-section-heading');
private readonly resourcesTab = this.page.getByTestId('horizontal-link-Resources');
private readonly revisionHistoryTab = this.page.getByTestId(
'horizontal-link-Revision history',
);
private readonly releaseNotesTab = this.page.getByTestId('horizontal-link-Release notes');
private readonly actionsMenuButton = this.page.getByTestId('actions-menu-button');
private readonly actionItems = this.page.getByTestId('action-items');
private readonly pageHeading = this.page.getByTestId('page-heading').locator('h1');
private readonly statusIcon = this.page.getByTestId('success-icon');
private readonly statusText = this.page.getByTestId('status-text');
private readonly statusDetails = this.page.getByTestId('helm-release-status-details');
private readonly deleteModalTitle = this.page.getByTestId('modal-title');
private readonly resourceNameText = this.page.getByTestId('resource-name');
private readonly releaseNameInput = this.page.locator('#form-input-resourceName-field');
private readonly confirmActionButton = this.page.getByTestId('confirm-action');

getSectionHeading(): Locator {
return this.sectionHeading;
}

getResourcesTab(): Locator {
return this.resourcesTab;
}

getRevisionHistoryTab(): Locator {
return this.revisionHistoryTab;
}

getReleaseNotesTab(): Locator {
return this.releaseNotesTab;
}

getActionsMenuButton(): Locator {
return this.actionsMenuButton;
}

getPageHeading(): Locator {
return this.pageHeading;
}

getStatusIcon(): Locator {
return this.statusIcon;
}

getStatusText(): Locator {
return this.statusText;
}

getStatusDetails(): Locator {
return this.statusDetails;
}

async clickActionsMenu(): Promise<void> {
await this.robustClick(this.actionsMenuButton);
}

getActionMenuItem(actionName: string): Locator {
return this.actionItems.locator('li', { hasText: actionName });
}

async clickRevisionHistoryTab(): Promise<void> {
await this.robustClick(this.revisionHistoryTab);
}

async enterReleaseNameInDeletePopup(releaseName: string): Promise<void> {
await this.releaseNameInput.fill(releaseName);
}

async confirmDelete(): Promise<void> {
await this.robustClick(this.confirmActionButton);
}

getDeleteModalTitle(): Locator {
return this.deleteModalTitle;
}

getResourceNameText(): Locator {
return this.resourceNameText;
}
}
Loading