Skip to content

Commit

Permalink
Enable Test Isolation for incidents.spec.js
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Reynolds <[email protected]>
  • Loading branch information
gsreynolds committed Dec 6, 2023
1 parent 00be3fe commit 6d3dcad
Showing 1 changed file with 35 additions and 19 deletions.
54 changes: 35 additions & 19 deletions cypress/e2e/Incidents/incidents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import {
selectAlert,
} from '../../support/util/common';

describe('Manage Open Incidents', { failFast: { enabled: true } }, () => {
before(() => {
describe('Manage Open Incidents', { failFast: { enabled: true }, testIsolation: true }, () => {
// We use beforeEach as each test will reload/clear the session
beforeEach(() => {
acceptDisclaimer();
const columns = [
['Responders', 'responders'],
Expand All @@ -41,23 +42,6 @@ describe('Manage Open Incidents', { failFast: { enabled: true } }, () => {
waitForIncidentTable();
});

// We use beforeEach as each test will reload/clear the session
beforeEach(() => {
// Handle failing tests by clearing cache
if (cy.state('test').currentRetry() > 1) {
acceptDisclaimer();
const columns = [
['Responders', 'responders'],
['Latest Log Entry Type', 'latest_log_entry_type'],
];
manageIncidentTableColumns(
'add',
columns.map((column) => column[1]),
);
}
waitForIncidentTable();
});

afterEach(() => {
checkNoIncidentsSelected();
});
Expand Down Expand Up @@ -338,6 +322,22 @@ describe('Manage Open Incidents', { failFast: { enabled: true } }, () => {
});

it('Split/move alert from one incident to a new incident', () => {
// Remove the other columns to make it easier to see the alert count without scrolling
const removeColumns = [
['Responders', 'responders'],
['Latest Log Entry Type', 'latest_log_entry_type'],
];
manageIncidentTableColumns(
'remove',
removeColumns.map((column) => column[1]),
);

const addColumns = [['Num Alerts', 'num_alerts']];
manageIncidentTableColumns(
'add',
addColumns.map((column) => column[1]),
);

const incidentIdx = 0;

cy.get(
Expand All @@ -364,6 +364,22 @@ describe('Manage Open Incidents', { failFast: { enabled: true } }, () => {
});

it('Merge incidents then split alerts to their own incidents', () => {
// Remove the other columns to make it easier to see the alert count without scrolling
const removeColumns = [
['Responders', 'responders'],
['Latest Log Entry Type', 'latest_log_entry_type'],
];
manageIncidentTableColumns(
'remove',
removeColumns.map((column) => column[1]),
);

const addColumns = [['Num Alerts', 'num_alerts']];
manageIncidentTableColumns(
'add',
addColumns.map((column) => column[1]),
);

const targetIncidentIdx = 0;
selectIncident(targetIncidentIdx);
selectIncident(targetIncidentIdx + 1);
Expand Down

0 comments on commit 6d3dcad

Please sign in to comment.