forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds new n8n without version * Adds n8n merge with permission updates
- Loading branch information
1 parent
64981cf
commit d6fb50f
Showing
1,120 changed files
with
38,139 additions
and
20,393 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,136 @@ | ||
import { NDV } from '../pages/ndv'; | ||
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow'; | ||
|
||
const ndv = new NDV(); | ||
const WorkflowPage = new WorkflowPageClass(); | ||
|
||
describe('Inline expression editor', () => { | ||
beforeEach(() => { | ||
WorkflowPage.actions.visit(); | ||
WorkflowPage.actions.addInitialNodeToCanvas('Manual'); | ||
WorkflowPage.actions.addNodeToCanvas('Hacker News'); | ||
WorkflowPage.actions.openNode('Hacker News'); | ||
WorkflowPage.actions.openInlineExpressionEditor(); | ||
|
||
WorkflowPage.actions.addInitialNodeToCanvas('Schedule'); | ||
cy.on('uncaught:exception', (err) => err.name !== 'ExpressionError'); | ||
}); | ||
|
||
it('should resolve primitive resolvables', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('1 + 2'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^3$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('"ab"'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{rightArrow}+'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('"cd"'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^abcd$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('true && false'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^false$/); | ||
}); | ||
describe('Static data', () => { | ||
beforeEach(() => { | ||
WorkflowPage.actions.addNodeToCanvas('Hacker News'); | ||
WorkflowPage.actions.openNode('Hacker News'); | ||
WorkflowPage.actions.openInlineExpressionEditor(); | ||
}); | ||
|
||
it('should resolve object resolvables', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorInput() | ||
.type('{ a: 1 }', { parseSpecialCharSequences: false }); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Object: \{"a": 1\}\]$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorInput() | ||
.type('{ a: 1 }.a', { parseSpecialCharSequences: false }); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^1$/); | ||
}); | ||
it('should resolve primitive resolvables', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('1 + 2'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^3$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('"ab"'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{rightArrow}+'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('"cd"'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^abcd$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('true && false'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^false$/); | ||
}); | ||
|
||
it('should resolve object resolvables', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorInput() | ||
.type('{ a: 1 }', { parseSpecialCharSequences: false }); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Object: \{"a": 1\}\]$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
it('should resolve array resolvables', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('[1, 2, 3]'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Array: \[1,2,3\]\]$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorInput() | ||
.type('{ a: 1 }.a', { parseSpecialCharSequences: false }); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^1$/); | ||
}); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
it('should resolve array resolvables', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('[1, 2, 3]'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Array: \[1,2,3\]\]$/); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('[1, 2, 3]'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('[0]'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^1$/); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
|
||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('[1, 2, 3]'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('[0]'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^1$/); | ||
}); | ||
}); | ||
|
||
it('should resolve $parameter[]', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
// Resolving $parameter is slow, especially on CI runner | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('$parameter["operation"]'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().should('have.text', 'getAll'); | ||
describe('Dynamic data', () => { | ||
beforeEach(() => { | ||
WorkflowPage.actions.openNode('Schedule Trigger'); | ||
ndv.actions.setPinnedData([{ myStr: 'Monday' }]); | ||
ndv.actions.close(); | ||
WorkflowPage.actions.addNodeToCanvas('No Operation'); | ||
WorkflowPage.actions.addNodeToCanvas('Hacker News'); | ||
WorkflowPage.actions.openNode('Hacker News'); | ||
WorkflowPage.actions.openInlineExpressionEditor(); | ||
}); | ||
|
||
it('should resolve $parameter[]', () => { | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
// Resolving $parameter is slow, especially on CI runner | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('$parameter["operation"]'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().should('have.text', 'getAll'); | ||
}); | ||
|
||
it('should resolve input: $json,$input,$(nodeName)', () => { | ||
// Previous nodes have not run, input is empty | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('$json.myStr'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorOutput() | ||
.should('have.text', '[Execute previous nodes for preview]'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('$input.item.json.myStr'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorOutput() | ||
.should('have.text', '[Execute previous nodes for preview]'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorInput() | ||
.type("$('Schedule Trigger').item.json.myStr"); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorOutput() | ||
.should('have.text', '[Execute previous nodes for preview]'); | ||
|
||
// Run workflow | ||
ndv.actions.close(); | ||
WorkflowPage.actions.executeNode('No Operation'); | ||
WorkflowPage.actions.openNode('Hacker News'); | ||
WorkflowPage.actions.openInlineExpressionEditor(); | ||
|
||
// Previous nodes have run, input can be resolved | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('$json.myStr'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().should('have.text', 'Monday'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('$input.item.json.myStr'); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().should('have.text', 'Monday'); | ||
WorkflowPage.getters.inlineExpressionEditorInput().clear(); | ||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{'); | ||
WorkflowPage.getters | ||
.inlineExpressionEditorInput() | ||
.type("$('Schedule Trigger').item.json.myStr"); | ||
WorkflowPage.getters.inlineExpressionEditorOutput().should('have.text', 'Monday'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ describe('Data transformation expressions', () => { | |
const output = 'monday is TODAY'; | ||
|
||
ndv.getters.inlineExpressionEditorInput().clear().type(input); | ||
ndv.getters.inlineExpressionEditorOutput().should('have.text', output); | ||
ndv.actions.execute(); | ||
ndv.getters.outputDataContainer().should('be.visible'); | ||
ndv.getters.outputDataContainer().contains(output); | ||
|
@@ -34,6 +35,7 @@ describe('Data transformation expressions', () => { | |
const output = '[email protected] false'; | ||
|
||
ndv.getters.inlineExpressionEditorInput().clear().type(input); | ||
ndv.getters.inlineExpressionEditorOutput().should('have.text', output); | ||
ndv.actions.execute(); | ||
ndv.getters.outputDataContainer().should('be.visible'); | ||
ndv.getters.outputDataContainer().contains(output); | ||
|
@@ -49,6 +51,7 @@ describe('Data transformation expressions', () => { | |
const output = '9.12'; | ||
|
||
ndv.getters.inlineExpressionEditorInput().clear().type(input); | ||
ndv.getters.inlineExpressionEditorOutput().should('have.text', output); | ||
ndv.actions.execute(); | ||
ndv.getters.outputDataContainer().should('be.visible'); | ||
ndv.getters.outputDataContainer().contains(output); | ||
|
@@ -64,6 +67,7 @@ describe('Data transformation expressions', () => { | |
const output = '[email protected] false'; | ||
|
||
ndv.getters.inlineExpressionEditorInput().clear().type(input); | ||
ndv.getters.inlineExpressionEditorOutput().should('have.text', output); | ||
ndv.actions.execute(); | ||
ndv.getters.outputDataContainer().should('be.visible'); | ||
ndv.getters.outputDataContainer().contains(output); | ||
|
@@ -78,6 +82,7 @@ describe('Data transformation expressions', () => { | |
const output = 'true 3'; | ||
|
||
ndv.getters.inlineExpressionEditorInput().clear().type(input); | ||
ndv.getters.inlineExpressionEditorOutput().should('have.text', output); | ||
ndv.actions.execute(); | ||
ndv.getters.outputDataContainer().find('[class*=value_]').should('exist'); | ||
ndv.getters.outputDataContainer().find('[class*=value_]').should('contain', output); | ||
|
@@ -93,6 +98,7 @@ describe('Data transformation expressions', () => { | |
const output = '1 3'; | ||
|
||
ndv.getters.inlineExpressionEditorInput().clear().type(input); | ||
ndv.getters.inlineExpressionEditorOutput().should('have.text', output); | ||
ndv.actions.execute(); | ||
ndv.getters.outputDataContainer().find('[class*=value_]').should('exist'); | ||
ndv.getters.outputDataContainer().find('[class*=value_]').should('contain', output); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.