Skip to content

Commit

Permalink
Merge pull request #7192 from NickLaMuro/cypress-fix-menu-spec
Browse files Browse the repository at this point in the history
Fix menu.spec.js
  • Loading branch information
himdel authored Jul 20, 2020
2 parents a00a411 + 95de4e6 commit 382d0d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
16 changes: 6 additions & 10 deletions cypress/integration/ui/menu.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ describe('Menu', () => {
expect(menu[2].items[1].items[3].title).to.equal('Virtual Machines');
});

cy.menu('Overview')
cy.menu('Overview', 'Dashboard')
.get('widget-wrapper');

cy.menu('Services')
cy.menu('Overview', 'Reports')
.expect_explorer_title('All Saved Reports');

cy.menu('Services', 'My Services')
.expect_explorer_title('Active Services');

cy.menu('Compute')
cy.menu('Compute', 'Clouds', 'Providers')
.expect_show_list_title('Cloud Providers');

cy.menu('Overview', 'Reports')
.expect_explorer_title('All Saved Reports');

cy.menu('Compute', 'Infrastructure', 'Virtual Machines')
.expect_explorer_title('All VMs & Templates');

// test it remembers the last Overview > * screen used
cy.menu('Overview')
.expect_explorer_title('All Saved Reports');
});

it.skip("all menu items lead to non-error screens", () => {
Expand Down
1 change: 1 addition & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Cypress.Commands.add("menu", (...items) => {

// cy.menuItems() - returns an array of top level menu items with {title, href, items (array of children)}
Cypress.Commands.add("menuItems", () => {
cy.get('#main-menu nav.primary'); // Wait for menu to appear
return cy.window().then((window) => window.ManageIQ.menu);
});

Expand Down

0 comments on commit 382d0d1

Please sign in to comment.