mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
test(editor): Fix flaky e2e tests (#4779)
* test(editor): Fix default-owner and credentials saving e2e specs * test(editor): fix webhook node test * test(editor): add cy command for browser permissions * test(editor): add cy command for reading clipboard * Fix 3-default-owner spec * Resolve review comments * Merge spec * Fix http node and expression editor modal specs * Add optional param to credentials modal saving action to wait for the test endpoint * Improve sidebar items clicking and increase credentials saving timeout * Rename http e2e spec to fix ordering * Fix pasting and copying of nodes e2e spec * Make sure to only access error.cause if it exists * Wait longer for the keyboard press * Make sure to focus the body when typing * Try type delay * Use meta key based on the running platform * Fix flaky workflowTagElements getter Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
This commit is contained in:
@@ -129,6 +129,18 @@ Cypress.Commands.add('setupOwner', (payload) => {
|
||||
cy.task('setup-owner', payload);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('grantBrowserPermissions', (...permissions: string[]) => {
|
||||
if(Cypress.isBrowser('chrome')) {
|
||||
cy.wrap(Cypress.automation('remote:debugger:protocol', {
|
||||
command: 'Browser.grantPermissions',
|
||||
params: {
|
||||
permissions,
|
||||
origin: window.location.origin,
|
||||
},
|
||||
}));
|
||||
}
|
||||
});
|
||||
Cypress.Commands.add('readClipboard', () => cy.window().its('navigator.clipboard').invoke('readText'));
|
||||
Cypress.Commands.add('paste', { prevSubject: true }, (selector, pastePayload) => {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event
|
||||
cy.wrap(selector).then($destination => {
|
||||
|
||||
Reference in New Issue
Block a user