Skip to content

Feature/ab#32508 approval flow cypress#2411

Merged
velang01 merged 2 commits into
devfrom
feature/AB#32508_approval_flow_cypress
May 6, 2026
Merged

Feature/ab#32508 approval flow cypress#2411
velang01 merged 2 commits into
devfrom
feature/AB#32508_approval_flow_cypress

Conversation

@velang01
Copy link
Copy Markdown
Contributor

@velang01 velang01 commented May 6, 2026

No description provided.

Velang and others added 2 commits May 6, 2026 08:34
- Change date filter from 'alltime' to 'last7days' when searching submissions
- Trim chefs-api-submission seeder to create exactly one submission (removes
  custom overrides, draft, file attachment, and retrieve test blocks)
- Fix clickPaymentInfoSave to target #savePaymentInfoBtn and intercept the
  PUT supplier-number API instead of a fixed wait
- Add page reload in ensureSiteInfoReady so DataTable re-initializes with the
  saved SupplierId before Refresh Site List is clicked
- Intercept sites-by-supplier-number API in ensureSiteInfoReady to wait on
  the actual response rather than a timer
- Scroll #main-left pane to bring SiteInfoTable into view before row checks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 632
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

Copy link
Copy Markdown
Contributor

@Stephan-McColm Stephan-McColm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acceptable in TEST
PASS in UAT
PASS in PROD

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Cypress approval-flow regression suite to rely on a deterministic CHEFS “seeder” submission (persisted to last-submission-id.json) and adjusts the approval workflow test to be more stable around Payment Info / Site Info behaviors and blocking modals.

Changes:

  • Convert the CHEFS API test into a single-purpose “Approval Flow Seeder” that creates one submission and writes its confirmation/submission ID to cypress/scripts/last-submission-id.json.
  • Update ApprovalFlow.cy.ts to prefer the seeded submission ID and to improve resilience around Payment Info → Refresh Site List and modal cleanup, while narrowing list filtering to last7days.
  • Update page-object interactions for Payment Info save/refresh actions (new selectors, forced blur).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
applications/Unity.AutoUI/cypress/scripts/chefs-api-submission.cy.ts Refactors the CHEFS API script into a seeder that creates one submission and writes an ID file for downstream approval-flow tests.
applications/Unity.AutoUI/cypress/regression/ApprovalFlow.cy.ts Adjusts approval-flow filtering and adds stability improvements for payment/site info refresh and blocking modal handling.
applications/Unity.AutoUI/cypress/pages/ApplicationDetailsPage.ts Updates selectors/flows for saving Payment Info and refreshing Site List (plus a forced blur on supplier number entry).

Comment on lines 116 to 119
listPage
.selectQuickDateRange("alltime")
.selectQuickDateRange("last7days")
.waitForTableRefresh()
.searchForSubmission(submissionId);
Comment on lines +351 to +353
// Wait for the button to become disabled (saving in-progress) or re-enabled (save complete).
// A cy.reload() always follows immediately, so we just need the click to register.
cy.wait(1500);
Comment on lines +362 to +367
cy.contains("Refresh Site List", { timeout: 20000 })
.should("be.visible")
.click({ force: true });

// Dismiss the "Action Complete" modal that always appears after refresh
cy.contains("button", "Ok", { timeout: 20000 })
Comment on lines 323 to +333
expect(response.status).to.be.oneOf([200, 201]);
expect(response.body).to.have.property("id");

if (response.body.id) {
createdSubmissionId = response.body.id;
const confirmationId = response.body.confirmationId || response.body.id;
cy.log(`✅ Submission created with ID: ${response.body.id}`);
cy.log(`✅ Confirmation ID: ${confirmationId}`);
cy.writeFile("cypress/scripts/last-submission-id.json", {
submissionId: confirmationId,
createdAt: new Date().toISOString(),
});
}
const confirmationId = response.body.confirmationId || response.body.id;
cy.log(`✅ Submission created with ID: ${response.body.id}`);
cy.log(`✅ Confirmation ID: ${confirmationId}`);

cy.writeFile("cypress/scripts/last-submission-id.json", {
submissionId: confirmationId,
createdAt: new Date().toISOString(),
});
@velang01 velang01 merged commit 1e14529 into dev May 6, 2026
29 checks passed
@JamesPasta JamesPasta deleted the feature/AB#32508_approval_flow_cypress branch May 7, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants