Skip to content

Commit 400ce00

Browse files
Removed time based wait statements
1 parent 9324990 commit 400ce00

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,12 @@ describe('Overview > Dashboard Tests', () => {
4141
});
4242
});
4343

44-
cy.wait(5000);
45-
cy.get('.card-pf').then((cards) => {
46-
expect(cards.length).to.equal(defaultCards.length + 2);
47-
});
44+
cy.get('.card-pf').its('length').should('eq', defaultCards.length + 2);
4845

4946
cy.intercept('POST', '/dashboard/reset_widgets').as('post');
5047
cy.get('.miq-toolbar-group > .btn').click();
51-
cy.wait(5000);
5248

53-
cy.get('@post').then((getCall) => {
49+
cy.wait('@post').then((getCall) => {
5450
expect(getCall.state).to.equal('Complete');
5551
expect(getCall.response).to.include({
5652
statusCode: 200,
@@ -71,7 +67,7 @@ describe('Overview > Dashboard Tests', () => {
7167
cy.get('.scrollable-options').then((list) => {
7268
newCard = list.children()[0].innerText.trim();
7369
cy.get(list.children()[0]).click().then(() => {
74-
cy.wait(5000);
70+
cy.get('.card-pf').its('length').should('eq', defaultCards.length + 1);
7571
cy.get('.card-pf').then((cards) => {
7672
const nums = [...Array(cards.length).keys()];
7773
nums.forEach((index) => {
@@ -154,8 +150,7 @@ describe('Overview > Dashboard Tests', () => {
154150
cy.get(card.children()[0].children[0].children[0]).click().then(() => {
155151
cy.get('.bx--overflow-menu-options').then((menuItems) => {
156152
cy.get(menuItems.children()[3]).click().then(() => {
157-
cy.wait(5000);
158-
cy.get('@get').then((getCall) => {
153+
cy.wait('@get').then((getCall) => {
159154
expect(getCall.state).to.equal('Complete');
160155
expect([200, 304]).to.include(getCall.response.statusCode);
161156
});
@@ -177,7 +172,7 @@ describe('Overview > Dashboard Tests', () => {
177172
cy.get(card.children()[0].children[0].children[0]).click().then(() => {
178173
cy.get('.bx--overflow-menu-options').then((menuItems) => {
179174
cy.get(menuItems.children()[0]).click().then(() => {
180-
cy.wait(10000);
175+
cy.get('.card-pf').its('length').should('eq', defaultCards.length);
181176
cy.get('.card-pf').then((cards) => {
182177
const nums = [...Array(cards.length).keys()];
183178
nums.forEach((index) => {

0 commit comments

Comments
 (0)