From 93249906ded150d8fcd6c3eee172b6eda799ff6e Mon Sep 17 00:00:00 2001 From: Gilbert Cherrie Date: Fri, 14 Jul 2023 17:01:38 -0400 Subject: [PATCH] Add maximize test --- cypress/e2e/ui/Overview/dashboard.cy.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/ui/Overview/dashboard.cy.js b/cypress/e2e/ui/Overview/dashboard.cy.js index 424e9dad6d1..5d614b4ad4a 100644 --- a/cypress/e2e/ui/Overview/dashboard.cy.js +++ b/cypress/e2e/ui/Overview/dashboard.cy.js @@ -84,7 +84,7 @@ describe('Overview > Dashboard Tests', () => { }); }); - it('Can minimize a widget', () => { + it('Can minimize / maximize a widget', () => { cy.get('.card-pf').then((cards) => { const nums = [...Array(cards.length).keys()]; nums.forEach((index) => { @@ -101,6 +101,22 @@ describe('Overview > Dashboard Tests', () => { } }); }); + cy.get('.card-pf').then((cards) => { + const nums = [...Array(cards.length).keys()]; + nums.forEach((index) => { + if (cards[index].firstChild.innerText === newCard) { + cy.get(cards[index]).then((card) => { + cy.get(card.children()[0].children[0].children[0]).click().then(() => { + cy.get('.bx--overflow-menu-options').then((menuItems) => { + cy.get(menuItems.children()[1]).click().then(() => { + expect(card.children()[1].style.display).to.equal('block'); + }); + }); + }); + }); + } + }); + }); }); it('Can zoom a widget', () => { @@ -141,7 +157,7 @@ describe('Overview > Dashboard Tests', () => { cy.wait(5000); cy.get('@get').then((getCall) => { expect(getCall.state).to.equal('Complete'); - expect(getCall.response).to.include({statusCode: 304}); + expect([200, 304]).to.include(getCall.response.statusCode); }); }); });