feat(editor): Add evaluation workflow and enhance workflow selector with pinned data support (#12773)

This commit is contained in:
oleg
2025-01-29 11:03:03 +01:00
committed by GitHub
parent 05b5f95331
commit be967ebec0
11 changed files with 290 additions and 125 deletions

View File

@@ -556,6 +556,7 @@ describe('Projects', { disableAutoLogin: true }, () => {
selectResourceLocatorItem('workflowId', 0, 'Create a');
cy.get('body').type('{esc}');
workflowPage.actions.addNodeToCanvas(NOTION_NODE_NAME, true, true);
clickCreateNewCredential();
setCredentialValues({

View File

@@ -86,6 +86,8 @@ describe('Workflow Selector Parameter', () => {
cy.stub(win, 'open').as('windowOpen');
});
cy.intercept('POST', '/rest/workflows*').as('createSubworkflow');
ndv.getters.resourceLocator('workflowId').should('be.visible');
ndv.getters.resourceLocatorInput('workflowId').click();
@@ -98,10 +100,20 @@ describe('Workflow Selector Parameter', () => {
getVisiblePopper().findChildByTestId('rlc-item').eq(0).click();
const SAMPLE_SUBWORKFLOW_TEMPLATE_ID = 'VMiAxXa3lCAizGB5f7dVZQSFfg3FtHkdTKvLuupqBls=';
cy.get('@windowOpen').should(
'be.calledWith',
`/workflows/onboarding/${SAMPLE_SUBWORKFLOW_TEMPLATE_ID}?sampleSubWorkflows=0`,
);
cy.wait('@createSubworkflow').then((interception) => {
expect(interception.request.body).to.have.property('name').that.includes('Sub-Workflow');
expect(interception.request.body.nodes).to.be.an('array');
expect(interception.request.body.nodes).to.have.length(2);
expect(interception.request.body.nodes[0]).to.have.property(
'name',
'When Executed by Another Workflow',
);
expect(interception.request.body.nodes[1]).to.have.property(
'name',
'Replace me with your logic',
);
});
cy.get('@windowOpen').should('be.calledWithMatch', /\/workflow\/.+/);
});
});

View File

@@ -65,7 +65,8 @@ describe('Sub-workflow creation and typed usage', () => {
// **************************
// NAVIGATE TO CHILD WORKFLOW
// **************************
// Close NDV before opening the node creator
cy.get('body').type('{esc}');
openNode('When Executed by Another Workflow');
});
@@ -138,41 +139,41 @@ describe('Sub-workflow creation and typed usage', () => {
cy.window().then((win) => {
cy.stub(win, 'open').callsFake((url) => {
cy.visit(url);
selectResourceLocatorItem('workflowId', 0, 'Create a');
openNode('When Executed by Another Workflow');
getParameterInputByName('inputSource').click();
getVisiblePopper()
.getByTestId('parameter-input')
.eq(0)
.type('Using JSON Example{downArrow}{enter}');
const exampleJson =
'{{}' + EXAMPLE_FIELDS.map((x) => `"${x[0]}": ${makeExample(x[1])}`).join(',') + '}';
getParameterInputByName('jsonExample')
.find('.cm-line')
.eq(0)
.type(`{selectAll}{backspace}${exampleJson}{enter}`);
// first one doesn't work for some reason, might need to wait for something?
clickExecuteNode();
validateAndReturnToParent(
DEFAULT_SUBWORKFLOW_NAME_2,
2,
EXAMPLE_FIELDS.map((f) => f[0]),
);
assertOutputTableContent([
['[null]', '[null]', '[null]', '[null]', '[null]', 'false'],
['[null]', '[null]', '[null]', '[null]', '[null]', 'false'],
]);
clickExecuteNode();
});
});
selectResourceLocatorItem('workflowId', 0, 'Create a');
openNode('When Executed by Another Workflow');
getParameterInputByName('inputSource').click();
getVisiblePopper()
.getByTestId('parameter-input')
.eq(0)
.type('Using JSON Example{downArrow}{enter}');
const exampleJson =
'{{}' + EXAMPLE_FIELDS.map((x) => `"${x[0]}": ${makeExample(x[1])}`).join(',') + '}';
getParameterInputByName('jsonExample')
.find('.cm-line')
.eq(0)
.type(`{selectAll}{backspace}${exampleJson}{enter}`);
// first one doesn't work for some reason, might need to wait for something?
clickExecuteNode();
validateAndReturnToParent(
DEFAULT_SUBWORKFLOW_NAME_2,
2,
EXAMPLE_FIELDS.map((f) => f[0]),
);
assertOutputTableContent([
['[null]', '[null]', '[null]', '[null]', '[null]', 'false'],
['[null]', '[null]', '[null]', '[null]', '[null]', 'false'],
]);
clickExecuteNode();
});
it('should show node issue when no fields are defined in manual mode', () => {