OpenConext / OpenConext/OpenConext-engineblock

WAYF Cypress spec: fix suppressed failures behind removed it.only (visibility/weight/defaultIdp)

Open
#2,110 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
17
Forks
25
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Background

While working on #2084 (Cypress/Behat coverage for the "remember my choice" epic), the pre-existing it.only(...) in tests/e2e/cypress/integration/skeune/wayf/wayf.general.spec.js was removed to allow other tests in the file to run again.

Running the full file exposed 20 failures (not the ~12 previously assumed). #2084 fixes the subset that is well-understood and cheap:

  • A test missing its own cy.visit() (breaks under Cypress's default testIsolation: true, which resets to a blank page between tests).
  • Raw connected/disconnected IdP count assertions that don't account for WayfController's addDiscoveries query param defaulting to true (which injects 2 fixed synthetic "discovery" IdPs into every render).

The remaining failures are left re-.skip()'d (with a comment pointing at this issue) because they look like a distinct, deeper problem needing dedicated investigation:

  • Visibility assertions tied to the wayf__idpList--cutoffMet CSS class (Should show no connected IdPs when cutoff point is configured, Should show no disconnected IdPs when the flag is false) — the element has the expected class but isn't actually hidden, suggesting either the CSS rule is missing/stale in the built theme assets for this test environment, or the class/behaviour contract has drifted.
  • search__submit / search__reset visually-hidden class toggling not happening as expected when typing in the search field (Should show no results when no IdPs are found, Should be able to search for an idp).
  • data-weight attribute assertions (6 tests) — findWeight.js / checkFullMatch.js / checkPartialMatch.js scoring constants (215/82/100/60/8/7) don't match any currently-rendered element; could be legitimate algorithm drift since these tests were written, unrelated to the discovery-idp noise.
  • .remainingIdps__defaultIdp banner not found / not toggling correctly in several tests (Check if the defaultIdp is present, Should reset the search text..., Should hide/show the IdP link when search term is provided).

No console/JS errors were observed during a quick browser check, which weakens the "broken build" theory somewhat, but this needs a proper investigation with fresh eyes — likely tracing whether the built CSS/JS actually matches current source for the container used to run these tests, and re-verifying the weight-scoring constants against current fixture data.

Task

Investigate and fix (or intentionally rewrite) the remaining suppressed test cases in wayf.general.spec.js, removing the .skip() added in #2084 once each is understood and passing for the right reason.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the full tests/e2e/cypress/integration/skeune/wayf/wayf.general.spec.js file and inspect each remaining skipped case. Trace the cutoff, search, defaultIdp, and weight assertions against the current built CSS/JS and fixture data. Done means the suppressed cases are understood, fixed or intentionally rewritten, and their .skip() markers are removed while the tests pass for the right reason.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, javascript
Domain
frontend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.