mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 21:19:43 -08:00
2854a0cf46
Allow overriding theme through query params.. to be able to override it from preview iframe in webcomponent Github issue / Community forum post (link here to close automatically):
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { BasePage } from './base';
|
|
|
|
export class TemplatesPage extends BasePage {
|
|
url = '/templates';
|
|
|
|
getters = {
|
|
};
|
|
|
|
actions = {
|
|
openOnboardingFlow: (id: number, name: string , workflow: object) => {
|
|
const apiResponse = {
|
|
id,
|
|
name,
|
|
workflow,
|
|
};
|
|
cy.intercept('POST', '/rest/workflows').as('createWorkflow');
|
|
cy.intercept('GET', `https://api.n8n.io/api/workflows/templates/${id}`, {
|
|
statusCode: 200,
|
|
body: apiResponse,
|
|
}).as('getTemplate');
|
|
cy.intercept('GET', 'rest/workflows/**').as('getWorkflow');
|
|
|
|
cy.visit(`/workflows/onboarding/${id}`);
|
|
|
|
cy.wait('@getTemplate');
|
|
cy.wait(['@createWorkflow', '@getWorkflow']);
|
|
},
|
|
|
|
importTemplate: (id: number, name: string, workflow: object) => {
|
|
const apiResponse = {
|
|
id,
|
|
name,
|
|
workflow,
|
|
};
|
|
cy.intercept('GET', `https://api.n8n.io/api/workflows/templates/${id}`, {
|
|
statusCode: 200,
|
|
body: apiResponse,
|
|
}).as('getTemplate');
|
|
cy.intercept('GET', 'rest/workflows/**').as('getWorkflow');
|
|
|
|
cy.visit(`/workflows/templates/${id}`);
|
|
|
|
cy.wait('@getTemplate');
|
|
cy.wait( '@getWorkflow');
|
|
}
|
|
}
|
|
}
|
|
|