Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: CE-1120 Add Josh and Suha to users (plus bonus Cypress tweaks) #712

Merged
merged 29 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e72328
fix: Ce 478 (#685)
gregorylavery Oct 3, 2024
da3a597
chore(CE-1118): CE-1118 Add Ryan as officer for test and prod (#689)
nayr974 Oct 3, 2024
da5087f
chore(CE-1118): add Jon as officer to test and prod data (#688)
jon-funk Oct 4, 2024
94f9304
chore: CE 1119 add Mike to users (#690)
mikevespi Oct 7, 2024
043c1e7
feat: CE-750 Display Current Date in Filter when only one date select…
afwilcox Oct 8, 2024
343bf71
chore(CE-535): Refactor ValidationInput and ValidationSelect to use C…
nayr974 Oct 8, 2024
91c1b3b
fix: CE-1050 Makes it so cypress tests work on empty case management …
afwilcox Oct 9, 2024
e2b7101
chore(ci): Dockerfile updates (#693)
mishraomp Oct 9, 2024
b4f59cd
fix: Config.js error while developing locally (#699)
nayr974 Oct 9, 2024
70f8b02
fix: Clear CDOGS templates with every run (#700)
afwilcox Oct 11, 2024
b8aae06
fix: Ce 1127 (#694)
gregorylavery Oct 12, 2024
fde5a56
chore(deps): update dependency @types/jest to v29.5.13 (#704)
renovate[bot] Oct 15, 2024
a788f68
feat: CE-550- modal-improvements-V2 (#703)
dmitri-korin-bcps Oct 15, 2024
46d6c1d
feat: Method Complaint Received Cypress Tests (#701)
afwilcox Oct 15, 2024
d86e33e
fix: CE 1124 (#705)
nayr974 Oct 16, 2024
24a3c76
fix: CE-1143-apply-scroll-bar-to-assign-modal (#710)
dmitri-korin-bcps Oct 16, 2024
02d58eb
fix: CE-917 enable autoscaling for test (#702)
jon-funk Oct 17, 2024
9df80c5
fix: CE-1078 persist secret content changes between rollouts (#698)
jon-funk Oct 17, 2024
4de895e
chore: add Josh to dev & test users
joshgamache Oct 16, 2024
20d34a3
feat: CE-1045 add action taken filter for ceeb (#708)
mikevespi Oct 17, 2024
10fa97d
chore: also add Suha
afwilcox Oct 17, 2024
a03caa4
Merge branch 'release/lions-mane-jellyfish' into chore/CE-1120-add-josh
afwilcox Oct 17, 2024
a338648
fix: CE 1124 (#711)
nayr974 Oct 17, 2024
f8eec6c
fix: add spinner to cypress and increase timeout
afwilcox Oct 18, 2024
05af0ed
Merge branch 'release/lions-mane-jellyfish' into chore/CE-1120-add-josh
afwilcox Oct 18, 2024
f659b50
fix: split cypress tests, remove filters
afwilcox Oct 18, 2024
bbba8b4
Merge branch 'chore/CE-1120-add-josh' of https://github.com/bcgov/nr-…
afwilcox Oct 18, 2024
d54d970
Merge branch 'release/noble-sea-lemon' into chore/CE-1120-add-josh
afwilcox Oct 21, 2024
000f5bd
fix: Remove CEEB tests from complaint search
afwilcox Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { isFileExist } = require("cy-verify-downloads");
const { removeDirectory } = require("cypress-delete-downloads-folder");

export default defineConfig({
defaultCommandTimeout: 20000,
defaultCommandTimeout: 40000,
e2e: {
baseUrl: "http://localhost:3000",
experimentalStudio: true,
Expand Down
63 changes: 63 additions & 0 deletions frontend/cypress/e2e/complaint-filters-ceeb.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import Roles from "../../src/app/types/app/roles";
import COMPLAINT_TYPES from "../../src/app/types/app/complaint-types";

/**
* Test that CEEB specific search filters work
*/
describe("Verify CEEB specific search filters work", () => {
beforeEach(function () {
cy.viewport("macbook-16");
cy.kcLogout().kcLogin(Roles.CEEB);
});

function needsDecision() {
let needsDecision = false;
cy.get("#ceeb-decision").then((decisionWrapper) => {
// If the action taken input is on the page, a decision needs to be made
if (decisionWrapper.find("#outcome-decision-action-taken").length > 0) {
needsDecision = true;
}
});
return needsDecision;
}

it.only("allows filtering of complaints by Action Taken", function () {
// Navigate to the complaint list
const complaintWithActionTakenID = "23-030990";
const actionTaken = "Forward to lead agency";

// Check if complaintWithActionTakenID already has a decision.
cy.navigateToDetailsScreen(COMPLAINT_TYPES.ERS, complaintWithActionTakenID, true);
// If the action taken input is available then the complaint does not yet have a decision made on it.
// Set an action taken so that the filter will have results to return.
if (needsDecision()) {
cy.selectItemById("outcome-decision-schedule-sector", "Other");
cy.selectItemById("outcome-decision-sector-category", "None");
cy.selectItemById("outcome-decision-discharge", "Pesticides");
cy.selectItemById("outcome-decision-action-taken", actionTaken);
cy.selectItemById("outcome-decision-lead-agency", "Other");
cy.enterDateTimeInDatePicker("outcome-decision-outcome-date", "01");
// If the complaint is not assigned to anyone, assign it to self
if (cy.get("#comp-details-assigned-officer-name-text-id").contains("Not Assigned")) {
cy.get("#details-screen-assign-button").should("exist").click();
cy.get("#self_assign_button").should("exist").click();
}
cy.get(".modal").should("not.exist"); // Ensure that the quick assign modal has closed
cy.get("#ceeb-decision > .card-body > .comp-details-form-buttons > #outcome-decision-save-button").click();
cy.contains("div", "Decision added").should("exist");
}

// Return to the complaints view
cy.get("#complaints-link").click();

// Clear filters
cy.get("#comp-status-filter").click({ force: true });
cy.get("#comp-officer-filter").click({ force: true });

// Filter by action taken
cy.get("#comp-filter-btn").should("exist").click({ force: true });
cy.selectItemById("action-taken-select-id", actionTaken);
cy.waitForSpinner();
cy.get(`#${complaintWithActionTakenID}`).should("exist");
});
});
56 changes: 0 additions & 56 deletions frontend/cypress/e2e/complaint-search.v2.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,59 +148,3 @@ describe("Complaint Search Functionality", () => {
});
});
});

/**
* Test that CEEB specific search filters work
*/
describe("Verify CEEB specific search filters work", () => {
beforeEach(function () {
cy.viewport("macbook-16");
cy.kcLogout().kcLogin(Roles.CEEB);
});

function needsDecision() {
let needsDecision = false;
cy.get("#ceeb-decision").then((decisionWrapper) => {
// If the action taken input is on the page, a decision needs to be made
if (decisionWrapper.find("#outcome-decision-action-taken").length > 0) {
needsDecision = true;
}
});
return needsDecision;
}

it.only("allows filtering of complaints by Action Taken", function () {
// Navigate to the complaint list
const complaintWithActionTakenID = "23-030990";
const actionTaken = "Forward to lead agency";

// Check if complaintWithActionTakenID already has a decision.
cy.navigateToDetailsScreen(COMPLAINT_TYPES.ERS, complaintWithActionTakenID, true);
// If the action taken input is available then the complaint does not yet have a decision made on it.
// Set an action taken so that the filter will have results to return.
if (needsDecision()) {
cy.selectItemById("outcome-decision-schedule-sector", "Other");
cy.selectItemById("outcome-decision-sector-category", "None");
cy.selectItemById("outcome-decision-discharge", "Pesticides");
cy.selectItemById("outcome-decision-action-taken", actionTaken);
cy.selectItemById("outcome-decision-lead-agency", "Other");
cy.enterDateTimeInDatePicker("outcome-decision-outcome-date", "01");
// If the complaint is not assigned to anyone, assign it to self
if (cy.get("#comp-details-assigned-officer-name-text-id").contains("Not Assigned")) {
cy.get("#details-screen-assign-button").should("exist").click();
cy.get("#self_assign_button").should("exist").click();
}
cy.get(".modal").should("not.exist"); // Ensure that the quick assign modal has closed
cy.get("#ceeb-decision > .card-body > .comp-details-form-buttons > #outcome-decision-save-button").click();
cy.contains("div", "Decision added").should("exist");
}

// Return to the complaints view
cy.get("#complaints-link").click();

// Filter by action taken
cy.get("#comp-filter-btn").should("exist").click({ force: true });
cy.selectItemById("action-taken-select-id", actionTaken);
cy.get(`#${complaintWithActionTakenID}`).should("exist");
});
});
52 changes: 52 additions & 0 deletions migrations/migrations/R__Create-Test-Data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,32 @@ VALUES
) ON CONFLICT
DO NOTHING;

INSERT INTO
public.person (
person_guid,
first_name,
middle_name_1,
middle_name_2,
last_name,
create_user_id,
create_utc_timestamp,
update_user_id,
update_utc_timestamp
)
VALUES
(
'0c002922-d315-4fda-8fc5-3793dac12be8'::uuid,
'Joshua',
NULL,
NULL,
'Gamache',
'FLYWAY',
'2024-01-22 22:16:16.754',
'FLYWAY',
'2024-01-22 22:16:16.754'
) ON CONFLICT
DO NOTHING;

-- Peace Pilot Users: Fort St. John --
INSERT INTO
public.person (
Expand Down Expand Up @@ -2086,6 +2112,32 @@ VALUES
) ON CONFLICT
DO NOTHING;

INSERT INTO
public.officer (
officer_guid,
user_id,
create_user_id,
create_utc_timestamp,
update_user_id,
update_utc_timestamp,
person_guid,
office_guid,
auth_user_guid
)
VALUES
(
'236fb546-fae1-47fd-b4c7-d108c0030ee2'::uuid,
'JGAMACHE',
'FLYWAY',
'2024-01-22 22:16:16.754',
'FLYWAY',
'2024-01-22 22:20:48.186',
'0c002922-d315-4fda-8fc5-3793dac12be8'::uuid,
'c3d8519c-73cb-48a1-8058-358883d5ef4f'::uuid,
'13D3F179-F4CE-4464-A981-141061FD4E58'::uuid
) ON CONFLICT
DO NOTHING;

INSERT INTO
public.officer (
officer_guid,
Expand Down
18 changes: 18 additions & 0 deletions migrations/test-only-migrations/R__Test-Data-Creation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ VALUES('74bb4bdd-5944-4a78-a20c-c5b494decc2a'::uuid, 'Dragos', NULL, NULL, 'Vuia
ON CONFLICT DO NOTHING;
INSERT INTO public.person
(person_guid, first_name, middle_name_1, middle_name_2, last_name, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp)
VALUES('fd3654be-21f2-4fc9-ae6a-39615b732a1a'::uuid, 'Suha', NULL, NULL, 'Fatima', 'FLYWAY', '2024-01-10 22:16:16.754', 'FLYWAY', '2024-01-10 22:16:16.754')
ON CONFLICT DO NOTHING;
INSERT INTO public.person
(person_guid, first_name, middle_name_1, middle_name_2, last_name, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp)
VALUES('f67e52f5-ac3f-48e0-ad64-cab1eae51a18'::uuid, 'Dmitri', NULL, NULL, 'Korin', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:16:16.754')
ON CONFLICT DO NOTHING;
INSERT INTO public.person
Expand Down Expand Up @@ -335,6 +339,10 @@ INSERT INTO public.person
(person_guid, first_name, middle_name_1, middle_name_2, last_name, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp)
VALUES('141ebe0c-84c5-487d-8676-caee5de53b36'::uuid, 'Mike', NULL, NULL, 'Vesprini', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:16:16.754')
ON CONFLICT DO NOTHING;
INSERT INTO public.person
(person_guid, first_name, middle_name_1, middle_name_2, last_name, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp)
VALUES('0c002922-d315-4fda-8fc5-3793dac12be8'::uuid, 'Joshua', NULL, NULL, 'Gamache', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:16:16.754')
ON CONFLICT DO NOTHING;

-------------------------
-- INSERT OFFICER RECORDS
Expand Down Expand Up @@ -453,6 +461,10 @@ INSERT INTO public.officer
VALUES('3fc8a9db-e085-4461-bce2-b05462b79794'::uuid, 'DVUIA', 'FLYWAY', '2024-01-10 22:16:16.754', 'FLYWAY', '2024-01-10 22:20:48.186', '74bb4bdd-5944-4a78-a20c-c5b494decc2a'::uuid, '3f474308-68da-450a-b1ab-fb8a5b7a27ce'::uuid)
ON CONFLICT DO NOTHING;
INSERT INTO public.officer
(officer_guid, user_id, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, person_guid, auth_user_guid)
VALUES('60e7403e-9933-4eff-89ae-508c0c827130'::uuid, 'SFATIMA', 'FLYWAY', '2024-01-10 22:16:16.754', 'FLYWAY', '2024-01-10 22:20:48.186', 'fd3654be-21f2-4fc9-ae6a-39615b732a1a'::uuid, 'cafc87f3-738c-49bd-9bfb-33d7f01d50b9'::uuid)
ON CONFLICT DO NOTHING;
INSERT INTO public.officer
(officer_guid, user_id, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, person_guid, office_guid)
VALUES('56582c3c-6819-43c8-8d89-8e43823500c3'::uuid, 'DKORIN', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:20:48.186', 'f67e52f5-ac3f-48e0-ad64-cab1eae51a18'::uuid, '79fe321b-7716-413f-b878-c5fd6100317d'::uuid)
ON CONFLICT DO NOTHING;
Expand Down Expand Up @@ -486,6 +498,11 @@ INSERT INTO public.officer
(officer_guid, user_id, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, person_guid, office_guid, auth_user_guid)
VALUES('44123934-a2cf-4eae-88af-f682f7548f89'::uuid, 'MVESPRIN', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:20:48.186', '141ebe0c-84c5-487d-8676-caee5de53b36'::uuid, '4a5a94b1-bd47-4611-a577-861d97089903'::uuid, '01a5ad69-0675-4359-a0a7-909f55e2c67a'::uuid)
ON CONFLICT DO NOTHING;
INSERT INTO public.officer
(officer_guid, user_id, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, person_guid, office_guid, auth_user_guid)
VALUES('236fb546-fae1-47fd-b4c7-d108c0030ee2'::uuid, 'JGAMACHE', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:20:48.186', '0c002922-d315-4fda-8fc5-3793dac12be8'::uuid, '4a5a94b1-bd47-4611-a577-861d97089903'::uuid, '13D3F179-F4CE-4464-A981-141061FD4E58'::uuid)
ON CONFLICT DO NOTHING;


--------------------------------
--- Scatter our team throughout the province for testing
Expand All @@ -508,6 +525,7 @@ UPDATE public.officer SET office_guid = '79fe321b-7716-413f-b878-c5fd6100317d' W
UPDATE public.officer SET office_guid = '9fc7327b-b206-4a5c-88f1-2875a456eb49' WHERE user_id='JFUNK';
UPDATE public.officer SET office_guid = '4a5a94b1-bd47-4611-a577-861d97089903' WHERE user_id='RRONDEAU';
UPDATE public.officer SET office_guid = '4a5a94b1-bd47-4611-a577-861d97089903' WHERE user_id='MVESPRIN';
UPDATE public.officer SET office_guid = '4a5a94b1-bd47-4611-a577-861d97089903' WHERE user_id='JGAMACHE';

-------------------------
-- INSERT COMPLAINT RECORDS
Expand Down
Loading