diff --git a/applications/Unity.AutoUI/cypress.pipeline.env.json b/applications/Unity.AutoUI/cypress.pipeline.env.json
index c31a550fe..f39f50d81 100644
--- a/applications/Unity.AutoUI/cypress.pipeline.env.json
+++ b/applications/Unity.AutoUI/cypress.pipeline.env.json
@@ -4,5 +4,8 @@
"test1username": "{{test1username}}",
"test1password": "{{test1password}}",
"test2username": "{{test2username}}",
- "test2password": "{{test2password}}"
+ "test2password": "{{test2password}}",
+ "TEST_EMAIL_TO": "{{test_email_to}}",
+ "TEST_EMAIL_CC": "{{test_email_CC}}",
+ "TEST_EMAIL_BCC": "{{test_email_BCC}}"
}
\ No newline at end of file
diff --git a/applications/Unity.AutoUI/cypress/e2e/basicEmail.cy.ts b/applications/Unity.AutoUI/cypress/e2e/basicEmail.cy.ts
index 329f562c6..c0f6d2120 100644
--- a/applications/Unity.AutoUI/cypress/e2e/basicEmail.cy.ts
+++ b/applications/Unity.AutoUI/cypress/e2e/basicEmail.cy.ts
@@ -1,9 +1,9 @@
// cypress/e2e/basicEmail.cy.ts
describe('Send an email', () => {
- const TEST_EMAIL_TO = 'grantmanagementsupport@gov.bc.ca'
- const TEST_EMAIL_CC = 'UnitySupport@gov.bc.ca'
- const TEST_EMAIL_BCC = 'UNITYSUP@Victoria1.gov.bc.ca'
+ const TEST_EMAIL_TO = Cypress.env('TEST_EMAIL_TO') as string
+ const TEST_EMAIL_CC = Cypress.env('TEST_EMAIL_CC') as string
+ const TEST_EMAIL_BCC = Cypress.env('TEST_EMAIL_BCC') as string
const TEMPLATE_NAME = 'Test Case 1'
const STANDARD_TIMEOUT = 20000
diff --git a/applications/Unity.AutoUI/cypress/e2e/chefsdata.cy.ts b/applications/Unity.AutoUI/cypress/e2e/chefsdata.cy.ts
index 92baa0fb9..b9ec8948c 100644
--- a/applications/Unity.AutoUI/cypress/e2e/chefsdata.cy.ts
+++ b/applications/Unity.AutoUI/cypress/e2e/chefsdata.cy.ts
@@ -1,31 +1,39 @@
///
+
+// cypress/e2e/chefsdata.cy.ts
+
describe('Unity Login and check data from CHEFS', () => {
+ const STANDARD_TIMEOUT = 20000
- it('Verify Login', () => {
+ // TEST renders the Submission tab inside an open shadow root (Form.io).
+ // Enabling this makes cy.get / cy.contains pierce shadow DOM consistently across envs.
+ before(() => {
+ Cypress.config('includeShadowDom', true)
+ })
+ it('Verify Login', () => {
// 1.) Always start from the base URL
cy.visit(Cypress.env('webapp.url'))
// 2.) Decide auth path based on visible UI
- cy.get('body').then($body => {
-
+ cy.get('body', { timeout: STANDARD_TIMEOUT }).then(($body) => {
// Already authenticated
if ($body.find('button:contains("VIEW APPLICATIONS")').length > 0) {
- cy.contains('VIEW APPLICATIONS').click()
+ cy.contains('VIEW APPLICATIONS', { timeout: STANDARD_TIMEOUT }).click({ force: true })
return
}
// Not authenticated
if ($body.find('button:contains("LOGIN")').length > 0) {
- cy.contains('LOGIN').should('be.visible').click()
- cy.contains('IDIR').should('be.visible').click()
+ cy.contains('LOGIN', { timeout: STANDARD_TIMEOUT }).should('exist').click({ force: true })
+ cy.contains('IDIR', { timeout: STANDARD_TIMEOUT }).should('exist').click({ force: true })
- cy.get('body').then($loginBody => {
+ cy.get('body', { timeout: STANDARD_TIMEOUT }).then(($loginBody) => {
// Perform IDIR login only if prompted
- if ($loginBody.find('#user').length) {
- cy.get('#user').type(Cypress.env('test1username'))
- cy.get('#password').type(Cypress.env('test1password'))
- cy.contains('Continue').should('exist').click()
+ if ($loginBody.find('#user').length > 0) {
+ cy.get('#user', { timeout: STANDARD_TIMEOUT }).type(Cypress.env('test1username'))
+ cy.get('#password', { timeout: STANDARD_TIMEOUT }).type(Cypress.env('test1password'))
+ cy.contains('Continue', { timeout: STANDARD_TIMEOUT }).should('exist').click({ force: true })
} else {
cy.log('Already logged in')
}
@@ -39,220 +47,188 @@ describe('Unity Login and check data from CHEFS', () => {
})
// 3.) Post-condition check
- cy.url().should('include', '/GrantApplications')
+ cy.url({ timeout: STANDARD_TIMEOUT }).should('include', '/GrantApplications')
})
- // 19.) Verify that the info panel populates with mapped data
+ // Verify that the details panel populates with mapped data
it('Verify the UI is populated with valid data from CHEFS', () => {
-
- cy.getSubmissionDetail('confirmationID').then(id => { cy.log(`Confirmation ID: ${id}`); });
+ cy.getSubmissionDetail('confirmationID').then((id) => {
+ cy.log(`Confirmation ID: ${id}`)
+ })
// Ensure the search field exists
- cy.get('#search').should('exist')
+ cy.get('#search', { timeout: STANDARD_TIMEOUT }).should('exist')
// Conditionally widen Submitted Date range if the control exists
- cy.get('body').then(($body) => {
+ cy.get('body', { timeout: STANDARD_TIMEOUT }).then(($body) => {
if ($body.find('input#submittedFromDate').length > 0) {
- cy.get('input#submittedFromDate')
- .should('be.visible')
+ cy.get('input#submittedFromDate', { timeout: STANDARD_TIMEOUT })
+ .should('exist')
.clear()
.type('2022-01-01')
}
})
// Clear and focus search
- cy.get('#search').clear()
- cy.get('#search').click()
+ cy.get('#search', { timeout: STANDARD_TIMEOUT }).clear()
+ cy.get('#search', { timeout: STANDARD_TIMEOUT }).click({ force: true })
// Type confirmation ID
- cy.getSubmissionDetail('confirmationID')
- .then(id => cy.get('#search').type(id))
+ cy.getSubmissionDetail('confirmationID').then((id) => {
+ cy.get('#search', { timeout: STANDARD_TIMEOUT }).type(id)
+ })
// Select matching row if table rendering exists
- cy.getSubmissionDetail('confirmationID')
- .then(id => {
- cy.get('body').then(($body) => {
- if ($body.find(`tr:contains("${id}")`).length > 0) {
- cy.contains('tr', id)
- .find('.checkbox-select')
- .click()
- }
- })
+ cy.getSubmissionDetail('confirmationID').then((id) => {
+ cy.get('body', { timeout: STANDARD_TIMEOUT }).then(($body) => {
+ if ($body.find(`tr:contains("${id}")`).length > 0) {
+ cy.contains('tr', id, { timeout: STANDARD_TIMEOUT })
+ .find('.checkbox-select')
+ .click({ force: true })
+ }
})
+ })
// Open the info panel if available
- cy.get('body').then(($body) => {
+ cy.get('body', { timeout: STANDARD_TIMEOUT }).then(($body) => {
if ($body.find('#applicationLink').length > 0) {
- cy.get('#applicationLink').click()
+ cy.get('#applicationLink', { timeout: STANDARD_TIMEOUT }).click({ force: true })
}
})
- // 19.) Verify that the info panel populates with mapped data
- // Category: AutoUI
- cy.get('label[for="Category"]').next('.display-input').should('include.text', 'AutoUI');
- // Organization Name: DOLPHIN ASPHALT
- cy.get('label.display-input-label[for="OrganizationName"]').next('div.display-input').should('contain.text', 'DOLPHIN ASPHALT')
- // Organization #:
- cy.get('label.display-input-label[for="OrganizationNumber"]').next('div.display-input').should('contain.text', 'FM0162628')
- // Economic Region: Kootenay
- cy.get('label[for="EconomicRegion"]').next('.display-input').should('include.text', 'Kootenay')
- // Regional District: East Kootenay
- cy.get('label[for="RegionalDistrict"]').next('.display-input').should('include.text', 'East Kootenay')
- // Community: East Kootenay B
- cy.get('label[for="Community"]').next('.display-input').should('include.text', 'East Kootenay B')
- // Requested Amount: $89,000.00
- cy.get('label[for="RequestedAmount"]').next('.display-input').should('include.text', '$89,000.00')
- // Total Project Budget: $125,000.00
- cy.get('label[for="ProjectBudget"]').next('.display-input').should('include.text', '$125,000.00')
- // Sector: Other services (except public administration)
- cy.get('label[for="Sector"]').next('.display-input').should('include.text', 'Other services (except public administration)')
- cy.get('#closeSummaryCanvas').click()
- // 20.) Verify that the details panel populates with mapped data
- cy.get('#externalLink').should('exist').click() //open the application
- // Category: AutoUI
- cy.get('label[for="Category"]').next('.display-input').should('include.text', 'AutoUI')
- // Organization Name: DOLPHIN ASPHALT
- cy.get('label[for="OrganizationName"]').next('.display-input').should('include.text', 'DOLPHIN ASPHALT')
- // Organization #:
- cy.get('label[for="OrganizationNumber"]').next('.display-input').should('include.text', 'FM0162628')
- // Economic Region: Kootenay
- cy.get('label[for="EconomicRegion"]').next('.display-input').should('include.text', 'Kootenay')
- // Regional District: East Kootenay
- cy.get('label[for="RegionalDistrict"]').next('.display-input').should('include.text', 'East Kootenay')
- // Community: East Kootenay B
- cy.get('label[for="Community"]').next('.display-input').should('include.text', 'East Kootenay B')
- // Requested Amount: $89,000.00
- cy.get('label[for="RequestedAmount"]').next('.display-input').should('include.text', '$89,000.00')
- // Total Project Budget: $125,000.00
- cy.get('label[for="ProjectBudget"]').next('.display-input').should('include.text', '$125,000.00')
- // Sector: Other services (except public administration)
- cy.get('label[for="Sector"]').next('.display-input').should('include.text', 'Other services (except public administration)')
- // 21.) Verify that the Review & Assessment tab populates with mapped data
- cy.get('#nav-review-and-assessment-tab').should('exist').click() // open the Review & Assessment tab
- // Requested Amount: $89,000.00
- cy.get('#RequestedAmountInputAR').should('have.value', '89,000.00')
- // Total Project Budget: $125,000.00
- cy.get('#TotalBudgetInputAR').should('have.value', '125,000.00')
- // 22.) Verify that the Project Info tab populates with mapped data
- cy.get('#nav-project-info-tab').should('exist').click() // open the Project Info tab
- // Project Name
- cy.get('#ProjectInfo_ProjectName').should('have.value', 'Hanbury Development Initiative - Phase 2')
- // Project Start Date: 2026-01-05
- cy.get('#startDate').should('have.value', '2026-01-05')
- // Project End Date: 2027-03-11
- cy.get('#ProjectInfo_ProjectEndDate').should('have.value', '2027-03-11')
- // Requested Amount: $89,000.00
- cy.get('#RequestedAmountInputPI').should('have.value', '89,000.00')
- // Total Project Budget: $125,000.00
- cy.get('#TotalBudgetInputPI').should('have.value', '125,000.00')
- // Acquisition: No
- cy.get('#ProjectInfo_Acquisition').should('have.value', 'NO')
- // Forestry/Non-Forestry: Forestry
- cy.get('#ProjectInfo_Forestry').should('have.value', 'FORESTRY')
- // Forestry Focus: Secondary/Value-Added/Not Mass Timber (value="SECONDARY")
- cy.get('#ProjectInfo_ForestryFocus').should('have.value', 'SECONDARY')
- // Economic Region: Kootenay
- cy.get('#economicRegions').should('have.value', 'Kootenay')
- // Regional District: East Kootenay
- cy.get('#regionalDistricts').should('have.value', 'East Kootenay')
- // Community: East Kootenay B
- cy.get('#communities').should('have.value', 'East Kootenay B')
- // Community Population: 38
- cy.get('#ProjectInfo_CommunityPopulation').should('have.value', '38')
- // Electoral District: Kootenay-Rockies
- cy.get('#ProjectInfo_ElectoralDistrict').should('have.value', 'Kootenay-Rockies')
- // Place: Hanbury
- cy.get('#ProjectInfo_Place').should('have.value', 'Hanbury')
-
- // 23.) open the Applicant Info tab
- it('23. Applicant Info tab shows the mapped data', () => {
- // 1. open the pane
- cy.contains('a.nav-link', 'Applicant Info').click()
-
- // 2. wait for the Applicant Info fieldset, then work inside it
- cy.get('fieldset[name$="Applicant_Summary"]', { timeout: 10_000 })
- .should('be.visible')
- .as('app') // alias for scoping
-
- // 3. simple value assertions
- const plainInputs: [string, string][] = [
- ['#ApplicantSummary_OrgName', 'DOLPHIN ASPHALT'],
- ['#ApplicantSummary_OrgNumber', 'FM0162628'],
- ['#ApplicantSummary_ContactFullName', 'Jeff Gordon'],
- ['#ApplicantSummary_ContactTitle', 'Sr. Analyst'],
- ['#ApplicantSummary_ContactEmail', 'Jeff.Gordon@Dolphin.ca'],
- ['#ApplicantSummary_ContactBusinessPhone', '(250) 621-3217'],
- ['#ApplicantSummary_ContactCellPhone', '(887) 362-1459'],
- ['#ApplicantSummary_PhysicalAddressStreet', '24th Avenue South'],
- ['#ApplicantSummary_PhysicalAddressStreet2', 'Room 409'],
- ['#ApplicantSummary_PhysicalAddressUnit', '19'],
- ['#ApplicantSummary_PhysicalAddressCity', 'Cranbrook'],
- ['#ApplicantSummary_PhysicalAddressProvince', 'British Columbia'],
- ['#ApplicantSummary_PhysicalAddressPostalCode', 'V1C 3H8'],
- ['#ApplicantInfo_MailingAddressStreet', '2567 Shaughnessy Street'],
- ['#ApplicantInfo_MailingAddressStreet2', 'PO Box 905'],
- ['#ApplicantInfo_MailingAddressUnit', '22'],
- ['#ApplicantInfo_MailingAddressCity', 'Hanbury'],
- ['#ApplicantInfo_MailingAddressProvince', 'British Columbia'],
- ['#ApplicantInfo_MailingAddressPostalCode', 'V1C 4T6'],
- ['#ApplicantInfo_SigningAuthorityFullName', 'Maximillion Cooper'],
- ['#ApplicantInfo_SigningAuthorityTitle', 'Consultant'],
- ['#ApplicantInfo_SigningAuthorityEmail', 'Maximillion.Cooper@Dolphin.ca'],
- ['#ApplicantInfo_SigningAuthorityBusinessPhone', '(250) 841-2511'],
- ['#ApplicantInfo_SigningAuthorityCellPhone', '(657) 456-5413']
- ]
-
- plainInputs.forEach(([selector, expected]) => {
- cy.get('@app').find(selector).should('have.value', expected)
- })
-
- // 4. textarea requires .invoke('val')
- cy.get('@app')
- .find('#ApplicantSummary_SectorSubSectorIndustryDesc')
- .invoke('val')
- .should('equal', 'Stone Aggregate Recycling')
- })
-
- // 24.) Sector and Sub-sector lists
- it('24. Sector and Sub-sector dropdowns behave', () => {
- // open Applicant Info
- cy.contains('a.nav-link', 'Applicant Info').click()
-
- // locate the Sector and Sub-sector