mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
test(editor): Add e2e test cases for the logs view (#15060)
This commit is contained in:
@@ -2,8 +2,20 @@
|
||||
* Accessors
|
||||
*/
|
||||
|
||||
export function getLogEntryAtRow(rowIndex: number) {
|
||||
return cy.getByTestId('logs-overview-body').find('[role=treeitem]').eq(rowIndex);
|
||||
export function getOverviewStatus() {
|
||||
return cy.getByTestId('logs-overview-status');
|
||||
}
|
||||
|
||||
export function getLogEntries() {
|
||||
return cy.getByTestId('logs-overview-body').find('[role=treeitem]');
|
||||
}
|
||||
|
||||
export function getSelectedLogEntry() {
|
||||
return cy.getByTestId('logs-overview-body').find('[role=treeitem][aria-selected=true]');
|
||||
}
|
||||
|
||||
export function getInputPanel() {
|
||||
return cy.getByTestId('log-details-input');
|
||||
}
|
||||
|
||||
export function getInputTableRows() {
|
||||
@@ -14,6 +26,22 @@ export function getInputTbodyCell(row: number, col: number) {
|
||||
return cy.getByTestId('log-details-input').find('table tr').eq(row).find('td').eq(col);
|
||||
}
|
||||
|
||||
export function getNodeErrorMessageHeader() {
|
||||
return cy.getByTestId('log-details-output').findChildByTestId('node-error-message');
|
||||
}
|
||||
|
||||
export function getOutputPanel() {
|
||||
return cy.getByTestId('log-details-output');
|
||||
}
|
||||
|
||||
export function getOutputTableRows() {
|
||||
return cy.getByTestId('log-details-output').find('table tr');
|
||||
}
|
||||
|
||||
export function getOutputTbodyCell(row: number, col: number) {
|
||||
return cy.getByTestId('log-details-output').find('table tr').eq(row).find('td').eq(col);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
@@ -22,8 +50,12 @@ export function openLogsPanel() {
|
||||
cy.getByTestId('logs-overview-header').click();
|
||||
}
|
||||
|
||||
export function pressClearExecutionButton() {
|
||||
cy.getByTestId('logs-overview-header').find('button').contains('Clear execution').click();
|
||||
}
|
||||
|
||||
export function clickLogEntryAtRow(rowIndex: number) {
|
||||
getLogEntryAtRow(rowIndex).click();
|
||||
getLogEntries().eq(rowIndex).click();
|
||||
}
|
||||
|
||||
export function toggleInputPanel() {
|
||||
@@ -31,11 +63,21 @@ export function toggleInputPanel() {
|
||||
}
|
||||
|
||||
export function clickOpenNdvAtRow(rowIndex: number) {
|
||||
getLogEntryAtRow(rowIndex).realHover();
|
||||
getLogEntryAtRow(rowIndex).find('[aria-label="Open..."]').click();
|
||||
getLogEntries().eq(rowIndex).realHover();
|
||||
getLogEntries().eq(rowIndex).find('[aria-label="Open..."]').click();
|
||||
}
|
||||
|
||||
export function setInputDisplayMode(mode: 'table') {
|
||||
export function clickTriggerPartialExecutionAtRow(rowIndex: number) {
|
||||
getLogEntries().eq(rowIndex).realHover();
|
||||
getLogEntries().eq(rowIndex).find('[aria-label="Test step"]').click();
|
||||
}
|
||||
|
||||
export function setInputDisplayMode(mode: 'table' | 'ai' | 'json' | 'schema') {
|
||||
cy.getByTestId('log-details-input').realHover();
|
||||
cy.getByTestId('log-details-input').findChildByTestId(`radio-button-${mode}`).click();
|
||||
}
|
||||
|
||||
export function setOutputDisplayMode(mode: 'table' | 'ai' | 'json' | 'schema') {
|
||||
cy.getByTestId('log-details-output').realHover();
|
||||
cy.getByTestId('log-details-output').findChildByTestId(`radio-button-${mode}`).click();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user