Commit cee36c5
authored
MENDELU/Fixed integration tests (#1294)
* Fix a11y link-name on thumbnail anchors in search-result list elements
* fix(metadata-link): cache resolver config permanently to stabilize /full item-page render
MetadataLinkService is a singleton (providedIn: root) that fetches 5 backend
configuration properties in parallel via combineLatest. The template on the
full item page subscribes to it via async pipes inside an @for loop over
metadata entries; subscriber count fluctuates as rows render, and with
shareReplay({ refCount: true }) the inner subscription was torn down and
re-created repeatedly, causing the 5 HTTP calls to repeat and the metadata
table to render slowly or inconsistently on Cypress CI runners.
- Switch shareReplay to refCount: false so resolver values are cached for
the lifetime of the service.
- Eagerly subscribe in the constructor so the fetches start as soon as the
service is created (during the first FullItemPageComponent instantiation),
warming the replay buffer before template subscriptions run.
* Revert "fix(metadata-link): cache resolver config permanently to stabilize /full item-page render"
This reverts commit 3b852c4.
* fix(a11y): satisfy aria-required-children on edit-item tablist and wait for inner content before axe checks
- edit-item-page tablist had disabled <button> children without role=tab; when all tabs start with enabled|async = false the <ul role=tablist> momentarily has no role=tab children, triggering aria-required-children. Add role=tab + aria-disabled=true + aria-selected=false + tabindex=-1 to the disabled button so the tablist always has valid children.
- For 4 axe checks that failed with 'No elements found for include in page Context' on CI runners (collection delete, community delete, item-edit status, item /full), wait for a stable inner element to render before calling testA11y; the host element passes :visible due to its padding/header even when its main content hasn't streamed in yet.
* fix(a11y,metadata-link): wait for host content before axe + cache resolver config permanently
Previous push reduced failures from 5 to 3 tests; remaining 3 all fail with 'No elements found for include in page Context': /full (despite 30s wait for .item-page + ds-item-page-title-field that PASSED), item-edit Bitstreams tab, community-edit Assign Roles tab.
1) testA11y(): when include is a CSS string, wait up to 30s for any child to exist on the host before running axe. Eliminates host-without-content races uniformly across every axe-checked spec.
2) MetadataLinkService: shareReplay refCount true -> false, plus eager subscribe in constructor. Service is providedIn root with combineLatest of 5 backend configuration HTTP calls. On /full item page, async pipes inside @for over metadata rows churn subscribers; with refCount true each churn tears down the inner subscription and re-fetches all 5 properties, causing the template to repeatedly re-evaluate and produce empty intermediate render states (visible as blank main content in the CI failure screenshot). Caching for the service lifetime stabilises the render.
* fix(a11y): pass resolved Element to axe instead of selector string to avoid 'No elements found' race
After previous push, CI improved 3->3 failures but the remaining 3 (community Delete, item-edit Curate, /full) all still fail with 'No elements found for include in page Context'.
Root cause: cypress-axe forwards the string selector context to axe.run, which re-resolves it via document.querySelectorAll at axe.run time. Between Cypress commands (injectAxe reads the axe-core source file, configureAxe evals window.axe.configure) several ms elapse; Angular can re-render and remove the host element from the document for one microtask, making the selector resolve to zero elements.
Fix: in testA11y, after waiting for the host with rendered descendants, resolve the selector ourselves and pass the live DOM Element reference (not the selector string) to cy.checkA11y. axe-core uses the Element directly and skips selector resolution, eliminating the race.
* test(a11y): pass all matched elements to checkA11y, not just first
Addresses Copilot review on PR #1294: when selector matches multiple elements, scanning only \[0] reduced coverage. Use \.toArray() so axe sees all matches like the original string-context did.1 parent 8bd9dfb commit cee36c5
12 files changed
Lines changed: 68 additions & 7 deletions
File tree
- cypress
- e2e
- support
- src/app
- entity-groups
- journal-entities/item-list-elements/search-result-list-elements
- journal-issue
- journal-volume
- journal
- research-entities/item-list-elements/search-result-list-elements/project
- item-page/edit-item-page
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
125 | 128 | | |
126 | 129 | | |
127 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
43 | 67 | | |
44 | 68 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
0 commit comments