diff --git a/cypress/e2e/Search/search.spec.js b/cypress/e2e/Search/search.spec.js index e3a8f180b..89d0bd7fc 100644 --- a/cypress/e2e/Search/search.spec.js +++ b/cypress/e2e/Search/search.spec.js @@ -26,7 +26,6 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { it('Search for `Service A1` returns incidents only on Service A1', () => { cy.get('#global-search-input').clear().type('Service A1'); - cy.wait(1000); cy.get('[data-incident-header="Service"]').each(($el) => { cy.wrap($el).should('have.text', 'Service A1'); }); @@ -39,21 +38,18 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { cy.get(`@selectedIncidentId_${incidentIdx}`).then((incidentId) => { cy.get('#global-search-input').clear().type(incidentId); }); - cy.wait(1000); cy.get('.selected-incidents-badge').then(($el) => { const text = $el.text().split(' ')[0]; expect(text).to.equal('1/1'); }); // Click the select all checkbox twice to unselect all cy.get('#global-search-input').clear(); - cy.wait(1000); selectAllIncidents(); selectAllIncidents(); }); it('Search for `zzzzzz` returns no incidents', () => { cy.get('#global-search-input').clear().type('zzzzzz'); - cy.wait(1000); cy.get('.empty-incidents-badge').should('be.visible'); cy.get('#global-search-input').clear(); }); @@ -67,7 +63,6 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { checkActionAlertsModalContent('have been updated with a note'); selectIncident(incidentIdx); cy.get('#global-search-input').clear().type('foobar'); - cy.wait(1000); cy.get('[data-incident-header="Latest Note"]').each(($el) => { // cy.wrap($el).should('have.text', 'foobar'); cy.wrap($el) @@ -88,7 +83,6 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { it('Fuzzy search disabled does not return incident with note fuzzy match', () => { cy.get('#global-search-input').clear().type('foobaz'); - cy.wait(1000); cy.get('.empty-incidents-badge').should('be.visible'); cy.get('#global-search-input').clear(); }); @@ -100,7 +94,6 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { cy.get(`@selectedIncidentId_${incidentIdx}`).then(() => { cy.get('#global-search-input').clear().type('foobaz'); - cy.wait(1000); cy.get('[data-incident-header="Latest Note"]').each(($el) => { cy.wrap($el) .find('*') @@ -121,7 +114,6 @@ describe('Search Incidents', { failFast: { enabled: false } }, () => { it('Column filtering on Service column for `A1` returns incidents only on Service A1', () => { cy.get('#service-filter-icon').realHover(); cy.get('input[placeholder="Filter"]').filter(':visible').click().type('A1'); - cy.wait(1000); cy.get('[data-incident-header="Service"]').each(($el) => { cy.wrap($el).should('have.text', 'Service A1'); }); diff --git a/cypress/support/util/common.js b/cypress/support/util/common.js index bfc24090b..addcb7631 100644 --- a/cypress/support/util/common.js +++ b/cypress/support/util/common.js @@ -1,4 +1,3 @@ -/* eslint-disable cypress/no-unnecessary-waiting */ /* eslint-disable cypress/unsafe-to-chain-command */ /* eslint-disable import/prefer-default-export */ import { @@ -22,6 +21,7 @@ export const acceptDisclaimer = () => { export const waitForIncidentTable = () => { // Ref: https://stackoverflow.com/a/60065672/6480733 + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); // Required for query debounce cy.get('#incident-table-ctr', { timeout: 60000 }).should('be.visible'); // will move on to next command even if table is not scrollable @@ -53,12 +53,10 @@ export const checkNoIncidentsSelected = () => { }; export const checkActionAlertsModalContent = (content) => { - cy.wait(2000); cy.get('.chakra-alert__title').contains(content, { timeout: 10000 }); }; export const checkPopoverContent = (incidentId, incidentHeader, content) => { - cy.wait(2000); cy.get( `[data-incident-header="${incidentHeader}"][data-incident-cell-id="${incidentId}"]`, ).within(() => { @@ -68,14 +66,12 @@ export const checkPopoverContent = (incidentId, incidentHeader, content) => { }; export const checkIncidentCellContent = (incidentId, incidentHeader, content) => { - cy.wait(2000); cy.get(`[data-incident-header="${incidentHeader}"][data-incident-cell-id="${incidentId}"]`) .should('be.visible') .contains(content); }; export const checkIncidentCellContentAllRows = (incidentHeader, content) => { - cy.wait(2000); cy.get('.incident-table-fixed-list').scrollTo('top', { ensureScrollable: true }); cy.get('.incident-table-fixed-list > div').then(($tbody) => { const visibleIncidentCount = $tbody.find('[role="row"]').length; @@ -101,7 +97,6 @@ export const checkIncidentCellIcon = (incidentIdx, incidentHeader, icon) => { }; export const checkIncidentCellIconAllRows = (incidentHeader, icon) => { - cy.wait(2000); cy.get('.incident-table-fixed-list > div').then(($tbody) => { const visibleIncidentCount = $tbody.find('[role="row"]').length; for (let incidentIdx = 0; incidentIdx < visibleIncidentCount; incidentIdx++) { @@ -111,7 +106,6 @@ export const checkIncidentCellIconAllRows = (incidentHeader, icon) => { }; export const checkIncidentCellContentHasLink = (incidentId, incidentHeader, text, link) => { - cy.wait(2000); cy.get(`[data-incident-header="${incidentHeader}"][data-incident-cell-id="${incidentId}"]`) .should('be.visible') .contains('a', text) @@ -144,8 +138,10 @@ export const escalate = (escalationLevel) => { export const reassign = (assignment) => { cy.get('#incident-action-reassign-button').click(); cy.get('#reassign-select').click(); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(200); cy.contains('.react-select__option', assignment).click({ force: true }); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(200); cy.get('#reassign-button').click({ force: true }); }; @@ -198,6 +194,7 @@ export const addNote = (note) => { }; const toggleRunAction = () => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); // Unsure why we can't find DOM of action without wait cy.get('.incident-action-run-action-button').click(); };