mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Fix template credential setup for nodes that dont have credentials (#8208)
Fix template credential setup for templates whose workflow includes nodes that require credentials but the workflow definition does not have them defined. Like for example https://n8n.io/workflows/1344-save-email-attachments-to-nextcloud/
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { CredentialsModal, MessageBox } from './modals';
|
||||
|
||||
export type TemplateTestData = {
|
||||
id: number;
|
||||
fixture: string;
|
||||
@@ -8,8 +10,15 @@ export const testData = {
|
||||
id: 1205,
|
||||
fixture: 'Test_Template_1.json',
|
||||
},
|
||||
templateWithoutCredentials: {
|
||||
id: 1344,
|
||||
fixture: 'Test_Template_2.json',
|
||||
},
|
||||
};
|
||||
|
||||
const credentialsModal = new CredentialsModal();
|
||||
const messageBox = new MessageBox();
|
||||
|
||||
export const getters = {
|
||||
continueButton: () => cy.getByTestId('continue-button'),
|
||||
skipLink: () => cy.get('a:contains("Skip")'),
|
||||
@@ -33,3 +42,23 @@ export const enableTemplateCredentialSetupFeatureFlag = () => {
|
||||
win.featureFlags.override('016_template_credential_setup', true);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Fills in dummy credentials for the given app name.
|
||||
*/
|
||||
export const fillInDummyCredentialsForApp = (appName: string) => {
|
||||
getters.createAppCredentialsButton(appName).click();
|
||||
credentialsModal.getters.editCredentialModal().find('input:first()').type('test');
|
||||
credentialsModal.actions.save(false);
|
||||
credentialsModal.actions.close();
|
||||
};
|
||||
|
||||
/**
|
||||
* Fills in dummy credentials for the given app name. Assumes
|
||||
* that a confirmation message box will be shown, which will be
|
||||
* handled.
|
||||
*/
|
||||
export const fillInDummyCredentialsForAppWithConfirm = (appName: string) => {
|
||||
fillInDummyCredentialsForApp(appName);
|
||||
messageBox.actions.cancel();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user