test: Migrate small Cypress tests to Playwright (#18922)

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
shortstacked
2025-08-29 09:04:47 +01:00
committed by GitHub
parent 1bc317dce5
commit 7dd89d77d9
18 changed files with 388 additions and 190 deletions

View File

@@ -552,4 +552,39 @@ export class NodeDetailsViewPage extends BasePage {
// eslint-disable-next-line playwright/no-wait-for-timeout
await this.page.waitForTimeout(2500);
}
// Pagination methods for output panel
getOutputPagination() {
return this.getOutputPanel().getByTestId('ndv-data-pagination');
}
getOutputPaginationPages() {
return this.getOutputPagination().locator('.el-pager li.number');
}
async navigateToOutputPage(pageNumber: number): Promise<void> {
const pages = this.getOutputPaginationPages();
await pages.nth(pageNumber - 1).click();
}
async getCurrentOutputPage(): Promise<number> {
const activePage = this.getOutputPagination().locator('.el-pager li.is-active').first();
const pageText = await activePage.textContent();
return parseInt(pageText ?? '1', 10);
}
async getOutputPageContent(row: number = 0, col: number = 0): Promise<string> {
return (await this.getOutputTbodyCell(row, col).textContent()) ?? '';
}
/**
* Set parameter input value by clearing and filling (for parameters without standard test-id)
* @param parameterName - The parameter name
* @param value - The value to set
*/
async setParameterInputValue(parameterName: string, value: string): Promise<void> {
const input = this.getParameterInput(parameterName).locator('input');
await input.clear();
await input.fill(value);
}
}