Skip to content

Commit 5b33edf

Browse files
committed
Merge branch 'master' into stories/ecer-1563
2 parents 3606e86 + fcf026a commit 5b33edf

27 files changed

+824
-255
lines changed

src/ECER.Clients.E2ETestData/E2ETests/E2ETestsEndpoints.cs

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder)
4242
return TypedResults.BadRequest(new ProblemDetails { Title = "Missing header: EXTERNAL-USER-ID" });
4343
}
4444

45+
if (!ctx.Request.Headers.TryGetValue("APP-STATUS", out var appStatus))
46+
{
47+
return TypedResults.BadRequest(new ProblemDetails { Title = "Missing header: APP-STATUS" });
48+
}
49+
50+
if (!bool.TryParse(appStatus, out var certIsActive))
51+
{
52+
return TypedResults.BadRequest(new ProblemDetails { Title = "Invalid boolean value for header: APP-EXPIRATION" });
53+
}
54+
55+
if (!ctx.Request.Headers.TryGetValue("APP-EXPIRATION", out var appExpiration))
56+
{
57+
return TypedResults.BadRequest(new ProblemDetails { Title = "Missing header: APP-STATUS" });
58+
}
59+
60+
if (!bool.TryParse(appExpiration, out var isExpiredMoreThan5Years))
61+
{
62+
return TypedResults.BadRequest(new ProblemDetails { Title = "Invalid boolean value for header: APP-EXPIRATION" });
63+
}
64+
4565
if (!ctx.Request.Headers.TryGetValue("APPLICATION-TYPE", out var applicationType))
4666
{
4767
return TypedResults.BadRequest(new ProblemDetails { Title = "Missing header: APPLICATION-TYPE" });
@@ -50,15 +70,15 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder)
5070
CertificationType certificationType;
5171
switch (applicationType.ToString())
5272
{
53-
case "Assistant":
73+
case "ECEAssistant":
5474
certificationType = CertificationType.EceAssistant;
5575
break;
5676

57-
case "OneYear":
77+
case "ECEOneYear":
5878
certificationType = CertificationType.OneYear;
5979
break;
6080

61-
case "5Years":
81+
case "ECE5Years":
6282
certificationType = CertificationType.FiveYears;
6383
break;
6484

@@ -71,15 +91,19 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder)
7191
if (profile == null) return TypedResults.NotFound();
7292
var contact_id = profile.UserId;
7393

74-
var draftApplicationObj = new Faker<Application>("en_CA")
75-
.RuleFor(f => f.CertificationTypes, f => f.Make(1, () => certificationType))
76-
.RuleFor(f => f.SignedDate, f => f.Date.Recent())
77-
.RuleFor(f => f.Transcripts, f => f.Make(f.Random.Number(2, 5), () => CreateTranscript()))
78-
.RuleFor(f => f.CharacterReferences, f => f.Make(1, () => CreateCharacterReference()))
79-
.RuleFor(f => f.WorkExperienceReferences, f => f.Make(f.Random.Number(2, 5), () => CreateWorkExperienceReference()))
80-
.Generate();
94+
var faker = new Faker("en_CA");
95+
96+
var draftApplication = new Application(null, contact_id!, ApplicationStatus.Draft);
97+
draftApplication.CertificationTypes = faker.Make(1, () => certificationType);
98+
draftApplication.SignedDate = faker.Date.Recent();
99+
draftApplication.Transcripts = faker.Make(faker.Random.Number(2, 5), () => CreateTranscript());
100+
draftApplication.CharacterReferences = faker.Make(1, () => CreateCharacterReference());
101+
if (certificationType == CertificationType.FiveYears)
102+
{
103+
draftApplication.WorkExperienceReferences = faker.Make(faker.Random.Number(3, 5), () => CreateWorkExperienceReference());
104+
}
81105

82-
var application = await messageBus.Send(new SaveDraftApplicationCommand(draftApplicationObj), ct);
106+
var application = await messageBus.Send(new SaveDraftApplicationCommand(draftApplication), ct);
83107

84108
var cmd = new SubmitApplicationCommand(application!.Id!, contact_id!);
85109
var submitAppResult = await messageBus.Send(cmd, ct);
@@ -98,7 +122,7 @@ public void Register(IEndpointRouteBuilder endpointRouteBuilder)
98122
};
99123
return TypedResults.BadRequest(problemDetails);
100124
}
101-
var result = await messageBus.Send(new E2ETestsGenerateCertificateCommand(submitAppResult.Application!.Id!), ct);
125+
var result = await messageBus.Send(new E2ETestsGenerateCertificateCommand(submitAppResult.Application!.Id!, certIsActive, isExpiredMoreThan5Years), ct);
102126
return TypedResults.Ok(result);
103127
})
104128
.WithOpenApi("Handles seeding of Applications and certifications for Renewal workflow", string.Empty, "E2ETests_seed_post_application_certificate")
@@ -160,7 +184,7 @@ private WorkExperienceReference CreateWorkExperienceReference()
160184
{
161185
var faker = new Faker("en_CA");
162186
return new WorkExperienceReference(
163-
faker.Name.FirstName(), faker.Name.LastName(), "[email protected]", faker.Random.Number(10, 150)
187+
faker.Name.FirstName(), faker.Name.LastName(), "[email protected]", faker.Random.Number(200, 250)
164188
)
165189
{
166190
PhoneNumber = faker.Phone.PhoneNumber()

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/cypress.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default defineConfig({
1313
},
1414
specPattern: [
1515
"cypress/e2e/**/auth.cy.ts", // auth spec runs first
16-
"cypress/e2e/**/*.cy.ts", // other specs next
16+
"!cypress/e2e/**/z_logout.cy.ts", // exclude logout from wildcard
17+
"cypress/e2e/**/*.cy.ts", // run all other specs
1718
"cypress/e2e/**/z_logout.cy.ts", // always run this last
1819
],
1920
},

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/cypress/e2e/ui/newCertifications/newECE5YearCertification.cy.ts

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ describe("New ECE 5 Year Certificate Application", () => {
77
cy.get(selectors.dashboard.applyNowButton).click();
88

99
/** Certification Type */
10-
cy.get(selectors.certificationType.eceFiveYearRadio).check();
11-
cy.get(selectors.certificationType.continueButton).click();
10+
cy.get(selectors.certificationType.applyNowEceFiveYearButton).click();
1211

1312
/** Application Requirements */
13+
cy.get(selectors.certificationType.iteCheckBox).uncheck({ force: true });
14+
cy.get(selectors.certificationType.sneCheckBox).uncheck({ force: true });
1415
cy.get(selectors.applicationRequirements.applyNowButton).click();
1516

1617
/** Declaration */
@@ -33,34 +34,14 @@ describe("New ECE 5 Year Certificate Application", () => {
3334
cy.get(selectors.education.programNameInput).type("TEST ECE 5 Year Course");
3435

3536
/* Start Date - DatePicker*/
36-
// cy.get(selectors.education.programStartDateInput).click({ force: true });
37-
// cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
38-
3937
cy.get(selectors.education.programStartDateInput).click({ force: true });
40-
Cypress._.times(5, () => {
41-
cy.get(selectors.datePicker.prevMonthButton).first().click();
42-
});
43-
cy.get(selectors.datePicker.monthDiv)
44-
.first()
45-
.should("exist")
46-
.within(() => {
47-
cy.contains("span", `${todayDay}`).click({ force: true });
48-
});
38+
cy.get(selectors.education.programStartDateInput).clear();
39+
cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
4940

5041
/* End Date - DatePicker*/
51-
// cy.get(selectors.education.programEndDateInput).click({ force: true });
52-
// cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
53-
5442
cy.get(selectors.education.programEndDateInput).click({ force: true });
55-
Cypress._.times(1, () => {
56-
cy.get(selectors.datePicker.prevMonthButton).first().click();
57-
});
58-
cy.get(selectors.datePicker.monthDiv)
59-
.first()
60-
.should("exist")
61-
.within(() => {
62-
cy.contains("span", `${todayDay}`).click({ force: true });
63-
});
43+
cy.get(selectors.education.programEndDateInput).clear();
44+
cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
6445

6546
cy.get(selectors.education.studentIDInput).type("1234");
6647
cy.get(selectors.education.nameOnTranscriptRadioDiv).within(() => {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/cypress/e2e/ui/newCertifications/newECE5YearPlusITECertification.cy.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ describe("New ECE 5 Year + ITE Certificate Application", () => {
77
cy.get(selectors.dashboard.applyNowButton).click();
88

99
/** Certification Type */
10-
cy.get(selectors.certificationType.eceFiveYearRadio).check();
11-
cy.get(selectors.certificationType.iteCheckBox).check({ force: true });
12-
cy.get(selectors.certificationType.continueButton).click();
10+
cy.get(selectors.certificationType.applyNowEceFiveYearButton).click();
1311

1412
/** Application Requirements */
13+
cy.get(selectors.certificationType.sneCheckBox).uncheck({ force: true });
1514
cy.get(selectors.applicationRequirements.applyNowButton).click();
1615

1716
/** Declaration */
@@ -34,34 +33,14 @@ describe("New ECE 5 Year + ITE Certificate Application", () => {
3433
cy.get(selectors.education.programNameInput).type("TEST ECE 5 Year Course");
3534

3635
/* Start Date - DatePicker*/
37-
// cy.get(selectors.education.programStartDateInput).click({ force: true });
38-
// cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
39-
4036
cy.get(selectors.education.programStartDateInput).click({ force: true });
41-
Cypress._.times(5, () => {
42-
cy.get(selectors.datePicker.prevMonthButton).first().click();
43-
});
44-
cy.get(selectors.datePicker.monthDiv)
45-
.first()
46-
.should("exist")
47-
.within(() => {
48-
cy.contains("span", `${todayDay}`).click({ force: true });
49-
});
37+
cy.get(selectors.education.programStartDateInput).clear();
38+
cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
5039

5140
/* End Date - DatePicker*/
52-
// cy.get(selectors.education.programEndDateInput).click({ force: true });
53-
// cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
54-
5541
cy.get(selectors.education.programEndDateInput).click({ force: true });
56-
Cypress._.times(1, () => {
57-
cy.get(selectors.datePicker.prevMonthButton).first().click();
58-
});
59-
cy.get(selectors.datePicker.monthDiv)
60-
.first()
61-
.should("exist")
62-
.within(() => {
63-
cy.contains("span", `${todayDay}`).click({ force: true });
64-
});
42+
cy.get(selectors.education.programEndDateInput).clear();
43+
cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
6544

6645
cy.get(selectors.education.studentIDInput).type("1234");
6746
cy.get(selectors.education.nameOnTranscriptRadioDiv).within(() => {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/cypress/e2e/ui/newCertifications/newECE5YearPlusITEandSNECertification.cy.ts

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ describe("New ECE 5 Year + ITE & SNE Certificate Application", () => {
77
cy.get(selectors.dashboard.applyNowButton).click();
88

99
/** Certification Type */
10-
cy.get(selectors.certificationType.eceFiveYearRadio).check();
11-
cy.get(selectors.certificationType.iteCheckBox).check({ force: true });
12-
cy.get(selectors.certificationType.sneCheckBox).check({ force: true });
13-
cy.get(selectors.certificationType.continueButton).click();
10+
cy.get(selectors.certificationType.applyNowEceFiveYearButton).click();
1411

1512
/** Application Requirements */
1613
cy.get(selectors.applicationRequirements.applyNowButton).click();
@@ -35,34 +32,14 @@ describe("New ECE 5 Year + ITE & SNE Certificate Application", () => {
3532
cy.get(selectors.education.programNameInput).type("TEST ECE 5 Year Course");
3633

3734
/* Start Date - DatePicker*/
38-
// cy.get(selectors.education.programStartDateInput).click({ force: true });
39-
// cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
40-
4135
cy.get(selectors.education.programStartDateInput).click({ force: true });
42-
Cypress._.times(5, () => {
43-
cy.get(selectors.datePicker.prevMonthButton).first().click();
44-
});
45-
cy.get(selectors.datePicker.monthDiv)
46-
.first()
47-
.should("exist")
48-
.within(() => {
49-
cy.contains("span", `${todayDay}`).click({ force: true });
50-
});
36+
cy.get(selectors.education.programStartDateInput).clear();
37+
cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
5138

5239
/* End Date - DatePicker*/
53-
// cy.get(selectors.education.programEndDateInput).click({ force: true });
54-
// cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
55-
5640
cy.get(selectors.education.programEndDateInput).click({ force: true });
57-
Cypress._.times(1, () => {
58-
cy.get(selectors.datePicker.prevMonthButton).first().click();
59-
});
60-
cy.get(selectors.datePicker.monthDiv)
61-
.first()
62-
.should("exist")
63-
.within(() => {
64-
cy.contains("span", `${todayDay}`).click({ force: true });
65-
});
41+
cy.get(selectors.education.programEndDateInput).clear();
42+
cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
6643

6744
cy.get(selectors.education.studentIDInput).type("1234");
6845
cy.get(selectors.education.nameOnTranscriptRadioDiv).within(() => {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/cypress/e2e/ui/newCertifications/newECE5YearPlusSNECertification.cy.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ describe("New ECE 5 Year + SNE Certificate Application", () => {
77
cy.get(selectors.dashboard.applyNowButton).click();
88

99
/** Certification Type */
10-
cy.get(selectors.certificationType.eceFiveYearRadio).check();
11-
cy.get(selectors.certificationType.sneCheckBox).check({ force: true });
12-
cy.get(selectors.certificationType.continueButton).click();
10+
cy.get(selectors.certificationType.applyNowEceFiveYearButton).click();
1311

1412
/** Application Requirements */
13+
cy.get(selectors.certificationType.iteCheckBox).uncheck({ force: true });
1514
cy.get(selectors.applicationRequirements.applyNowButton).click();
1615

1716
/** Declaration */
@@ -33,34 +32,14 @@ describe("New ECE 5 Year + SNE Certificate Application", () => {
3332
cy.get(selectors.education.programNameInput).type("TEST ECE 5 Year Course");
3433

3534
/* Start Date - DatePicker*/
36-
// cy.get(selectors.education.programStartDateInput).click({ force: true });
37-
// cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
38-
3935
cy.get(selectors.education.programStartDateInput).click({ force: true });
40-
Cypress._.times(5, () => {
41-
cy.get(selectors.datePicker.prevMonthButton).first().click();
42-
});
43-
cy.get(selectors.datePicker.monthDiv)
44-
.first()
45-
.should("exist")
46-
.within(() => {
47-
cy.contains("span", `${todayDay}`).click({ force: true });
48-
});
36+
cy.get(selectors.education.programStartDateInput).clear();
37+
cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
4938

5039
/* End Date - DatePicker*/
51-
// cy.get(selectors.education.programEndDateInput).click({ force: true });
52-
// cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
53-
5440
cy.get(selectors.education.programEndDateInput).click({ force: true });
55-
Cypress._.times(1, () => {
56-
cy.get(selectors.datePicker.prevMonthButton).first().click();
57-
});
58-
cy.get(selectors.datePicker.monthDiv)
59-
.first()
60-
.should("exist")
61-
.within(() => {
62-
cy.contains("span", `${todayDay}`).click({ force: true });
63-
});
41+
cy.get(selectors.education.programEndDateInput).clear();
42+
cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
6443

6544
cy.get(selectors.education.studentIDInput).type("1234");
6645
cy.get(selectors.education.nameOnTranscriptRadioDiv).within(() => {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/cypress/e2e/ui/newCertifications/newECEAssistantCertification.cy.ts

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ describe("New ECE Assistant Certificate Application", () => {
77
cy.get(selectors.dashboard.applyNowButton).click();
88

99
/** Certification Type */
10-
cy.get(selectors.certificationType.eceAssistantRadio).check();
11-
cy.get(selectors.certificationType.continueButton).click();
10+
cy.get(selectors.certificationType.applyNowEceAssistantButton).click();
1211

1312
/** Application Requirements */
1413
cy.get(selectors.applicationRequirements.applyNowButton).click();
@@ -33,40 +32,14 @@ describe("New ECE Assistant Certificate Application", () => {
3332
cy.get(selectors.education.programNameInput).type("TEST ECE Assistant Course");
3433

3534
/* Start Date - DatePicker*/
36-
// cy.get(selectors.education.programStartDateInput).click({ force: true });
37-
// cy.log(`Course Start Day: ${courseStartDay}`);
38-
// cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
39-
cy.log(`Today Day: ${todayDay}`);
4035
cy.get(selectors.education.programStartDateInput).click({ force: true });
41-
Cypress._.times(5, () => {
42-
cy.get(selectors.datePicker.prevMonthButton).first().click();
43-
});
44-
cy.get(selectors.datePicker.monthDiv)
45-
.first()
46-
.should("exist")
47-
.within(() => {
48-
cy.contains("span", `${todayDay}`).click({ force: true });
49-
});
50-
51-
//cy.get("button").contains("OK").click({ force: true });
36+
cy.get(selectors.education.programStartDateInput).clear();
37+
cy.get(selectors.education.programStartDateInput).type(`${courseStartDay} {enter}`);
5238

5339
/* End Date - DatePicker*/
54-
// cy.get(selectors.education.programEndDateInput).click({ force: true });
55-
// cy.log(`Course Start Day: ${courseEndDay}`);
56-
// cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
57-
5840
cy.get(selectors.education.programEndDateInput).click({ force: true });
59-
Cypress._.times(1, () => {
60-
cy.get(selectors.datePicker.prevMonthButton).first().click();
61-
});
62-
cy.get(selectors.datePicker.monthDiv)
63-
.first()
64-
.should("exist")
65-
.within(() => {
66-
cy.contains("span", `${todayDay}`).click({ force: true });
67-
});
68-
69-
// cy.get("button").contains("OK").click({ force: true });
41+
cy.get(selectors.education.programEndDateInput).clear();
42+
cy.get(selectors.education.programEndDateInput).type(`${courseEndDay} {enter}`);
7043

7144
cy.get(selectors.education.studentIDInput).type("1234");
7245
cy.get(selectors.education.nameOnTranscriptRadioDiv).within(() => {

0 commit comments

Comments
 (0)