Skip to content

Commit

Permalink
Merge pull request #78 from PagerDuty/release/0.8.0-beta.0
Browse files Browse the repository at this point in the history
[Release] v0.8.0 beta.0
  • Loading branch information
gsreynolds authored Jun 22, 2023
2 parents 96c8682 + 699aeb7 commit 012b5ec
Show file tree
Hide file tree
Showing 138 changed files with 11,569 additions and 8,947 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
},
plugins: ['react', 'prettier', 'cypress'],
rules: {
'max-len': [WARN, { code: 100, ignorePattern: '^import\\W.*', ignoreTrailingComments: true }],
'max-len': [WARN, { code: 120, ignorePattern: '^import\\W.*', ignoreTrailingComments: true }],
'object-curly-newline': [
WARN,
{ ObjectPattern: { multiline: true, minProperties: 1 }, ImportDeclaration: 'always' },
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The following scripts have been created to run unit, component, and integration

Please note that running integration tests will require environment variable `REACT_APP_PD_USER_TOKEN` set.

The integration tests also assume the PagerDuty account associated with the above user token has been setup with the following [Terraform environment](https://github.com/giranm/pd-live-integration-test-environment).
The integration tests also assume the PagerDuty account associated with the above user token has been setup with the following [Terraform environment](https://github.com/pagerduty/pd-live-integration-test-environment).

## Versioning & Release

Expand Down
23 changes: 16 additions & 7 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
const { defineConfig } = require('cypress')
const dotenv = require('dotenv');
const cypressFailFast = require('cypress-fail-fast/plugin');
const { defineConfig } = require("cypress");
const dotenv = require("dotenv");
const cypressFailFast = require("cypress-fail-fast/plugin");

module.exports = defineConfig({
video: false,
viewportWidth: 1920,
viewportHeight: 1080,
defaultCommandTimeout: 15000,
retries: 3,

e2e: {
setupNodeEvents(on, config) {
dotenv.config();
cypressFailFast(on, config);
config.env.PD_USER_TOKEN = process.env.REACT_APP_PD_USER_TOKEN;
return config;
},
baseUrl: 'http://localhost:3000/pd-live-react',
specPattern: 'cypress/e2e/**/*.spec.{js,ts,jsx,tsx}',
baseUrl: "http://localhost:3000/pd-live-react",
specPattern: "cypress/e2e/**/*.spec.{js,ts,jsx,tsx}",
},

component: {
setupNodeEvents(on, config) {},
specPattern: 'src/**/*.spec.{js,ts,jsx,tsx}',
specPattern: "src/**/*.spec.{js,ts,jsx,tsx}",
},

component: {
devServer: {
framework: "create-react-app",
bundler: "webpack",
},
},
})
});
36 changes: 20 additions & 16 deletions cypress/e2e/Incidents/incidents.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ import {
runResponsePlay,
checkActionAlertsModalContent,
checkIncidentCellContent,
activateButton,
deactivateButton,
// activateButton,
// deactivateButton,
priorityNames,
} from '../../support/util/common';

describe('Manage Open Incidents', { failFast: { enabled: false } }, () => {
before(() => {
acceptDisclaimer();
priorityNames.forEach((currentPriority) => {
activateButton(`query-priority-${currentPriority}-button`);
});
// priorityNames.forEach((currentPriority) => {
// activateButton(`query-priority-${currentPriority}-button`);
// });
waitForIncidentTable();
});

Expand All @@ -37,17 +37,17 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => {
if (cy.state('test').currentRetry() > 1) {
acceptDisclaimer();
}
priorityNames.forEach((currentPriority) => {
activateButton(`query-priority-${currentPriority}-button`);
});
// priorityNames.forEach((currentPriority) => {
// activateButton(`query-priority-${currentPriority}-button`);
// });
waitForIncidentTable();
});

it('Select all incidents', () => {
selectAllIncidents();
cy.get('.selected-incidents-badge').then(($el) => {
const text = $el.text();
const incidentNumbers = text.split('/');
const incidentNumbers = text.split(' ')[0].split('/');
expect(incidentNumbers[0]).to.equal(incidentNumbers[1]);
});
// Unselect all incidents for the next run
Expand Down Expand Up @@ -88,7 +88,8 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => {
for (let escalationLevel = 1; escalationLevel < 4; escalationLevel++) {
it(`Escalate singular incident to level: ${escalationLevel}`, () => {
// Ensure that only high urgency incidents are visible
deactivateButton('query-urgency-low-button');
// deactivateButton('query-urgency-low-button');
cy.get('.query-urgency-low-button').uncheck({ force: true });
waitForIncidentTable();
selectIncident(0);
escalate(escalationLevel);
Expand All @@ -97,7 +98,8 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => {
}

it('Reassign singular incident to User A1', () => {
activateButton('query-urgency-low-button'); // bring back low urgency incidents
// activateButton('query-urgency-low-button'); // bring back low urgency incidents
cy.get('.query-urgency-low-button').check({ force: true });
const assignment = 'User A1';
selectIncident(0);
reassign(assignment);
Expand All @@ -120,15 +122,15 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => {
});

it('Add responder (Team A) to singular incident', () => {
const responders = ['Team A (EP)'];
const responders = ['Team A'];
const message = 'Need help with this incident';
selectIncident(0);
addResponders(responders, message);
checkActionAlertsModalContent('Requested additional response for incident(s)');
});

it('Add multiple responders (Team A + Team B) to singular incident', () => {
const responders = ['Team A (EP)', 'Team B (EP)'];
const responders = ['Team A', 'Team B'];
const message = "Need everyone's help with this incident";
selectIncident(0);
addResponders(responders, message);
Expand Down Expand Up @@ -179,15 +181,17 @@ describe('Manage Open Incidents', { failFast: { enabled: false } }, () => {
cy.get(`@selectedIncidentId_${incidentIdx}`).then((incidentId) => {
updatePriority(priorityName);
checkActionAlertsModalContent(`have been updated with priority = ${priorityName}`);
// checkIncidentCellContent(incidentId, 'Priority', priorityName); // FIXME: Race conditions
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);
checkIncidentCellContent(incidentId, 'Priority', priorityName); // FIXME: Race conditions
});
});
});

it('Run external system sync on singular incident', () => {
// For some reason this doesn't work on first attempt - clearing cache as a workaround
acceptDisclaimer();
waitForIncidentTable();
// acceptDisclaimer();
// waitForIncidentTable();

const externalSystemName = 'ServiceNow';
selectIncident(0);
Expand Down
Loading

0 comments on commit 012b5ec

Please sign in to comment.