mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user