Skip to content

Commit

Permalink
Set Test Isolation as default
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 a92b27e commit 48a9c24
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 26 deletions.
4 changes: 1 addition & 3 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ module.exports = defineConfig({
},
baseUrl: 'http://localhost:3000/pd-live-react',
specPattern: 'cypress/e2e/**/*.spec.{js,ts,jsx,tsx}',
// Cypress 12 introduces Test Isolation by default which breaks our current tests
// https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
testIsolation: false,
testIsolation: true,
},
});
5 changes: 1 addition & 4 deletions cypress/e2e/Incidents/incidents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
selectAlert,
} from '../../support/util/common';

describe('Manage Open Incidents', { failFast: { enabled: true }, testIsolation: true }, () => {
describe('Manage Open Incidents', { failFast: { enabled: true } }, () => {
// We use beforeEach as each test will reload/clear the session
beforeEach(() => {
acceptDisclaimer();
Expand Down Expand Up @@ -316,9 +316,6 @@ describe('Manage Open Incidents', { failFast: { enabled: true }, testIsolation:
cy.get('[data-popper-placement="bottom"]').should('contain', 'Created At');
cy.get('[data-popper-placement="bottom"]').should('contain', 'Status');
cy.get('[data-popper-placement="bottom"]').should('contain', 'Summary');

// Reset hover state
cy.get('body').realHover({ position: 'topLeft' });
});

it('Split/move alert from one incident to a new incident', () => {
Expand Down
13 changes: 1 addition & 12 deletions cypress/e2e/Query/query.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
registerLocale('en-GB', gb);
moment.locale('en-GB');

describe('Query Incidents', { failFast: { enabled: true }, testIsolation: true }, () => {
describe('Query Incidents', { failFast: { enabled: true } }, () => {
beforeEach(() => {
acceptDisclaimer();
manageIncidentTableColumns('remove', ['latest_note']);
Expand Down Expand Up @@ -54,9 +54,6 @@ describe('Query Incidents', { failFast: { enabled: true }, testIsolation: true }
});
}
});

// Reset query for next test - both high and low-urgency triggered, ackd and resolved incidents
cy.get('.query-urgency-low-button').check({ force: true });
});

it('Query for triggered incidents only', () => {
Expand Down Expand Up @@ -86,11 +83,6 @@ describe('Query Incidents', { failFast: { enabled: true }, testIsolation: true }
cy.get('.query-status-resolved-button').check({ force: true });
waitForIncidentTable();
checkIncidentCellIconAllRows('Status', 'fa-circle-check');

// Reset query for next test
cy.get('.query-status-triggered-button').check({ force: true });
cy.get('.query-status-acknowledged-button').check({ force: true });
cy.get('.query-status-resolved-button').uncheck({ force: true });
});

it('Query for high urgency incidents only', () => {
Expand All @@ -105,9 +97,6 @@ describe('Query Incidents', { failFast: { enabled: true }, testIsolation: true }
cy.get('.query-urgency-low-button').check({ force: true });
waitForIncidentTable();
checkIncidentCellContentAllRows('Urgency', ' Low');

// Reset query for next test
cy.get('.query-urgency-high-button').check({ force: true });
});

priorityNames.forEach((currentPriority) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/Search/search.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
updateFuzzySearch,
} from '../../support/util/common';

describe('Search Incidents', { failFast: { enabled: true }, testIsolation: true }, () => {
describe('Search Incidents', { failFast: { enabled: true } }, () => {
beforeEach(() => {
acceptDisclaimer();
waitForIncidentTable();
Expand Down
12 changes: 8 additions & 4 deletions cypress/e2e/Settings/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
checkActionAlertsModalContent,
} from '../../support/util/common';

describe('Manage Settings', { failFast: { enabled: true }, testIsolation: true }, () => {
describe('Manage Settings', { failFast: { enabled: true } }, () => {
const localeCode = 'en-US';
moment.locale(localeCode);

Expand All @@ -44,10 +44,14 @@ describe('Manage Settings', { failFast: { enabled: true }, testIsolation: true }
.should('contain', expectedIncidentDateFormat);
});

// 1 Day is the default, so reset to that after this test
['3 Days', '1 Week', '2 Weeks', '1 Month', '3 Months', '180 Days', '1 Day'].forEach((tenor) => {
// 1 Day is the default
['Today', '1 Day', '3 Days', '1 Week', '2 Weeks', '1 Month', '3 Months', '180 Days'].forEach((tenor) => {
it(`Update default since date lookback to ${tenor}`, () => {
const [sinceDateNum, sinceDateTenor] = tenor.split(' ');
let [sinceDateNum, sinceDateTenor] = tenor.split(' ');
if (tenor === 'Today') {
sinceDateNum = '0';
sinceDateTenor = 'Day';
}
const expectedDate = moment().subtract(Number(sinceDateNum), sinceDateTenor).format('L');
updateDefaultSinceDateLookback(tenor);
updateUserLocale('English (United States)', 'Settings', 'Updated user profile settings');
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {

import packageConfig from '../../package.json';

describe('Integration User Token', { failFast: { enabled: true }, testIsolation: true }, () => {
describe('Integration User Token', { failFast: { enabled: true } }, () => {
before(() => {
expect(Cypress.env('PD_USER_TOKEN')).to.be.a('string');
cy.intercept('GET', 'https://api.pagerduty.com/users/me').as('getCurrentUser');
Expand All @@ -28,7 +28,7 @@ describe('Integration User Token', { failFast: { enabled: true }, testIsolation:
});
});

describe('PagerDuty Live', { failFast: { enabled: true }, testIsolation: true }, () => {
describe('PagerDuty Live', { failFast: { enabled: true } }, () => {
beforeEach(() => {
acceptDisclaimer();
waitForIncidentTable();
Expand Down

0 comments on commit 48a9c24

Please sign in to comment.