Skip to content

Conversation

@alex-magana
Copy link
Contributor

@alex-magana alex-magana commented Jan 5, 2026

Resolves JIRA: WS-222

Summary

Resolve inconsistent test assertions outcomes resulting from flaky
cy.setCookie('atuserid', 'value') behaviour for non-interactive cypress.

Code changes

  • Remove ATI_USER_ID_COOKIE equality assertion for click/view events.
  • Assert that the idclient parameter is present in click/view requests.
  • Pass applicationType in click/view event assertions where absent.

Developer Checklist

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local (Ready-For-Test, Local)
    • Test (Ready-For-Test, Test)
    • Preview (Ready-For-Test, Preview)
    • Live (Ready-For-Test, Live)
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

  1. List the steps required to test this PR.

Useful Links

@alex-magana
Copy link
Contributor Author

Other Approaches Explored

I attempted clearing the cookie and asserting it's correctly set by
calling getCookie after setCookie as shown below. This didn't result
in test passes.

export const setUserIDCookie = () => {
  cy.session('user-session', () => {
    cy.cleatCookie('atuserid');
    cy.setCookie('atuserid', JSON.stringify({ val: ATI_USER_ID_COOKIE }));
    cy.getCookie('atuserid').should(
      'have.property',
      'value',
      JSON.stringify({ val: ATI_USER_ID_COOKIE })
    )
  });
};

@alex-magana alex-magana merged commit e713831 into WS-222-clean-up-CanonicalATIAnalytics Jan 6, 2026
11 checks passed
@alex-magana alex-magana deleted the WS-222-clean-up-atuserid-assertions branch January 6, 2026 14:43
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.

4 participants