mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix: Add commands for tab interception and visiting (no-changelog) (#15866)
This commit is contained in:
@@ -240,3 +240,18 @@ Cypress.Commands.add('resetDatabase', () => {
|
||||
admin: INSTANCE_ADMIN,
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('interceptNewTab', () => {
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, 'open').as('windowOpen');
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('visitInterceptedTab', () => {
|
||||
cy.get('@windowOpen')
|
||||
.should('have.been.called')
|
||||
.then((stub: any) => {
|
||||
const url = stub.firstCall.args[0];
|
||||
cy.visit(url);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -86,6 +86,8 @@ declare global {
|
||||
>;
|
||||
resetDatabase(): void;
|
||||
setAppDate(targetDate: number | Date): void;
|
||||
interceptNewTab(): Chainable<void>;
|
||||
visitInterceptedTab(): Chainable<void>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user