-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Update e2e tests to run on new canvas (no-changelog) #12784
Open
alexgrozav
wants to merge
19
commits into
master
Choose a base branch
from
cat-539-switch-e2e-tests-to-run-on-new-canvas
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+199
−1,548
Open
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5d7da46
feat: Update e2e tests to run on new canvas (no-changelog)
alexgrozav 40a349b
fix: update all script to run on v2
alexgrozav ec7ccd3
chore: unused import
alexgrozav e182430
fix: add missing eslint-disable
alexgrozav bbbada5
fix: remove tabindex
alexgrozav 996e50c
test: remove skipped tests
alexgrozav 8aea62a
fix: change e2e tests node view version in ci
alexgrozav 5912f6d
ci: remove node view version input
alexgrozav db638f2
Merge branch 'master' into cat-539-switch-e2e-tests-to-run-on-new-canvas
alexgrozav 76b52eb
Merge remote-tracking branch 'origin/master' into cat-539-switch-e2e-…
alexgrozav 78c9cd4
Merge remote-tracking branch 'origin/master' into cat-539-switch-e2e-…
alexgrozav 6fd04ae
fix: fix useKeyBindings error in e2e
alexgrozav 4c9fa4b
chore: remove .only
alexgrozav 75f4541
test: add test for undo/redo moving nodes
alexgrozav b34f58c
test: add more tests back
alexgrozav 2298ae3
test: add back mapping test
alexgrozav b74caee
chore: linting issues
alexgrozav a8ef0a8
fix: fix credential loading in demo route
alexgrozav 3b17c24
test: remove test for unknown nodes connections
alexgrozav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { BACKEND_BASE_URL } from '../constants'; | ||
import { NDV, WorkflowPage } from '../pages'; | ||
import { getVisibleSelect } from '../utils'; | ||
|
||
export const waitForWebhook = 500; | ||
|
||
export interface SimpleWebhookCallOptions { | ||
method: string; | ||
webhookPath: string; | ||
responseCode?: number; | ||
respondWith?: string; | ||
executeNow?: boolean; | ||
responseData?: string; | ||
authentication?: string; | ||
} | ||
|
||
const workflowPage = new WorkflowPage(); | ||
const ndv = new NDV(); | ||
|
||
export const simpleWebhookCall = (options: SimpleWebhookCallOptions) => { | ||
const { | ||
authentication, | ||
method, | ||
webhookPath, | ||
responseCode, | ||
respondWith, | ||
responseData, | ||
executeNow = true, | ||
} = options; | ||
|
||
workflowPage.actions.addInitialNodeToCanvas('Webhook'); | ||
workflowPage.actions.openNode('Webhook'); | ||
|
||
cy.getByTestId('parameter-input-httpMethod').click(); | ||
getVisibleSelect().find('.option-headline').contains(method).click(); | ||
cy.getByTestId('parameter-input-path') | ||
.find('.parameter-input') | ||
.find('input') | ||
.clear() | ||
.type(webhookPath); | ||
|
||
if (authentication) { | ||
cy.getByTestId('parameter-input-authentication').click(); | ||
getVisibleSelect().find('.option-headline').contains(authentication).click(); | ||
} | ||
|
||
if (responseCode) { | ||
cy.get('.param-options').click(); | ||
getVisibleSelect().contains('Response Code').click(); | ||
cy.get('.parameter-item-wrapper > .parameter-input-list-wrapper').children().click(); | ||
getVisibleSelect().contains('201').click(); | ||
} | ||
|
||
if (respondWith) { | ||
cy.getByTestId('parameter-input-responseMode').click(); | ||
getVisibleSelect().find('.option-headline').contains(respondWith).click(); | ||
} | ||
|
||
if (responseData) { | ||
cy.getByTestId('parameter-input-responseData').click(); | ||
getVisibleSelect().find('.option-headline').contains(responseData).click(); | ||
} | ||
|
||
const callEndpoint = (fn: (response: Cypress.Response<unknown>) => void) => { | ||
cy.request(method, `${BACKEND_BASE_URL}/webhook-test/${webhookPath}`).then(fn); | ||
}; | ||
|
||
if (executeNow) { | ||
ndv.actions.execute(); | ||
cy.wait(waitForWebhook); | ||
|
||
callEndpoint((response) => { | ||
expect(response.status).to.eq(200); | ||
ndv.getters.outputPanel().contains('headers'); | ||
}); | ||
} | ||
|
||
return { | ||
callEndpoint, | ||
}; | ||
}; |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted out of webhooks tests. The tests were running multiple times due to importing.