mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
0a7ea89633
* ⬆️ Upgrade Prettier * 📦 Update `pnpm-lock.yaml` * 🎨 Format all packages * 🔧 Specify `prettierPath`
69 lines
2.2 KiB
TypeScript
69 lines
2.2 KiB
TypeScript
import { WorkflowPage, NDV } from '../pages';
|
|
|
|
const workflowPage = new WorkflowPage();
|
|
const ndv = new NDV();
|
|
|
|
describe('Data pinning', () => {
|
|
beforeEach(() => {
|
|
cy.resetAll();
|
|
cy.skipSetup();
|
|
workflowPage.actions.visit();
|
|
cy.waitForLoad();
|
|
});
|
|
|
|
it('Should be able to pin node output', () => {
|
|
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger');
|
|
workflowPage.getters.canvasNodes().first().dblclick();
|
|
ndv.getters.container().should('be.visible');
|
|
ndv.getters.pinDataButton().should('not.exist');
|
|
ndv.getters.editPinnedDataButton().should('be.visible');
|
|
|
|
ndv.actions.execute();
|
|
|
|
ndv.getters.outputDataContainer().should('be.visible');
|
|
ndv.getters.outputDataContainer().get('table').should('be.visible');
|
|
ndv.getters.outputTableRows().should('have.length', 2);
|
|
ndv.getters.outputTableHeaders().should('have.length.at.least', 10);
|
|
ndv.getters.outputTableHeaders().first().should('include.text', 'timestamp');
|
|
ndv.getters.outputTableHeaders().eq(1).should('include.text', 'Readable date');
|
|
|
|
ndv.getters
|
|
.outputTbodyCell(1, 0)
|
|
.invoke('text')
|
|
.then((prevValue) => {
|
|
ndv.actions.pinData();
|
|
ndv.actions.close();
|
|
|
|
workflowPage.actions.executeWorkflow();
|
|
workflowPage.actions.openNode('Schedule Trigger');
|
|
|
|
ndv.getters.outputTbodyCell(1, 0).invoke('text').should('eq', prevValue);
|
|
});
|
|
});
|
|
|
|
it('Should be be able to set pinned data', () => {
|
|
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger');
|
|
workflowPage.getters.canvasNodes().first().dblclick();
|
|
ndv.getters.container().should('be.visible');
|
|
ndv.getters.pinDataButton().should('not.exist');
|
|
ndv.getters.editPinnedDataButton().should('be.visible');
|
|
|
|
ndv.actions.setPinnedData([{ test: 1 }]);
|
|
|
|
ndv.getters.outputTableRows().should('have.length', 2);
|
|
ndv.getters.outputTableHeaders().should('have.length', 2);
|
|
ndv.getters.outputTableHeaders().first().should('include.text', 'test');
|
|
ndv.getters.outputTbodyCell(1, 0).should('include.text', 1);
|
|
|
|
ndv.actions.close();
|
|
|
|
workflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
cy.reload();
|
|
workflowPage.actions.openNode('Schedule Trigger');
|
|
|
|
ndv.getters.outputTableHeaders().first().should('include.text', 'test');
|
|
ndv.getters.outputTbodyCell(1, 0).should('include.text', 1);
|
|
});
|
|
});
|