mirror of
https://github.com/n8n-io/n8n.git
synced 2024-08-16 16:40:30 +03:00
✅ Adding workflow history tests
This commit is contained in:
parent
7622c72022
commit
dfc0133d59
43
cypress/e2e/42-workflow-history.cy.ts
Normal file
43
cypress/e2e/42-workflow-history.cy.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
||||||
|
import { getVisibleSelect } from '../utils';
|
||||||
|
|
||||||
|
const WorkflowPage = new WorkflowPageClass();
|
||||||
|
|
||||||
|
describe('Editor actions should work', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.enableFeature('workflowHistory');
|
||||||
|
WorkflowPage.actions.visit();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
cy.disableFeature('workflowHistory');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create new workflow version when settings are updated', () => {
|
||||||
|
WorkflowPage.actions.addInitialNodeToCanvas('Manual');
|
||||||
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
||||||
|
WorkflowPage.getters.workflowHistoryButton().should('be.enabled');
|
||||||
|
WorkflowPage.getters.workflowHistoryButton().click();
|
||||||
|
cy.url().should('include', '/history');
|
||||||
|
WorkflowPage.getters.workflowHistoryItems().its('length').should('be.greaterThan', 0);
|
||||||
|
WorkflowPage.getters.workflowHistoryItems().its('length').then((initialVersionCount) => {
|
||||||
|
WorkflowPage.getters.workflowHistoryCloseButton().click();
|
||||||
|
WorkflowPage.getters.workflowMenu().should('be.visible');
|
||||||
|
WorkflowPage.getters.workflowMenu().click();
|
||||||
|
WorkflowPage.getters.workflowMenuItemSettings().should('be.visible');
|
||||||
|
WorkflowPage.getters.workflowMenuItemSettings().click();
|
||||||
|
// Update manual executions settings
|
||||||
|
WorkflowPage.getters.workflowSettingsSaveManualExecutionsSelect().click();
|
||||||
|
getVisibleSelect().find('li').should('have.length', 3);
|
||||||
|
getVisibleSelect().find('li').last().click({ force: true });
|
||||||
|
// Save settings
|
||||||
|
WorkflowPage.getters.workflowSettingsSaveButton().click();
|
||||||
|
WorkflowPage.getters.workflowSettingsModal().should('not.exist');
|
||||||
|
WorkflowPage.getters.successToast().should('exist');
|
||||||
|
// Check if new version was created
|
||||||
|
WorkflowPage.getters.workflowHistoryButton().should('be.enabled');
|
||||||
|
WorkflowPage.getters.workflowHistoryButton().click();
|
||||||
|
WorkflowPage.getters.workflowHistoryItems().its('length').should('be.greaterThan', initialVersionCount);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -131,6 +131,8 @@ export class WorkflowPage extends BasePage {
|
|||||||
stickies: () => cy.getByTestId('sticky'),
|
stickies: () => cy.getByTestId('sticky'),
|
||||||
editorTabButton: () => cy.getByTestId('radio-button-workflow'),
|
editorTabButton: () => cy.getByTestId('radio-button-workflow'),
|
||||||
workflowHistoryButton: () => cy.getByTestId('workflow-history-button'),
|
workflowHistoryButton: () => cy.getByTestId('workflow-history-button'),
|
||||||
|
workflowHistoryItems: () => cy.getByTestId('workflow-history-list-item'),
|
||||||
|
workflowHistoryCloseButton: () => cy.getByTestId('workflow-history-close-button'),
|
||||||
colors: () => cy.getByTestId('color'),
|
colors: () => cy.getByTestId('color'),
|
||||||
contextMenuAction: (action: string) => cy.getByTestId(`context-menu-item-${action}`),
|
contextMenuAction: (action: string) => cy.getByTestId(`context-menu-item-${action}`),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user