Skip to content

Commit 50907f6

Browse files
authored
Merge pull request #8892 from GilbertCherrie/fix_dashboard_cypress_tests
Fixed dashboard cypress tests
2 parents 292fdf3 + 451e95b commit 50907f6

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

cypress/e2e/ui/Overview/dashboard.cy.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Overview > Dashboard Tests', () => {
2727
});
2828
});
2929

30-
it('Can add and remove a widget', () => {
30+
it('Add and remove a widget', () => {
3131
const newCards = [];
3232
let newCard = '';
3333

@@ -70,7 +70,7 @@ describe('Overview > Dashboard Tests', () => {
7070
});
7171
});
7272

73-
it('Can minimize a widget', () => {
73+
it('Minimize a widget', () => {
7474
cy.get('.card-pf').then((cards) => {
7575
cy.get(cards[0]).then((card) => {
7676
cy.get(card.children()[0].children[0].children[0]).click().then(() => {
@@ -83,29 +83,26 @@ describe('Overview > Dashboard Tests', () => {
8383
});
8484
});
8585

86-
// TODO: Fix the maximize test
87-
// cy.get('.card-pf').then((cards) => {
88-
// cy.get(cards[0]).then((card) => {
89-
// cy.get(card.children()[0].children[0].children[0]).click().then(() => {
90-
// cy.get('.bx--overflow-menu-options').then((menuItems) => {
91-
// cy.get(menuItems.children()[1]).click().then(() => {
92-
// expect(card.children()[1].style.display).to.equal('block');
93-
// });
94-
// });
95-
// });
96-
// });
97-
// });
86+
// TODO: Fix the maximize test
87+
// cy.get('.card-pf').then((cards) => {
88+
// cy.get(cards[0]).then((card) => {
89+
// cy.get(card.children()[0].children[0].children[0]).click().then(() => {
90+
// cy.get('.bx--overflow-menu-options').then((menuItems) => {
91+
// cy.get(menuItems.children()[1]).click().then(() => {
92+
// expect(card.children()[1].style.display).to.equal('block');
93+
// });
94+
// });
95+
// });
96+
// });
97+
// });
9898
});
9999

100-
it('Can zoom a widget', () => {
101-
cy.get('#lightbox-panel').then((div) => {
102-
expect(div[0].style.display).to.equal('');
103-
});
100+
it('Zoom a widget', () => {
104101
cy.get('.card-pf').then((cards) => {
105102
cy.get(cards[0]).then((card) => {
106103
cy.get(card.children()[0].children[0].children[0]).click().then(() => {
107104
cy.get('.bx--overflow-menu-options').then((menuItems) => {
108-
cy.get(menuItems.children()[2]).click().then(() => {
105+
cy.get(menuItems.children()[4]).click().then(() => {
109106
cy.get('#zoomed_chart_div').contains(defaultCards[0]);
110107
cy.get('#lightbox-panel').then((div) => {
111108
expect(div[0].style.display).to.equal('block');
@@ -117,14 +114,14 @@ describe('Overview > Dashboard Tests', () => {
117114
});
118115
});
119116

120-
it('Can refresh a widget', () => {
117+
it('Refresh a widget', () => {
121118
cy.get('.card-pf').then((cards) => {
122119
cy.get(cards[0]).then((card) => {
123120
const newId = cards[0].children[1].id.split('_')[1].replace('w', '');
124121
cy.intercept('GET', `/dashboard/widget_chart_data/${newId}`).as('get');
125122
cy.get(card.children()[0].children[0].children[0]).click().then(() => {
126123
cy.get('.bx--overflow-menu-options').then((menuItems) => {
127-
cy.get(menuItems.children()[3]).click().then(() => {
124+
cy.get(menuItems.children()[5]).click().then(() => {
128125
cy.wait('@get').then((getCall) => {
129126
expect(getCall.state).to.equal('Complete');
130127
expect([200, 304]).to.include(getCall.response.statusCode);

0 commit comments

Comments
 (0)