mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34:07 -08:00
work with nested menus
This commit is contained in:
parent
14c3d7a76f
commit
22790c39b4
|
@ -8,11 +8,22 @@ export const getHomeButton = () => cy.getByTestId('project-home-menu-item');
|
|||
export const getMenuItems = () => cy.getByTestId('project-menu-item');
|
||||
export const getAddProjectButton = () => {
|
||||
cy.getByTestId('universal-add').should('be.visible').click();
|
||||
return cy
|
||||
.getByTestId('navigation-menu-item')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Project")')
|
||||
.last();
|
||||
cy.getByTestId('universal-add')
|
||||
.find('.el-sub-menu__title')
|
||||
.invoke('attr', 'aria-describedby')
|
||||
.then((el) => cy.get(`[id="${el}"]`))
|
||||
.as('submenu');
|
||||
|
||||
cy.get('@submenu').within((submenu) =>
|
||||
cy
|
||||
.wrap(submenu)
|
||||
.getByTestId('navigation-menu-item')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Project")')
|
||||
.as('button'),
|
||||
);
|
||||
|
||||
return cy.get('@button');
|
||||
};
|
||||
|
||||
// export const getAddProjectButton = () =>
|
||||
|
|
|
@ -275,7 +275,7 @@ describe('Projects', { disableAutoLogin: true }, () => {
|
|||
cy.changeQuota('maxTeamProjects', -1);
|
||||
});
|
||||
|
||||
it.only('should filter credentials by project ID when creating new workflow or hard reloading an opened workflow', () => {
|
||||
it('should filter credentials by project ID when creating new workflow or hard reloading an opened workflow', () => {
|
||||
cy.signinAsOwner();
|
||||
cy.visit(workflowsPage.url);
|
||||
|
||||
|
|
|
@ -7,19 +7,28 @@ export class CredentialsPage extends BasePage {
|
|||
emptyListCreateCredentialButton: () => cy.getByTestId('empty-resources-list').find('button'),
|
||||
createCredentialButton: () => {
|
||||
cy.getByTestId('resource-add').should('be.visible').click();
|
||||
cy.getByTestId('resource-add')
|
||||
.find('.el-sub-menu__title')
|
||||
.invoke('attr', 'aria-describedby')
|
||||
.then((el) => cy.get(`[id="${el}"]`))
|
||||
.as('submenu');
|
||||
|
||||
cy.getByTestId('navigation-submenu')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Credential")')
|
||||
.last()
|
||||
cy.get('@submenu').within((submenu) => {
|
||||
cy.wrap(submenu)
|
||||
.find('[data-test-id="navigation-submenu"]')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Credential")')
|
||||
.as('child')
|
||||
.click();
|
||||
|
||||
.click();
|
||||
cy.get('@child')
|
||||
.find('[data-test-id="navigation-submenu-item"]')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Personal")')
|
||||
.as('button');
|
||||
});
|
||||
|
||||
return cy
|
||||
.getByTestId('navigation-submenu-item')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Personal")')
|
||||
.last();
|
||||
return cy.get('@button');
|
||||
},
|
||||
|
||||
// cy.getByTestId('resources-list-add'),
|
||||
|
|
|
@ -9,19 +9,51 @@ export class WorkflowsPage extends BasePage {
|
|||
searchBar: () => cy.getByTestId('resources-list-search'),
|
||||
createWorkflowButton: () => {
|
||||
cy.getByTestId('resource-add').should('be.visible').click();
|
||||
cy.getByTestId('resource-add')
|
||||
.find('.el-sub-menu__title')
|
||||
.invoke('attr', 'aria-describedby')
|
||||
.then((el) => cy.get(`[id="${el}"]`))
|
||||
.as('submenu');
|
||||
|
||||
cy.getByTestId('navigation-submenu')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Workflow")')
|
||||
.last()
|
||||
cy.get('@submenu').within((submenu) => {
|
||||
cy.wrap(submenu)
|
||||
.find('[data-test-id="navigation-submenu"]')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Workflow")')
|
||||
.as('child')
|
||||
.click();
|
||||
|
||||
.click();
|
||||
cy.get('@child')
|
||||
.find('[data-test-id="navigation-submenu-item"]')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Personal")')
|
||||
.as('button');
|
||||
});
|
||||
|
||||
return cy
|
||||
.getByTestId('navigation-submenu-item')
|
||||
.should('be.visible')
|
||||
.filter(':contains("Personal")')
|
||||
.first();
|
||||
return cy.get('@button');
|
||||
// cy.getByTestId('resource-add').should('be.visible').click();
|
||||
// cy.getByTestId('resource-add')
|
||||
// .find('.el-sub-menu__title')
|
||||
// .invoke('attr', 'aria-describedby')
|
||||
// .then((el) => cy.get(`[id="${el}"]`))
|
||||
// .as('submenu');
|
||||
|
||||
// cy.get('@submenu')
|
||||
// .getByTestId('navigation-submenu')
|
||||
// .should('be.visible')
|
||||
// .filter(':contains("Workflow")')
|
||||
// .click();
|
||||
|
||||
// cy.get('@submenu').within((submenu) =>
|
||||
// cy
|
||||
// .wrap(submenu)
|
||||
// .getByTestId('navigation-submenu-item')
|
||||
// .should('be.visible')
|
||||
// .filter(':contains("Personal")')
|
||||
// .as('button'),
|
||||
// );
|
||||
|
||||
// return cy.get('@button');
|
||||
},
|
||||
workflowCards: () => cy.getByTestId('resources-list-item'),
|
||||
workflowCard: (workflowName: string) =>
|
||||
|
|
Loading…
Reference in a new issue